This article will teach you how to import CNBC data to Google Sheets using the Amigo Data Add-on. CNBC is one of the most popular business news channels that traders use to keep a track of important events that occur in the finance sector. These events have a huge impact on the securities market, thus, it is vital to be aware of such happenings and plan your investments accordingly.
To import CNBC data to Google Sheets, follow the steps mentioned below:
- Log in to RapidAPI and generate the API key
- Choose the endpoint
- Install the Amigo Data Add-on
- Import the data
How to import CNBC data to Google Sheets
Follow the steps given below to learn how to import CNBC data to Google Sheets.
Step 1: Get the API key
Login to RapidAPI here. If you don’t have an account created, you will need to click the Sign-up option and create one.
Search for CNBC API and click on the result according to the snippet below.
Click on the Subscribe to Test option and choose the plan you wish to subscribe to. The paid plans will allow you to make significantly more requests than the free plan, i.e., the Basic Plan.
Upon subscribing your API key will be generated and automatically added as one of the required parameters in the API documentation segment.
Step 2: Choose the API endpoint
In the leftmost section of the API documentation, you will find the list of endpoints available with which you can import CNBC data to Google Sheets.
For the purpose of the article, we will import the list of news headlines published by CNBC which are currently trending.
To do so, click on the drop-down arrow beside news→ and click news/v2/list-trending.
In the centre section of the API documentation, we will find a list of query names and their parameters. The endpoint we have chosen allows us to modify only the number of headlines returned by the API which is set to 30 by default. For instance, to reduce this number to 20 we need only replace 30 with 20 in the box containing the query value.
Once you have inputted the optional parameters click on Test Endpoint. If you have entered valid query values, you will find a success message at the rightmost section of the API documentation.
Click on Code snippets→ change the programming language from (Node.js) Axios→ Shell→cURL.
Copy the API endpoint URL and take note of the headers and their values. The same will be used later while using the Amigo Data extension.
Step 3: Get Amigo Data Google Sheets extension
The Amigo Data Add-on is an extension in Google Sheets that allows you to import data from various sources without coding.
You can either install the extension directly from the Google Workspace Marketplace or follow the steps below:
- Open a new google sheet
- Click on Extension→ Add-ons→ Get Add-on
- Search for “Amigo Data” and install it.
Step 4: Import the data to Google Sheets
Go to the Google Sheet in which you want the data to be pasted. Click on Extensions→Amigo Data→Connect
Select Custom API from the list of sources
Paste the API endpoint URL copied earlier under the API URL section. Select the Details tab and add the following headers along with their values noted earlier and click Preview.
Click on Flatten to present the data in separate columns. Once the data are separated into columns, click on Import.
Amigo Data Add-on will shortly import CNBC Data to Google Sheets and the list of trendy headlines will be displayed on your screen as shown below.
Amigo Data allows users to set a refresh schedule that automatically updates the data imported to ensure that the user is provided with the latest data without any manual input. To learn how to automatically update your data at regular intervals and receive alerts for the same on your email or Slack channel, click here.
In this article, we learned to import CNBC Data to Google Sheets. To learn how to import data from other sources, check out our blog.
Here are a few other articles that you might find useful.