What is a token and how many tokens does a request use?
Tokens are how API usage is counted. Each plan includes a number of tokens per month (the 5K plan includes 5,000 tokens). The cost of a request depends on the type of search, not on the number of results it returns:
- Article search on recent data (last 30 days): 1 token per request. One request returns up to 100 articles.
- Event search on recent data: 5 tokens per request (up to 50 events).
- Article search on historical data (older than 30 days): 5 tokens for each year the date range touches. Event search: 20 tokens per year.
- Aggregates (timeline, top sources, top concepts...): 5-50 tokens depending on the type.
- Stream of new articles (minuteStreamArticles): based on the number of returned articles (1 token per 100 articles).
- Autosuggest endpoints (suggestConceptsFast, suggestSourcesFast, suggestCategoriesFast, ...): free.
- Text analytics (annotation, categorization, article extraction): a fraction of a token per document.
Good to know:
- A request costs tokens even when it returns no results.
- Each page of results is a separate request (page 2 costs the same as page 1).
- Adding filters (sources, concepts, categories, languages) does not change the cost.
- The source of the returned articles doesn't change the cost.
The complete table is on newsapi.ai/plans. You can see the tokens used by each of your requests in the request log on your dashboard.