How to Debug Your API Requests
Find the cause of a failed or unexpected API response
Written by Erick Horn
June 28, 2026
Updated October 16, 2026
How to debug your API requests
Start with the HTTP status and the error’s code and message. Then check your key mode and quota in the response headers. If the cause is still unclear, try the same request in the dashboard’s API Playground and compare it with your API Logs.
Start with the HTTP status and error code
An API error has status: "not_ok", a request_id and an errors array. Read errors[0].code and errors[0].message. For a 400, the message usually names the parameter to fix.
Use cURL’s -i flag to print headers and the response body:
curl -i -H "X-API-Key: api_live_YOUR_KEY" \
"https://api.apitube.io/v1/news/everything?language.code=en&per_page=5"
See API error codes and HTTP responses for the status meanings.
Read the response headers
These headers help explain the response:
X-Request-ID: the request reference to include when contacting support.x-apitube-mode:testorlive, showing which kind of key you sent.x-points-remaining: remaining plan requests.x-balance-remaining: remaining pay-as-you-go balance, in cents.x-subscription-plan: the key’s plan.x-budget-remaining: remaining allowance under a monthly pay-as-you-go limit, if set.
Reproduce the call in the API Playground
Open API Playground in the dashboard. Select the same key, endpoint and parameters, then run the request. The Playground uses your real key, so its quota, permissions and restrictions apply.
If it works there, compare the request with your app’s request. Check the key, headers, parameter names and URL encoding.
Inspect the request in your API Logs
Open API Logs and filter Status to Errors. Narrow by key and date to find the call. Rows show time, type, status, latency, key, cost and endpoint. Open a row to see the query parameters and caller IP.
Compare the recorded parameters with the ones you intended to send.

Common gotchas to check first
- Shortened article text: check for a test key or Free plan. See masked results.
401: check for a missing, invalid or expired key. See authentication errors.403: check key restrictions and whether your plan includes the feature. See IP and scope blocks.429: wait before retrying and reduce request frequency or concurrency. See rate-limit errors.200with no articles: try fewer filters. See empty search results.
Common Questions
- Why does the same request work in the Playground but not in my code?
- How do I send enough detail for support?
- Can I see the exact request my code sent?
Why does the same request work in the Playground but not in my code?
Compare the key and its x-apitube-mode, authentication header, endpoint and parameters. Check URL encoding for spaces, quoted phrases and dates. Also check whether the two requests come from different IPs with different permissions.
How do I send enough detail for support?
Include the request_id or X-Request-ID, full error response, endpoint, HTTP method and time. Remove your API key from anything you share.
Can I see the exact request my code sent?
Yes. Open the call in API Logs to see the endpoint and query parameters alongside its status, latency and IP. Compare them with your intended request.