Import Historical Crypto Market Data in Airtable

In this tutorial, you'll learn how to import historical crypto market data in Airtable. We'll use CoinGecko, which provides free historical market data for price, market cap and volume, and the Data Fetcher Airtable app.

Create Market History Table

Create a table in your Airtable base called 'Market History'.

Create a field called 'Date' with type 'Date'. We want this field to contain sequential dates, one day apart, that we will import historical crypto data for. In the first record, select the earliest date you want market data for. In the next record, select the day after that. Highlight both cells, drag down the fill handle, and Airtable will fill the records with sequential dates.

Take a look at this Airtable support article for more information. You can also automate this using Airtable Automations, e.g. if you want a dynamic date range.

sequential-dates-part-2.gif

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 Historical Crypto Market Data in Airtable

Requests in Data Fetcher are how you import data to or send data from your Airtable base. We will create a request to import historical crypto market data from CoinGecko.

On the home screen of the Data Fetcher app, click 'Create your first request'.

click-create-your-first-request.png

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

coingecko-application-selected.png

For Endpoint, select 'Get historical data at a given date for a coin'. This determines what data we want to import from CoinGecko to Airtable.

Enter a Name for your request, e.g. 'Import Historical Data'.

Click 'Save & Continue'.

coingecko-historical-save-continue.png

Select the Coin you want to get historical data for, e.g. 'Bitcoin'.

coingecko-historical-coingecko.png

For Date, we want to insert a reference to our 'Date' field. First, click the + button.

coingecko-historical-date-add-icon.png

Then, on the modal that opens, select 'Market History' for Table, 'Date' for Field, 'Grid view' for Run for every record in view. Then click 'Confirm'.

coingecko-historical-date-reference.png

Date should now contain a reference to the table.

coingecko-historical-date-table-reference.png

Select the Output Table & View you want to import CoinGecko data into.

coingecko-historical-output-table.png

Click 'Save & Run'.

coingecko-historical-save-run.png

The request will run and the Response field mapping modal will open. This is where you set which fields to import from CoinGecko and how they should map to your output table. For each CoinGecko 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.

Click 'Filter all' to remove all the fields.

coingecko-historical-filter-all.png

Then search for 'USD'.

  • Import all the fields with 'usd' in.
  • Change 'Market data current price usd' to 'Currency price' and change the type to 'Currency'.
  • Change 'Market data market cap usd' to 'Market cap' and change the type to 'Currency'.
  • Change 'Market data total volume usd' to 'Total volume'.

coingecko-historical-response-field-mapping.png

Once you are happy, click 'Save & Run'.

Data Fetcher will create any fields that need to be created in the output table, then run the request again and import the historical crypto data to Airtable.

coingecko-historical-imported-data.png

Import Historical Crypto Market Data in Airtable Automatically

At the moment, we have to manually run the request and import the historical data from CoinGecko. We can use Data Fetcher's scheduled requests feature to do this automatically.

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'.

Group 1(10).png

Enable Schedule this request.

Group 1(12).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 historical crypto market data from CoinGecko automatically.