Exploring a news data service
Let's now build a bot that will tweet news articles to its followers at regular intervals. We will then extend it to be personalized by users through a conversation that happens over direct messaging with the bot. In order to build a news bot, we need a source where we can get news articles. We are going to explore a news service called NewsAPI.org in this section. NewsAPI is a service that aggregates news articles from roughly 70 newspapers around the globe.
Setting up NewsAPI
Let us set up an account with the NewsAPI data service and get the API key:
- Go to newsapi.org:

- Click
Get API key
. - Register using your email.
- Get your API key.
- Explore the sources:
https://newsapi.org/v1/sources?apiKey=YOUR_API_KEY
.
There are about 70 sources from across the globe including popular ones such as BBC News, Associated Press, Bloomberg, and CNN. You might notice that each source has a category tag attached. The possible options are: business, entertainment, gaming, general, music...