Joint session with Vercel: How to build intelligent storefronts (May 15th)

How to track down the source of high API requests in Sanity JS client?

16 repliesLast updated: Nov 29, 2025

Our API requests have skyrocketed. We're using the js client with CDN enabled, so not sure where these requests could come from. Is there a way to track down where the requests are coming from?
AI Update

Yes, there is! Sanity has a Request Logs feature that can help you track down where those API requests are coming from.

Accessing Request Logs

If you're on a self-serve plan, you can access request logs directly from your project settings:

The logs come as GZIPPED NDJSON files that contain detailed information about every request.

What You'll Find in the Logs

The request logs include really useful fields like:

Analyzing the Data

You can convert the compressed NDJSON to CSV for easier analysis:

gunzip --stdout [logfile].ndjson.gz | npx json2csv --ndjson --output [output].csv

Or use tools like jq, GROQ CLI, or even upload samples to ChatGPT to help analyze patterns.

Pro Tip: Filter Out Studio Requests

Requests from Sanity Studio are marked as studioRequest and don't count toward your API usage or cost. Make sure to filter these out when analyzing what's driving your actual API consumption.

Common Culprits to Look For

Based on your situation with CDN enabled, check for:

You might also want to implement request tags in your code going forward to make it easier to track which parts of your application are making which requests.

Show original thread
16 replies

Was this answer helpful?

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Related contributions