Free News API so students, developers, and researchers could easily incorporate high-quality, relevant news information into their non-commercial projects.
This News API gives you limited access to our vast repository of global news content, including up to 30 days of historical news data. It also includes advanced search capabilities so you can quickly refine and target your news data searches. With access to relevant and timely news data, you can discover trends and analyze sentiment. You can build innovative applications and dashboards powered by news data.
Get your Access Token
To get access to the free news API, you only need to put your email in the following link. Follow this guide for a detailed explanation.
Making your first request
Use the API key we provided to make your first call to the API. Make sure you also specify a search term in the request. For example, the following API request will return news articles related to the search term “Bitcoin.” The default time frame is 3 days, but you can set this to up to 30 days.
https://api.webz.io/newsApiLite?token=[token]&q=Bitcoin
Advanced Search Queries and Filters
The news API gives you access to the advanced search filters and capabilities our premium open web API provides.
For example, you could search for news articles about U.S. President Joe Biden or his presidential challenger Donald Trump, refining the search to return articles with negative sentiment. Use the following Boolean query:
title:(Trump OR Biden) sentiment:negative
https://api.webz.io/newsApiLite?token=[token]&q=title%3A(Trump%20OR%20Biden)%20sentiment%3Anegative
This query includes negative news posts about President Biden or Donald Trump.
To see the full list of search filters visit the following link.
JSON Output
The news API response includes up to 10 search-results and a Meta Info area with reference to API consumption and the request itself, such as the "next" URL to get the next batch of search-results matching your query.
You can read about the output format and fields in the following link.
Pagination
Each request may return up to 10 posts matching your query. However, there may be significantly more results matching your filter parameters. To consume all the data, make sure you keep on calling the same URL string value that appears in the "next" key found in the output for each request.
Changing the Time-Frame
The default setting shows news articles that were collected in the last 3 days. However, you can search for articles collected up to 30 days ago. To do this, you can use the &ts
parameter in your URL. The &ts
parameter allows you to specify a timestamp, and you'll get articles that were collected after that timestamp. The timestamp should be in Unix format, which is a number representing milliseconds since January 1, 1970. You can convert a date to a Unix timestamp using this Timestamp/Date converter.
For example, in the URL <https://api.webz.io/newsApiLite?token=[token]&q=Bitcoin&ts=0>
, we've set &ts=0
to get articles from the oldest possible date within the 30-day limit. If you want to set a specific date, you can replace 0
with the Unix timestamp of that date.
Limitations
The API has very similar functionality to the News | Blogs | Discussions API with the following limitation:
- The API includes up to 1,000 monthly API calls and up to 10 results per API call
- The API is for non-commercial use cases
- The API doesn't include the full text of the articles, only the matching snippets
- The API doesn't provide access to blogs, reviews and forums data
- The API returns results by relevancy and doesn't support sorting