Import Time Series Data for Stocks in Airtable

In this guide, we'll import time series data for stocks in Airtable. We will use the Alpha Vantage API, which provides free daily/weekly/monthly stock time series data. We'll use the Data Fetcher Airtable app to import this data with no-code.

Install Data Fetcher

Install Data Fetcher from the Airtable app marketplace. After the app launches, sign up for a free Data Fetcher account by entering a password and clicking 'Sign up for free'.

Group 1Data Fetcher Sign Up .png

Import Time Series Data for Stocks in Airtable

On the home screen of the Data Fetcher app, click 'Create your first request'. Requests in Data Fetcher are how you import data to or send data from your Airtable base.

click-create-your-first-request.png

On the create request screen in Data Fetcher, for Application, select 'Alpha Vantage'.

alpha-vantage-application.png

Next, you need an Alpha Vantage API key. You can sign up for one here.

get-alpha-vantage-api-key.png

Enter this key into the API Key input in Data Fetcher.

For Endpoint, select 'Daily raw time series for a stock'. If you want to import weekly time series data, use 'Weekly raw time series for a stock'. Or if you want monthly, use 'Monthly raw time series for a stock'.

Enter a Name for your request, e.g. 'Import Time Series'. Then click 'Save & Continue'.

import-time-series-save-continue.png

Enter the Stock symbol you want to import time series data for, e.g. 'IBM'. If you instead want to import data for multiple different stocks, rather than entering one symbol, you can reference table values for Stock symbol.

time-series-stock-symbol.png

Set the Output size to 'Last 100 days'. You can increase this to the full-length series after you are happy with your setup.

time-series-output-size.png

Select the Output Table & View you want to import time series stock data into.

output-table-1.png

Click 'Save & Run'.

time-series-save-run.png

The request will run and the Response field mapping modal will open. This is where you set how the available fields from Alpha Vantage should map to the fields in the output table.

For each Alpha Vantage field, you can either import or filter it. For an imported field, you can set whether to map them to an existing field or create a new field, as well as set the field type.

Make sure you import the 'Time Series (Daily) Date' field, which is the date for each record, also import 'Time Series (Daily) 1 open' and change the type to 'Currency'. Import any other fields you want. Then click 'Save & Run'.

time-series-response-field-mapping.png

Data Fetcher will create any fields that need to be created in the output table, then run the request again for each symbol and import the time-series stock data into Airtable.

Import Time-Series Stock Data Automatically

At the moment, we have to manually run the request to import the time-series stock data from Alpha Vantage. We can use Data Fetcher's scheduled requests feature to automatically import them every 15 minutes/ hour/ day etc.

In Data Fetcher, scroll to Schedule and click 'Upgrade'.

table-1-schedule-upgrade-button.png

A new tab will open where you can select a plan and enter your payment details to upgrade.

Screenshot 2021-12-29 at 10.25.19.png

Return to the Data Fetcher app and click "I've done this".

table-1-schedule-ive-done-this-button.png

Click 'Add API key' in order to add your Airtable API key. You can find your Airtable API key here.

Group 11(1).png

Enter your Airtable API key and click 'Save'.

save-airtable-api-key.png

Enable Schedule this request.

schedule-data-fetcher-request.png

Select how often you want the request to run, e.g. 'Every 15 mins'. Click 'Save' The request will now run on the schedule and import the time-series stock data from Alpha Vantage automatically.

Group 11(2).png