NAV
bash javascript

Info

Welcome to the generated API reference. Get Postman Collection

Development

All News

Search for any news on our system.

Example request:

curl -X GET \
    -G "http://localhost/api/v1/news?api_token=demo&sources=123&exclude_sources=123&language=en&published_after=2020-07-23&published_before=2020-07-25T14%3A00%3A00Z&published_on=totam&search=apple+inc&title=ceo&title_strict=true&description=tim+cook&keywords=business&main_text=apple&order_by_match_score=desc&order_by_added=true&entities=true" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "http://localhost/api/v1/news"
);

let params = {
    "api_token": "demo",
    "sources": "123",
    "exclude_sources": "123",
    "language": "en",
    "published_after": "2020-07-23",
    "published_before": "2020-07-25T14:00:00Z",
    "published_on": "totam",
    "search": "apple inc",
    "title": "ceo",
    "title_strict": "true",
    "description": "tim cook",
    "keywords": "business",
    "main_text": "apple",
    "order_by_match_score": "desc",
    "order_by_added": "true",
    "entities": "true",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "total_articles": 0,
    "articles_returned": 0,
    "article_limit": 50,
    "page": 1,
    "articles": []
}

HTTP Request

GET api/v1/news

Query Parameters

Parameter Status Description
api_token required Your authentication token
sources optional ID(s) of desired sources. Sources + their ID(s) can be found via our source API.
exclude_sources optional ID(s) of sources to exclude from results. Sources + their ID(s) can be found via our source API.
language optional Specify the language of news articles returned.
published_after optional Get all news articles published after this date.
published_before optional Get all news articles published before this date.
published_on optional Get all news articles published on this date.
search optional Dynamic filtering of anything included in title, description, keywords and main_text.
title optional Filter by words in the article title.
title_strict optional When using the title parameter you can add title_strict to get an exact match of the parameter.
description optional Filter by words in the meta description of the article.
keywords optional Filter by words in the meta keywords of the article.
main_text optional Filter by words in the main body of the article.
order_by_match_score optional When using the search parameter, you can order the results by match_score.
order_by_added optional Order results by the date they were added to our system.
entities optional Show key entities identified in main_text. This is only available on premium subscriptions.