Import Quandl Data to Google Sheets
Quandl is a data provider that lets you pull from a wide range of financial, real estate, and other data sets, all from a single API. They provide a mix of premium and free data sets, link directly to the source data sets for validation, and enable access through a simple API key. It’s a very intriguing resource for data hunters.
In this guide, we’ll walk through a simple but complete example of how to pull data from the Quandl API directly into Google Sheets, using the API Connector add-on for Sheets. We’ll first get an API key from Quandl, and then set up a request to pull in some data to your spreadsheet.
CONTENTS
- Before You Begin
- Part 1: Get your Quandl API Key
- Part 2: Create your API Request URL
- Part 3: Pull API data into Sheets
- Part 4: Get More Quandl Data
BEFORE YOU BEGIN
Click here to install the API Connector add-on from the Google Marketplace.
PART 1: GET YOUR QUANDL API KEY
- If you haven’t already, sign up for an account at https://www.quandl.com/.
- You will immediately be presented with your API key.
- Alternatively, if you already had an account and are logging back in, you can find your API key by navigating to the Account Settings menu.
- Either way, you’re all set. You can now access the Quandl API!
PART 2: SEARCH FOR A DATA SET
Quandl provides a huge number of data sets. It’s a bit overwhelming, so let’s start by narrowing it down with a search.
Here I’ll search for “Bitcoin” to see what’s available. For the purposes of this example, I’m filtering for free data sets.
The cool thing about Quandl is they provide a lot of examples to get you started. Here I’ve clicked into the top result, Bitcoin Watch. Clicking either Usage or Expand will produce some sample API request URLs.
Clicking Expand brings up a screen containing information about the data, including a link to its source, its last refresh data, and the data table. If you like, you can customize the data table by adjusting parameters above the header row (e.g. the from and to dates).
On the right-hand sidebar you’ll see a section called “API” that contains the request URLs you need to replicate this table in Google Sheets. You can choose any format, but CSV works best in a table, so let’s use that.
A modal will appear containing the full API request URL, including your API key.
Copy that to your clipboard. We have our first request URL!
https://www.quandl.com/api/v3/datasets/BITCOINWATCH/MINING.csv?api_key=API_KEY&start_date=2017-08-26
PART 3: PULL QUANDL DATA INTO GOOGLE SHEETS
Now let’s copy and paste that URL into API Connector.
- Open up Google Sheets and click Add-ons > API Connector > Open.
- In the Create tab, enter the API URL we just retrieved.
- We don’t need any headers so just leave that section blank. We don’t need any extra authentication, either, so leave authentication set to None.
- Create a new tab and click ‘Set current’ to use that tab as your data destination.
- Name your request and click Run. A moment later you’ll see the table we were just looking at replicated in your sheet.
PART 4: GET MORE QUANDL DATA
As mentioned above, the Usage tab also contains sample URLs that can be copied and pasted into API Connector:
Just plug those in and hit Run to see the data in your sheet.
Hopefully this little introduction has given a sense for what’s possible in the Quandl API. Quandl provides many examples for each data set, so you can usually begin by searching for what interests you, pulling out an example API URL, and then modifying it as desired.