Technical Questions and Answers
General Questions
How do I check the number of remaining requests?
Read the response headers to see how many requests you can still send:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 32X-RateLimit-Limit: Total request limitX-RateLimit-Remaining: Number of remaining requestsX-RateLimit-Reset: The number of seconds remaining until the rate limit resets
How many articles can I get in one request?
The per_page parameter controls how many articles are returned per page:
- Default: 100 articles per page
- Maximum: 250 articles per page, or 200 on Basic, 50 on Starter and 10 on Free — requesting more returns
400 ER0171(Limit is out of range. Your plan allows up to N results per page.)
To get more results within your plan's limits, request the next page with page and per_page.
Free plan pagination limit: on the free plan you can only access the first 5 pages of results. Requesting page=6 or higher returns 400 ER0173. Upgrade to a paid plan to paginate beyond the first 5 pages.
How long are news articles stored in the system?
APITube stores news articles for 365 days from the publication date. After this period, articles are archived and not available through the general API. To access archived articles, contact our support service.
You can access the full 365 days, but a title search can cover at most 31 days per request. Use published_at.start and published_at.end to search one range at a time. A wider title-search range returns 400 ER0110; see Search window limit. Searches by category.id, entity.id or source.domain can cover all 365 days if they do not include a title search.
Authentication
What should I do if the API key doesn't work?
If your API key doesn't work:
- Copy the API key without extra spaces
- Check that the
X-API-Keyheader is written correctly (case-sensitive) - Make sure the key has not expired
- Check your account balance and limits
- Generate a new key in your APITube account
Can I use one API key for multiple applications?
Yes. Separate keys make it easier to manage access for each application.
How do I update or replace an API key?
To update or replace an API key:
- Log in to your account at APITube
- Go to "Settings" → "API keys"
- Click "Generate new key"
- Update the key in your application
Requests and Filtering
How do I use several filters at once?
Combine filters in one request. For example:
https://api.apitube.io/v1/news/everything?title=technology&language.code=en&category.id=medtop:20000002&published_at.start=NOW-7DAYSThis request will return articles about technology in English in the "Technology" category, published in the last 7 days. Because it searches the title, the published_at window may not exceed 31 days — see Search window limit.
What search operators does the query parameter support?
The query parameter supports the following operators:
- Logical AND:
technology AND innovation - Logical OR:
technology OR innovation - Logical NOT:
technology NOT blockchain - Grouping:
(technology OR innovation) AND (AI OR "artificial intelligence") - Phrases:
"artificial intelligence" - Word root search:
technolog*(will find "technology", "technologies", "technological", etc.)
How do I find articles for a specific time period?
To search for articles for a specific period, use the published_at.start and published_at.end parameters:
https://api.apitube.io/v1/news/everything?published_at.start=2025-01-01&published_at.end=2025-01-31This request will return articles published in January 2025.
Can I search for articles in several languages at once?
Yes, you can specify multiple languages by separating them with commas:
https://api.apitube.io/v1/news/everything?language.code=en,fr,deThis request will return articles in English, French, and German.
Integration and Development
What is the maximum API response size?
There is no fixed response-size limit. Responses grow with the number of articles and fields you request. Article text and entity details can make them large.
Use fl to request only the fields you need. For example, fl=id,title,href leaves out article text and other large fields. Reduce per_page if responses are still too large.
How do I handle API errors?
Always check the HTTP response code and status in the JSON response. When an error occurs, the API returns a not_ok status and error details:
{
"status":"not_ok",
"request_id":"fecf47d8-c90c-4c48-bdf0-bc34f6d41415",
"errors":[
{
"code":401,
"message":"API key is invalid or missing",
"links": {
"about":"https://docs.apitube.io/platform/news-api/http-response-codes"
},
"timestamp":"2025-05-11T17:02:46Z"
}
],
"user_input":null
}Implement error handling in your code, for example:
try {
const response = await axios.get('https://api.apitube.io/v1/news/everything', {
params: { /* params */ },
headers: { 'X-API-Key': API_KEY }
});
if (response.data.status === 'ok') {
// Process successful response
} else {
// Handle error
console.error(`API Error: ${response.data.message}`);
}
} catch (error) {
// Handle network or other exceptions
console.error(`Request error: ${error.message}`);
}How do I optimize API usage to save requests?
To use fewer requests:
- Cache results and reuse them while they are still useful.
- Use
pageandper_pageto fetch only the articles you need. - Narrow searches with specific filters.
- Combine searches that need the same results.
- Refresh data on a schedule and share the results across users.
Data Analysis
How do I interpret sentiment values in the response?
The sentiment field describes the tone of the article:
"sentiment": {
"overall": {
"score":0.07,
"polarity":"positive"
},
"title": {
"score":0.11,
"polarity":"positive"
},
"body": {
"score":0.03,
"polarity":"positive"
}
}Each value represents the probability of the corresponding sentiment:
positive> 0.4: The article has a positive sentimentnegative> 0.4: The article has a negative sentimentneutral> 0.4: The article has a neutral sentiment
If none of the values exceeds 0.4, the sentiment is considered mixed.
How do I get the most popular news on a topic?
To get the most popular news, use the /v1/news/top-headlines endpoint and sort by relevance:
https://api.apitube.io/v1/news/top-headlines?category.id=medtop:13000000&sort.by=relevance&sort.order=descCan I track trending topics for a specific period?
Yes, to track trending topics:
- Get articles for the desired period with the
published_at.startandpublished_at.endparameters - Group articles by categories or topics
- Count the number of articles in each category
- Sort categories by the number of articles
https://api.apitube.io/v1/news/everything?published_at.start=2025-01-01&published_at.end=2025-01-31&sort.by=relevance&sort.order=desc&per_page=100Troubleshooting
Why am I getting a "Too Many Requests" error?
The "Too Many Requests" error (HTTP 429) occurs when you exceed the request limit for your subscription plan. To solve this problem:
- Check the number of remaining requests in the
X-RateLimit-Remainingheader - Wait for the counter to reset (time in the
X-RateLimit-Resetheader) - Cache and reuse results
- Request only the articles and fields you need
- Upgrade your subscription plan if necessary
Why am I getting an empty array of articles in the response?
If results is empty, check these possible causes:
- Filters are too strict — try simplifying the request
- There are no articles matching your criteria
- You are requesting data that is too old (more than 90 days)
- There is a problem with the request parameters — check the syntax
How do I distinguish duplicate articles in the results?
APITube automatically identifies duplicate articles and marks them with the is_duplicate field. You can filter duplicates using the is_duplicate=0 parameter:
https://api.apitube.io/v1/news/everything?is_duplicate=0Why don't some articles contain the full text?
Full text may be unavailable because:
- The article is behind a paywall (the
is_freefield isfalse) - Your subscription plan does not include access to the full text
- The publisher has restricted access to the full text
- An error occurred while extracting the text
In these cases, the API returns the available part of the text or only the title and description.
Security
How do I securely store the API key in my application?
Keep your API key in storage suited to your application:
- Server applications: Store the key in environment variables or a secure secrets vault
- Client web applications: Never store the key on the client, make requests through a proxy on your server
- Mobile applications: Use a secure storage, such as Keychain (iOS) or EncryptedSharedPreferences (Android)
- Desktop applications: Use the system credential store
Does the API have protection against SQL injections and other attacks?
Yes, APITube implements protection against all major types of web attacks:
- SQL injections
- XSS attacks
- CSRF attacks
- Command injection attacks
- DOS/DDOS attacks
All request parameters undergo strict validation before processing.
Advanced Usage
How do I use the API for brand reputation monitoring?
To follow news about your brand and its tone:
- Create a request specifying the brand name and sentiment analysis:
https://api.apitube.io/v1/news/everything?organization.name=Apple&sort.by=sentiment.overall.score- Track changes in the sentiment of publications about the brand
- Set up alerts for negative publications
- Read the matching articles to understand why the brand is mentioned
Can I receive notifications about new articles on a specific topic?
To build your own notification checks:
- Schedule your code to check the API regularly, for example with a cron job
- Save the identifiers of already processed articles
- Compare new results with saved ones and identify new articles
- Send notifications through your preferred channel (email, push, webhook)
How do I get all articles by a specific author?
To get all articles by a specific author, use the author.name parameter:
https://api.apitube.io/v1/news/everything?author.name=John Doe&sort.by=published_at&sort.order=descHow do I use the API for competitive analysis?
For competitive analysis:
- Create requests specifying the names of competing companies:
https://api.apitube.io/v1/news/everything?organization.name=Apple,Google,Microsoft&published_at.start=2025-01-01- Compare the number of publications, sentiment, and topics
- Track product mentions and important events
- Analyze reactions to new products and competitors' initiatives
Integration with Other Services
Can I integrate APITube with Google Analytics?
Yes. Use Google Analytics to measure how people interact with the news you display:
- Create unique URL parameters for articles from APITube
- Add these parameters to article links
- Set up event tracking in Google Analytics
- Analyze user interaction with different news categories
How do I integrate APITube with BI (Business Intelligence) systems?
To integrate with BI systems:
- Fetch news from APITube on a schedule.
- Convert the response to the format your reporting system needs.
- Load the data into your reporting system or data warehouse.
- Build dashboards and reports from the news data.
Can I integrate APITube with CRM systems?
Yes. Use APITube to add relevant news to customer profiles in your CRM:
- Use your CRM's API to add news to company profiles
- Set up news searches about client companies through APITube
- Link news data to client profiles in the CRM
- Send managers an alert when new articles match the topics you choose
How do I create an RSS feed based on APITube data?
To create an RSS feed:
- Write a script that requests news from APITube
- Convert the articles to RSS (XML)
- Update the RSS feed on a schedule
- Host the feed on your web server or a service that supports RSS
Example of RSS generation:
<?php
$api_key = 'YOUR_API_KEY';
$url = 'https://api.apitube.io/v1/news/everything';
$params = [
'query' => 'technology',
'language' => 'en',
'limit' => 20
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url . '?' . http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-Key: ' . $api_key
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
header('Content-Type: application/rss+xml; charset=utf-8');
echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
<rss version="2.0">
<channel>
<title>Technology News</title>
<link>https://yourdomain.com/tech-news</link>
<description>Latest technology news</description>
<language>en-us</language>
<lastBuildDate><?= date(DATE_RSS) ?></lastBuildDate>
<?php foreach ($data['articles'] as $article): ?>
<item>
<title><?= htmlspecialchars($article['title']) ?></title>
<link><?= htmlspecialchars($article['url']) ?></link>
<description><?= htmlspecialchars($article['description']) ?></description>
<pubDate><?= date(DATE_RSS, strtotime($article['published_at'])) ?></pubDate>
<guid><?= htmlspecialchars($article['article_id']) ?></guid>
</item>
<?php endforeach; ?>
</channel>
</rss>See the general FAQ for more answers, or contact support.