Get news from newsapi using R language
In this article, we will learn how to create a Rscript to read the latest news. We will be using news API to get news and extract it using httr package in R Programming Language.
Get news API:
To get your API key visit newsapi.org and create your account.
Click on the Get API key to get your key. Make sure you have saved your key.
We will be using httr GET() to make URL requests and store news data in a variable. Now we will need JSON data so we have to convert the news data into char format because GET() returns raw data so we will need to use rawToChar() and to convert char data in JSON format we will be using from JSON() built-in jsonlite package.
Make sure to replace <YOURAPIKEY> with your API key in url.
Please Login to comment...