News API is a simple and easy-to-use API that returns JSON metadata for the headlines currently published on a range of news sources and blogs (70 and counting so far).
Use it to display live news headlines and images in your app or on your site!
News sources
News API can provide headlines from 70 worldwide sources, including:
Live example
Request
GET https://newsapi.org/v1/articles?source=techcrunch&apiKey={API_KEY}
Live response
Documentation
Endpoints
Using News API is simple. There are only 2 endpoints:
GET https://newsapi.org/v1/articles
Provides a list of live article metadata from a news source or blog (99% of the time this is the one you want!).
Parameters
| source | (required) - The identifer for the news source or blog you want headlines from. Use the /sources endpoint to locate this or use the sources index. | ||||||
|---|---|---|---|---|---|---|---|
| apiKey | (required) - Your API key. Alternatively you can provide this via the X-Api-Key HTTP header. | ||||||
| sortBy |
(optional) - Specify which type of list you want. The possible options are top, latest and popular. Note: not all options are available for all sources. Default: top.
|
Request
GET https://newsapi.org/v1/articles?source=the-next-web&sortBy=latest&apiKey={API_KEY}
Response
| status | (string) - If the request was successful or not. Options: ok, error. In the case of error a code and message property will be populated. | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| source | (string) - The identifier of the source requested. | ||||||||||||
| sortBy | (string) - Which type of article list is being returned. Options: top, latest, popular. | ||||||||||||
| articles |
(array) The list of headline metadata requested.
|
GET https://newsapi.org/v1/sources
Provides a list of the news sources and blogs available on News API. You will need this to programmatically locate the identifier for the source you want articles from when querying the /articles endpoint.
Parameters
| category | (optional) - The category you would like to get sources for. Possible options: business, entertainment, gaming, general, music, politics, science-and-nature, sport, technology. Default: empty (all sources returned) |
|---|---|
| language | (optional) - The 2-letter ISO-639-1 code of the language you would like to get sources for. Possible options: en, de, fr. Default: empty (all sources returned) |
| country | (optional) - The 2-letter ISO 3166-1 code of the country you would like to get sources for. Possible options: au, de, gb, in, it, us. Default: empty (all sources returned) |
Request
GET https://newsapi.org/v1/sources?language=en
Response
| status | (string) - If the request was successful or not. Options: ok, error. In the case of error a code and message property will be populated. | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| sources |
(array) - A list of the news sources and blogs available on News API.
|