Skip to content

Technical Questions and Answers

General Questions

How do I check the number of remaining requests?

The number of remaining requests is returned in the API response headers:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 32
  • X-RateLimit-Limit: Total request limit
  • X-RateLimit-Remaining: Number of remaining requests
  • X-RateLimit-Reset: The number of seconds remaining until the rate limit resets

How many articles can I get in one request?

The maximum number of articles you can get in one request depends on your subscription plan:

  • Free plan: 100 articles
  • Paid plans: up to 500 articles

To get more articles, use pagination with the page and per_page parameters.

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.

Authentication

What should I do if the API key doesn't work?

If your API key doesn't work:

  1. Make sure the key is specified correctly without extra spaces
  2. Check that the X-API-Key header is written correctly (case-sensitive)
  3. Make sure the key has not expired
  4. Check your account balance and limits
  5. Generate a new key in your personal account

Can I use one API key for multiple applications?

Yes, you can use one API key for multiple applications. However, we recommend creating separate keys for different applications for better control and security.

How do I update or replace an API key?

To update or replace an API key:

  1. Log in to your account at APITube
  2. Go to "Settings" → "API keys"
  3. Click "Generate new key"
  4. Update the key in your application

Requests and Filtering

How do I use multiple filters simultaneously?

You can combine any parameters to create complex queries. For example:

https://api.apitube.io/v1/news/everything?title=technology&language.code=en&category.id=4&published_at.start=2025-05-14

This request will return articles about technology in English in the "Technology" category, published after May 14, 2025.

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-31

This request will return articles published in January 2025.

Can I search for articles in multiple languages simultaneously?

Yes, you can specify multiple languages by separating them with commas:

https://api.apitube.io/v1/news/everything?language.code=en,fr,de

This request will return articles in English, French, and German.

Integration and Development

What is the maximum API response size?

The maximum API response size depends on the number of requested articles and their content. For large datasets, it is recommended to use pagination and limit the number of articles per page.

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:

json
{
    "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:

javascript
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?

The following practices will help you optimize API usage:

  1. Caching: Store request results on the client side for a certain time
  2. Pagination: Use the page and per_page parameters to get only the necessary data
  3. Precise filters: Use the most accurate filters to get only the articles you need
  4. Combine requests: Merge similar requests into one
  5. Background updates: Update data in the background on a schedule, not with every user request

Data Analysis

How do I interpret sentiment values in the response?

The sentiment field contains the sentiment assessment of the article:

json
"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 sentiment
  • negative > 0.4: The article has a negative sentiment
  • neutral > 0.4: The article has a neutral sentiment

If none of the values exceeds 0.4, the sentiment is considered mixed.

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=4&sort.by=relevance&sort.order=desc

Yes, to track trending topics:

  1. Get articles for the desired period with the published_at.start and published_at.end parameters
  2. Group articles by categories or topics
  3. Count the number of articles in each category
  4. 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=100

Troubleshooting

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:

  1. Check the number of remaining requests in the X-RateLimit-Remaining header
  2. Wait for the counter to reset (time in the X-RateLimit-Reset header)
  3. Implement caching of request results
  4. Optimize API usage
  5. Upgrade your subscription plan if necessary

Why am I getting an empty array of articles in the response?

An empty array of articles can occur for several reasons:

  1. Filters are too strict — try simplifying the request
  2. There are no articles matching your criteria
  3. You are requesting data that is too old (more than 90 days)
  4. 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=0

Why don't some articles contain the full text?

Not all articles contain the full text for several reasons:

  1. The article is behind a paywall (check the is_paywall field)
  2. Your subscription plan does not include access to the full text
  3. The publisher has restricted access to the full text
  4. 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?

To securely store your API key, follow these recommendations:

  1. Server applications: Store the key in environment variables or a secure secrets vault
  2. Client web applications: Never store the key on the client, make requests through a proxy on your server
  3. Mobile applications: Use a secure storage, such as Keychain (iOS) or EncryptedSharedPreferences (Android)
  4. 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:

  1. SQL injections
  2. XSS attacks
  3. CSRF attacks
  4. Command injection attacks
  5. DOS/DDOS attacks

All request parameters undergo strict validation before processing.

Advanced Usage

How do I use the API for brand reputation monitoring?

For brand reputation monitoring:

  1. Create a request specifying the brand name and sentiment analysis:
https://api.apitube.io/v1/news/everything?brand.name=Apple&sort.by=sentiment.overall.score
  1. Track changes in the sentiment of publications about the brand
  2. Set up alerts for negative publications
  3. Analyze the context of brand mentions

Can I receive notifications about new articles on a specific topic?

APITube does not provide a built-in notification mechanism, but you can implement it yourself:

  1. Create a regular task (cron job) that will poll the API at specific intervals
  2. Save the identifiers of already processed articles
  3. Compare new results with saved ones and identify new articles
  4. 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=desc

How do I use the API for competitive analysis?

For competitive analysis:

  1. Create requests specifying the names of competing companies:
https://api.apitube.io/v1/news/everything?organization.name=Apple,Samsung,Xiaomi&published_at.start=2025-01-01
  1. Compare the number of publications, sentiment, and topics
  2. Track product mentions and important events
  3. Analyze reactions to new products and competitors' initiatives

Integration with Other Services

Can I integrate APITube with Google Analytics?

Yes, you can integrate APITube with Google Analytics to track user interaction with news data:

  1. Create unique URL parameters for articles from APITube
  2. Add these parameters to article links
  3. Set up event tracking in Google Analytics
  4. Analyze user interaction with different news categories

How do I integrate APITube with BI (Business Intelligence) systems?

To integrate with BI systems:

  1. Create an ETL process that will regularly extract data from APITube
  2. Transform the data into a format suitable for your BI system
  3. Load the data into a data warehouse or directly into the BI system
  4. Create dashboards and reports for news data analysis

Can I integrate APITube with CRM systems?

Yes, you can integrate APITube with CRM systems to enrich customer profiles with news data:

  1. Develop integration using your CRM system's API
  2. Set up news searches about client companies through APITube
  3. Link news data to client profiles in the CRM
  4. Create automation to notify managers about important news

How do I create an RSS feed based on APITube data?

To create an RSS feed:

  1. Create a script that will request news through the APITube API
  2. Convert the received data to RSS format (XML)
  3. Update the RSS file at regular intervals
  4. Host the RSS file on your web server or use services that support dynamic RSS

Example of RSS generation:

php
<?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>

Additional questions and answers can be found in our general documentation or by contacting support service.