Documentation
The API is super straightforward, with just two endpoints.
One to get the newspapers, and the other for the articles.
BASE URL https://api.thenewspapersdb.com/v1/
GET /newspaper
Retrieves a list of newsletters
Headers
- x-api-key: Your API Key (Required)
Example cURL
curl --request GET \
--url 'https://api.thenewspapersdb.com/v1/newspaper/' \
--header 'x-api-key: **********'
Response
{"total": Integer, "data": Newspaper[]}
GET /article
Retrieves a list of articles that match given criteria
Headers
- x-api-key: Your API Key (Required)
Query
All of the follow query params are *optional*
- title_keywords: String[] - it will look for a match in articles titles
- newspapers: String[] - filter articles by the newspapers names
- order_by: "id" | "published_at" - column to order by, defaults to id (default id)
- offset: Integer - Pagination offset (default 0)
- limit: Integer - Pagination limit (default 10 / min 1 / max 20)
Example cURLs
curl --request GET \
--url 'https://api.thenewspapersdb.com/v1/article/' \
--header 'x-api-key: **********'
curl --request GET \
--url 'https://api.thenewspapersdb.com/v1/article/?newspapers=infobae&newspapers=iprofesional&order_by=published_at&title_keywords=america&title_keywords=florida&title_keywords=washington' \
--header 'x-api-key: **********'
Response
{"total": Integer, "data": Article[]}
Schemas
Newspaper
{id: integer}
name: string
base_url: string
timezone: string
country: string
language: string
Article
{id: integer}
title: string
url: string
description?: string
content?: string
thumbnail?: string
author?: string
published_at?: string(utc)
newspaper: {
id: string
name: string
timezone: string
}