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.

1

Create an account

Sign up for free to get your API key. No credit card required.

2

Get your API key

Navigate to your dashboard and create a new API key.

3

Make your first request

Use your API key in the X-API-Key header to make requests.

Your first API callbash
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:

https://api.newsapi.dev/v1

Authentication

All API requests require authentication via the X-API-Key header. You can generate API keys from your dashboard after creating an account.

Learn more about authentication

Response Format

All responses are returned in JSON format. A successful response includes a status field set to “ok”.

Successful Responsejson
{
  "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.

CodeStatusDescription
400Bad RequestThe request was malformed or missing required parameters.
401UnauthorizedInvalid or missing API key.
403ForbiddenYour plan does not have access to this endpoint or feature.
404Not FoundThe requested resource was not found.
429Rate LimitedYou have exceeded your plan's request limit. Wait for the limit to reset.
500Server ErrorAn internal server error occurred. Please try again later.

Available Endpoints

GET/v1/latest-news

Get the latest news articles with optional filtering by category, language, and country.

GET/v1/search

Full-text search across millions of articles with advanced filtering options.

GET/v1/sources

List all available news sources with filtering by language, country, and category.

GET/v1/categories

Get the list of all available news categories.

GET/v1/languages

Get the list of all supported languages with their ISO codes.

GET/v1/countries

Get the list of all supported countries with their ISO codes.