The News API Sources API

Available news sources and their metadata.

OpenAPI Specification

the-news-api-sources-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: The News All News Sources API
  description: The News API provides access to worldwide news articles and top stories from over 40,000 sources in 50 countries. Search and filter news by keyword, category, language, country, and date. All endpoints require an API token obtained by registering at thenewsapi.com.
  version: 1.0.0
  contact:
    url: https://www.thenewsapi.com/
  termsOfService: https://www.thenewsapi.com/terms
servers:
- url: https://api.thenewsapi.com/v1
security:
- apiToken: []
tags:
- name: Sources
  description: Available news sources and their metadata.
paths:
  /news/sources:
    get:
      operationId: getNewsSources
      summary: Get News Sources
      description: Retrieve available news sources and their metadata including domain, language, locale, and categories covered. Returns 50 results per page.
      tags:
      - Sources
      parameters:
      - name: api_token
        in: query
        required: true
        description: Your API authentication token.
        schema:
          type: string
      - name: categories
        in: query
        required: false
        description: Comma-separated categories to filter sources by.
        schema:
          type: string
      - name: exclude_categories
        in: query
        required: false
        description: Comma-separated categories to exclude.
        schema:
          type: string
      - name: language
        in: query
        required: false
        description: Comma-separated language codes to filter by.
        schema:
          type: string
      - name: page
        in: query
        required: false
        description: Page number for pagination (50 sources per page).
        schema:
          type: integer
          minimum: 1
          default: 1
      responses:
        '200':
          description: List of news sources.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SourcesResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    SourcesResponse:
      type: object
      properties:
        meta:
          type: object
          properties:
            found:
              type: integer
            returned:
              type: integer
            limit:
              type: integer
            page:
              type: integer
        data:
          type: array
          items:
            $ref: '#/components/schemas/Source'
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Error code.
            message:
              type: string
              description: Human-readable error description.
    Source:
      type: object
      description: A news source.
      properties:
        source_id:
          type: string
          description: Unique identifier for the source.
        domain:
          type: string
          description: Domain name of the source (e.g., cnn.com).
        language:
          type: string
          description: Primary language of the source.
        locale:
          type: string
          description: Country/locale code.
        categories:
          type: array
          items:
            type: string
          description: Categories covered by this source.
  responses:
    Unauthorized:
      description: Unauthorized - invalid API token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiToken:
      type: apiKey
      name: api_token
      in: query