In this guide, we'll import stock prices from the Alpha Vantage API to Airtable. We will use the Data Fetcher Airtable app to connect to Alpha Vantage with no-code. We'll then build a stock tracker to manage our investments in Airtable.
Create a table in your base called 'Stocks'. If you've already got a table with your stock tickers/ symbols in, you can use that instead.
Change the name of the primary field to 'Symbol'. Add the stock symbols/tickers you want to import stock prices for, e.g. 'IBM', as records in this table.
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'.
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.
On the create request screen in Data Fetcher, for Application, select 'Alpha Vantage'.
Next, you need an Alpha Vantage API key. You can sign up for one here.
Enter this key into the API Key input in Data Fetcher.
For Endpoint, select 'Latest price (open, close, high, low etc.) for a stock'.
Enter a Name for your request, e.g. 'Import Stock Prices'. Then click 'Save & Continue'.
For Stock symbol, we want to insert a reference to our 'Stock symbol' field. First click the + button.
Then, on the modal that opens, select 'Stocks' for Table, 'Symbol' for Field, 'Grid view' for Run for every record in view. Then click 'Confirm'.
Stock symbol should now contain a reference to the table.
Select the Output Table & View you want to import stock prices into.
Alpha Vantage's free stocks API has a rate limit of 5 per minute, so we need to make sure we do not exceed this. Click 'Advanced settings' to open the advanced settings. Then scroll down to Rate Limit (requests per minute) and enter '5'. You can buy a premium Alpha Vantage plan to increase this limit.
Click 'Save & Run'.
The request will run and the Response field mapping modal will open. This is where you set how the available fields from Alpha Vantage (e.g. 'Price', 'Open', 'Close', 'Volume) should map to the fields in the output table.
For each Alpha Vantage user 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 'Price' field, which is the latest stock price. Import any other fields you want. Then click 'Save & Run'.
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 stock price into Airtable.
Create a table in your base called 'Portfolio'. Add a field called 'Stock' that is linked to the 'Stocks' table. Add a field called 'Price' that is a lookup of the 'Stock' table's 'Price' field.
Add a field called 'Shares' with type 'Number'. For each stock, enter how many shares you own. Add a formula field called 'Value (USD)' with the formula Price*Shares
and select 'Currency' formatting.
You have now created an Airtable stock tracker! Each time we run the 'Import Stock Prices' request in Data Fetcher and import the latest stock prices, the prices in our 'Portfolio' table will update. The 'Value (USD)' field will now contain the value of all shares for that stock symbol. The summary bar will contain the total value of all your investments.
At the moment, we have to manually run the request to import the stock prices 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'.
A new tab will open where you can select a plan and enter your payment details to upgrade.
Return to the Data Fetcher app and click 'I've done this'.
Click 'Add API key' in order to add your Airtable API key. You can find your Airtable API key here.
Enter your Airtable API key and click 'Save'.
Enable Schedule this request.
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 stock prices from Alpha Vantage automatically.
How to Import Company Revenue, EPS and Financial Ratios in Airtable
Import Historical Exchange Rates in Airtable
Import Time Series Data for Stocks in Airtable