API Documentation
Welcome to the NewsAPI documentation. Learn how to integrate real-time news data from 12,000+ sources into your applications.
Quick Start
Get up and running in under a minute. All you need is an API key.
Create an account
Sign up for free to get your API key. No credit card required.
Get your API key
Navigate to your dashboard and create a new API key.
Make your first request
Use your API key in the X-API-Key header to make requests.
curl -X GET "https://api.newsapi.dev/v1/latest-news?language=en" \
-H "X-API-Key: your_api_key_here"Base URL
All API requests should be made to the following base URL:
Authentication
All API requests require authentication via the X-API-Key header. You can generate API keys from your dashboard after creating an account.
Response Format
All responses are returned in JSON format. A successful response includes a status field set to “ok”.
{
"status": "ok",
"total_hits": 12847,
"page": 1,
"page_size": 10,
"articles": [
{
"title": "Article Title",
"description": "Article description...",
"content": "Full article content...",
"url": "https://example.com/article",
"image": "https://example.com/image.jpg",
"author": "Author Name",
"source": {
"id": "source-id",
"name": "Source Name",
"url": "https://source.com"
},
"category": "technology",
"language": "en",
"country": "us",
"published_at": "2025-01-15T14:30:00Z"
}
]
}Error Codes
When an error occurs, the API returns an appropriate HTTP status code along with a JSON error body.
| Code | Status | Description |
|---|---|---|
| 400 | Bad Request | The request was malformed or missing required parameters. |
| 401 | Unauthorized | Invalid or missing API key. |
| 403 | Forbidden | Your plan does not have access to this endpoint or feature. |
| 404 | Not Found | The requested resource was not found. |
| 429 | Rate Limited | You have exceeded your plan's request limit. Wait for the limit to reset. |
| 500 | Server Error | An internal server error occurred. Please try again later. |
Available Endpoints
Get the latest news articles with optional filtering by category, language, and country.
Full-text search across millions of articles with advanced filtering options.
List all available news sources with filtering by language, country, and category.
Get the list of all available news categories.
Get the list of all supported languages with their ISO codes.
Get the list of all supported countries with their ISO codes.