👋 Next.js Conf 2024: Come build, party, run, and connect with us! See all events

Understanding API Requests in Sanity.io: One request per query, regardless of the number of items.

2 replies
Last updated: Jul 12, 2023
How do API Requests work? If I query 10 items, is that classed at 1 API Request or 10? Or is is more about how much data is returned? My sanity API Requests seem very high for what I am doing.
For example this query:

*[_type == "post"]
{ 
    title,
    description,
    colour,
    mainImage{
      asset,
      alt,
      "lqip": asset->metadata.lqip,
    },
  },
}
Jul 12, 2023, 8:14 PM
Each query is a request, no matter what it includes, so your query of 10 items would be one API request (as would the example you posted).
Jul 12, 2023, 8:32 PM
That's great to hear, thanks!
Jul 12, 2023, 8:37 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?