On this page
Debugging API Requests
Check user_input in the response to see which parameters the API received. This helps you find misspelled names and characters affected by URL encoding.
Add debug=1 to include user_input in the response.
Parameters
0 is for false and 1 is for true.
| Parameter | Description | Type | Required |
|---|---|---|---|
debug | Include the user_input object in the response | integer | No |
Request Example
shell
curl "https://api.apitube.io/v1/news/everything?per_page=10&api_key=YOUR_API_KEY&debug=1"WARNING
Use debug while investigating a request. Remove it from production requests.
Use the checks below to find common request problems.
Common Issues and Solutions
1. Authentication Errors
If you're receiving 401 or 403 errors, check the following:
- Check that you copied the API key correctly
- Check that the key has not expired
- Check that you have points left and have not exceeded your request limit
- Check the authentication header name and value
Example of a correct authentication request:
bash
# Option 1: API key in header
curl -H "X-API-Key: YOUR_API_KEY" https://api.apitube.io/v1/news/everything
# Option 2: Bearer token
curl -H "Authorization: Bearer YOUR_API_KEY" https://api.apitube.io/v1/news/everything
# Option 3: API key in URL (not recommended for production)
curl https://api.apitube.io/v1/news/everything?api_key=YOUR_API_KEY2. Request Parameter Issues
If you're getting unexpected results or 400 errors:
- Check if the parameters are spelled correctly
- Make sure parameter values match expected formats
- Use proper URL encoding for special characters
Example of a request with multiple parameters:
bash
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.apitube.io/v1/news/everything?title=Apple iPhone&language.code=en&published_at.start=NOW-7DAYS&per_page=10"3. Rate Limit Restrictions
If you're receiving 429 errors (Too Many Requests):
- Check your current usage in your account dashboard
- Add delays between requests
- Consider caching results
- Request the articles and fields you need in each call
Additional Tips
- Start with one filter, then add the others one at a time.
- Check the API version in your request URL.
- Check your plan's rate limit.
- Handle error responses in your code.
- If the problem continues, contact support.