TheNewsAPI provides real-time access to news content from worldwide. Our comprehensive API delivers high-quality, timely information with advanced filtering capabilities to help you integrate news content into your applications, dashboards, or research.
Currently, we offer specialized access to crypto news content, with plans to expand to global news categories in the near future. Our platform is designed to serve developers, researchers, businesses, and financial analysts who need reliable, structured news data.
To use TheNewsAPI, you'll need an API key. Follow these steps to obtain yours:
Your API key is confidential. Never share it publicly or commit it to public repositories. Use environment variables or secure configuration to store your API key in your applications.
Once you have your API key, you can start making requests to our endpoints. Here's a simple example to get you started:
https://api.thenewsapi.net/crypto?apikey=YOUR_API_KEY
You can customize your request with various parameters to filter results according to your needs. Continue reading to explore all available options and advanced features.
The Crypto News endpoint provides access to our comprehensive database of cryptocurrency news articles from 2000+ of trusted sources worldwide.
https://api.thenewsapi.net/crypto
Parameter | Type | Description |
---|---|---|
apikey * | string | Your API key (required unless using Authorization header) |
q | string | Search query with optional logical operators (&, |, !) Maximum length: 100 characters. |
from | string | Start date in ISO 8601 format (YYYY-MM-DD or YYYY-MM-DDThh:mm:ssZ) |
to | string | End date in ISO 8601 format (YYYY-MM-DD or YYYY-MM-DDThh:mm:ssZ) |
categories | string | Comma-separated list of categories (e.g., defi,nft,bitcoin) |
sentiments | string | Comma-separated list of sentiments (e.g., positive,neutral,negative) |
sources | string | Comma-separated list of source domains (e.g., coindesk.com,cointelegraph.com) |
langs | string | Comma-separated list of language using ISO 639-1 code (e.g., en,zh) |
page | integer | Page number for paginated results (default: 1) |
size | integer | Number of results per page |
* Fields marked with an asterisk are required.
When using the categories
parameter, you can filter articles by the following categories:
Example: categories=DeFi,markets,blockchain
to get articles related to DeFi, markets, and blockchain.
Authentication is required for all requests to TheNewsAPI. Our API uses API key authentication, which is a simple and secure method for verifying your identity and managing access to our services.
Each API key is unique to your account and gives you specific permissions and rate limits based on your subscription plan. Your API key is used to track your usage, apply appropriate rate limits, and ensure you're properly billed for the resources you consume.
You can find your API key in your dashboard. If you need to regenerate your API key for security reasons, you can do so from the same page.
Include as query parameter:
https://api.thenewsapi.net/crypto?apikey=YOUR_API_KEY
Chain parameters with &:
?q=bitcoin&from=2024-01-01&apikey=YOUR_API_KEY
If authentication fails, the API will return an error response with a 401 Unauthorized
status code:
All API responses are returned in JSON format with a consistent structure.
Field | Type | Description |
---|---|---|
success | Boolean | Indicates if the request was successful |
data | Object | Contains the response data (for successful requests) |
error | Object | Error information (only present for failed requests) |
Field | Type | Description |
---|---|---|
count | Integer | Total number of articles matching your query |
previous | String | null | URL for the previous page (null on first page) |
next | String | null | URL for the next page of results (null if no more pages) |
results | Array | Array of article objects containing the actual news data |
Field | Type | Description |
---|---|---|
article_id | String | Unique identifier for the article |
source | Object | Information about the publication source |
category | String | Primary category of the article. See Available Categories for the complete list of supported categories. |
language | String | Language code (ISO 639-1 code) |
url | String | URL to the original article |
thumbnail | String | URL to the thumbnail image |
authors | Array | Array of author names |
description | String | Brief summary of the article |
content | String | Full text content of the article |
images | Array | Array of image URLs from the article |
videos | Array | Array of video URLs from the article |
coins | Array | Array of cryptocurrency entities mentioned in the article |
published_at | String | Publication date and time (ISO 8601 format) |
summary | String | AI-generated summary of the article content |
sentiment | String | AI-determined sentiment of the article (positive, neutral, negative) |
keywords | Array | Array of relevant keywords extracted from the content |
NER | Object | Named Entity Recognition data, categorizing entities found in the content. See Named Entity Recognition (NER) section for details on entity types. |
* Fields may vary based on your subscription plan.
Fields with AI-generated content (summary, sentiment, keywords, NER) are highlighted in the table above and may vary based on your subscription plan. Check the pricing page for details on feature availability by plan.
TheNewsAPI uses standard HTTP status codes to indicate the success or failure of an API request:
Status Code | Description | Common Causes |
---|---|---|
200 OK | Request successful | Valid request that completed successfully |
400 Bad Request | Invalid request | Missing required parameters, invalid parameter values |
401 Unauthorized | Authentication failed | Invalid or missing API key |
403 Forbidden | Access denied | Insufficient credits remaining, IP address restrictions, or account has been blocked due to violation of terms of service |
404 Not Found | Resource not found | Requested endpoint or resource does not exist |
429 Too Many Requests | Rate limit exceeded | You've exceeded your rate limit |
500 Internal Server Error | Server error | Something went wrong on our servers |
503 Service Unavailable | Service unavailable | The server is currently unable to handle the request, please try again later |
To ensure the security of your integration with TheNewsAPI, follow these best practices:
Always use HTTPS for all API requests to ensure encrypted data transmission.
Implement proper rate limiting handling in your applications to gracefully handle quota limits.
When displaying content from the API, implement proper sanitization to prevent XSS attacks.
TheNewsAPI uses cursor-based pagination to help you navigate through large result sets efficiently. Here's how to work with our pagination system:
page
: Page number (starting from 1) size
: Number of results per page (default: maximum size for your plan) Plan | Maximum Articles |
---|---|
Free | 10 articles per request |
Basic | 40 articles per request |
Pro | 50 articles per request |
Enterprise | 50 articles per request |
The maximum number of articles you can retrieve per request corresponds to the "Articles per credit" value in your plan.
Each response includes next
and previous
pagination URLs that you can use to navigate through the results:
next
URL to fetch the next page of results previous
URL to go back to the previous page next
is null
, you've reached the end of the results previous
is null
, you're on the first page TheNewsAPI provides powerful search capabilities to help you find exactly the content you need. Here's how to make the most of our search functionality:
Use the q
parameter to search for keywords in article content:
https://api.thenewsapi.net/crypto?apikey=YOUR_API_KEY&q=bitcoin
The q
parameter must be properly encoded
q='Bitcoin ETF approval' & regulation
↓q=%27Bitcoin%20ETF%20approval%27%20%26%20regulation
Combine search terms with logical operators to create precise and powerful search queries. These operators help you narrow down or expand your search results based on your specific needs.
Require both terms to be present in the results
bitcoin & ethereum
Include articles containing either term
bitcoin | ethereum
Exclude articles containing the specified term
bitcoin & !scam
Combining multiple operators:
Find regulatory news about Bitcoin or Ethereum, excluding scam-related content
Using with phrases:
Find news about layer 2 solutions on Optimism or Arbitrum, excluding testnet-related content
q
parameterFor users who prefer a visual approach to creating API queries, TheNewsAPI provides an interactive Query Builder tool in your dashboard.
The Query Builder allows you to construct complex API queries without writing code:
The Query Builder is available to all registered users and provides an excellent way to experiment with different query parameters before implementing them in your application.
TheNewsAPI implements rate limiting to ensure optimal performance and fair usage across all users. These limits help maintain service stability while providing appropriate capacity for each subscription tier.
Plan | Rate Limit |
---|---|
Free | 30 per 10 minutes |
Basic | 900 per 10 minutes |
Pro | 900 per 10 minutes |
Enterprise | 900 per 10 minutes |
Each API response includes headers to help you track your usage:
X-RateLimit-Limit
: Maximum requests allowed
X-RateLimit-Remaining
: Requests remaining in period
X-RateLimit-Reset
: Time left in seconds until rate limit resets
If you receive a 429 Too Many Requests
response:
Implement exponential backoff for retries
Check the X-RateLimit-Reset
header
TheNewsAPI uses a credit-based system for subscription plans. Different plans offer different credit allocations and article return limits:
Plan | Credit Allocation | Articles per Credit | Additional Credits | Features |
---|---|---|---|---|
Free | 100 / day | 10 | Not available | 12-hour delayed data, basic features |
Basic | 15,000 / month | 40 | $0.006 / credit | Real-time data, 6-month history, full content |
Pro | 35,000 / month | 50 | $0.005 / credit | 9-month history, dedicated support, 99.99% uptime |
Enterprise | 120,000 / month | 50 | $0.005 / credit | 12-month history, dedicated support, 99.99% uptime |
Check our pricing page for the most current plan details and pricing information.
You can upgrade or downgrade your subscription plan at any time. When changing plans, proration is applied to ensure fair billing:
Changes apply immediately
You're only charged the difference between plans for the remainder of the billing cycle
Immediately receive the higher credit allocation and increased limits
Changes apply immediately
You receive a credit toward your next invoice for the unused portion of your current plan
The lower plan limits begin immediately
Key Benefits of Proration:
To change your plan, visit your Subscription Dashboard and click on "Change Plan".
Understanding how credits translate to articles will help you optimize your API usage and manage your subscription effectively.
Credits are deducted for each successful API request that returns articles. Each successful call to an endpoint uses 1 credit, regardless of how many articles are returned (up to your plan's maximum).
Credits are NOT deducted for failed API requests (error responses).
If you need more API credits beyond your plan's monthly allocation, you can purchase additional credits directly from your dashboard:
Additional credits expire at the end of your current billing cycle. Make sure to use them before your plan renews.
Our API includes Named Entity Recognition (NER) data in article responses. NER identifies and categorizes key elements in text into pre-defined categories such as people, organizations, locations, monetary values, and more.
The NER
field in article responses contains entities grouped by the following types:
Entity Type | Description | Examples |
---|---|---|
PERSON | Names of people | Vitalik Buterin, Elon Musk |
NORP | Nationalities, religious or political groups | American, Democrats, Retail Investors |
ORG | Organizations, companies, agencies | Ethereum Foundation, Coinbase, SEC |
GPE | Countries, cities, states | United States, Singapore, London |
LOC | Non-GPE locations | Asia, Silicon Valley, the Alps |
FAC | Buildings, airports, highways, bridges | Burj Khalifa, JFK Airport |
PRODUCT | Objects, vehicles, cryptocurrencies | Bitcoin, ETH, Tesla Model S |
EVENT | Named events | Consensus 2025, Bitcoin Halving |
WORK_OF_ART | Books, songs, whitepapers | Bitcoin Whitepaper, CryptoTimes |
LAW | Named laws and regulations | Securities Act, GDPR |
MONEY | Monetary values | $1.5 billion, €20,000 |
PERCENT | Percentage values | 15%, 2.5% |
QUANTITY | Physical quantities, measurements | 5 gigawatts, 21 million coins |
DATE | Dates or periods | January 2025, Q3 2024 |
TIME | Times of day | 9:30 AM EST, midnight |
CARDINAL | Numerals | 42, three hundred |
LANGUAGE | Named languages | English, Chinese, Solidity |
NER data is particularly valuable for tracking mentions of specific cryptocurrencies, organizations, or individuals across news articles. You can use this data to build relationship graphs or monitor sentiment around specific entities in the crypto market.