You can retrieve recent headlines with api.datanews.io/v1/headlines
endpoint.
curl -XGET 'api.datanews.io/v1/headlines?q=Dow%20Jones&country=us'
{
"status": 200,
"numResults": 29,
"hits": [
{
"url": "https://economist.com/dow-surged",
"source": "economist.com",
"authors": [],
"title": "Dow Jones surged after Department of Labor report.",
"pubDate": "2020-05-08T20:50:03+00:00",
"country": "us",
"language": "en",
"description": "Dow Jones surged for 400 points, after Department of Labor jobs report surpassed expectations.",
"imageUrl": "https://economist.com/dow-surged/image.jpg",
"content": "...",
},
...
]
}
The values of passed parameters should be url encoded.
# | Parameter | Description |
---|---|---|
1 | q | Search query, may consist of any number of keywords. See building advanced queries. |
2 | source | Domain name of the source (e.g. economist.com ). |
3 | country | Publisher's country. See the list of available countries. |
4 | language | Article language. See the list of supported languages. |
5 | topic | Topic of the source that published the article, could be general ,
business , tech , entertainment , sports ,
science , health . Note, that this may be not the topic of a particular article,
as media organizations may publish articles, that can have multiple topics. |
6 | page | Zero-based page index, must not be negative. |
7 | size | Page size, could be 10, 25 or 100. |
8 | sortBy | Sort by relevance or by date . |