Import Binance API Data to Airtable

In this guide, we'll learn how to import cryptocurrency prices from Binance to Airtable. Binance is a free source of crypto market data, e.g. coin prices, recent trades, exchange information and more. We will connect to Binance using the Data Fetcher app and create a crypto tracker in Airtable.

Create Coins Table

Create a table in your base called 'Coins'. Change the name of the primary field to 'Symbol'. Binance uses crypto trading pairs for symbols, e.g. 'ETHBTC'. You can find out more about crypto trading pairs here. In your coins table, add the trading pairs you want data as records.

Screenshot 2021-12-29 at 13.11.21.png

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 Binance Data to 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. We will create a request to import prices from Binance.

click-create-your-first-request.png

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

binance-application-selected.png

Enter a Name for your request, e.g. 'Import Coin Prices'.

For Endpoint, select 'Latest price for a symbol or symbols'. This determines what data we want to import from Binance to Airtable.

Click 'Save & Continue'.

binance-save-continue.png

We want to use the values in the 'Symbol' field in our table when importing from Binance. Under Symbol, click the + button to insert a reference to the table.

binance-symbol-add-icon.png

A modal will open where we can create the table reference. For Field, select 'Symbol'.

Group 1(29).png

Click 'Confirm'.

Group 1(30).png

The Symbol now has a reference to our table.

Screenshot 2021-12-29 at 13.20.41.png

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

Screenshot 2021-12-28 at 14.50.05.png

Click 'Save & Run'.

binance-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 Binance and how they should map to your output table. For each Binance 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.

Filter out the 'Symbol' field.

Group 1(32).png

Change the field type of the 'Price' field to currency using the dropdown.

Group 1(33).png

Click 'Save & Run'.

Group 1(34).png

Data Fetcher will create the 'Price' field, then import the price from Binance for every symbol in the 'Coins' table.

binance-imported-prices-data.png

Build an Airtable Crypto Tracker

Now we can use our table of coin prices to build an Airtable crypto tracker. This will track the value of our crypto portfolio based on the amount we hold and the latest prices.

Create a second table in your base called 'Portfolio'. Add a field called 'Symbol' that is linked to the first table (the table you imported Binance prices into). Then add a field called 'Price' that is a lookup of the 'Price' field in the first table.

Screenshot 2021-12-29 at 13.42.17.png

Add a field called 'Exchange' with type 'Single select' with options for the coin exchanges you use, e.g. 'Binance', 'Coinbase' etc.

Screenshot 2021-12-29 at 13.42.50.png

Add a field called 'Balance' with type 'Number'. This is how many of the coin you have in that exchange. Add a formula field called 'Value' with the formula {Price}*Balance and select 'Currency' formatting.

Screenshot 2021-12-29 at 13.43.25.png

We now have a built an Airtable crypto tracker that updates when time we run the request. You can see the total value of your portfolio in the Airtable summary bar.

Group 1(35).png

Import Binance API Data to Airtable Automatically

At the moment, we have to manually run the request and import the prices from Binance. We can use Data Fetcher's scheduled requests feature to automatically update them every 15 minutes/ hour/ day etc.

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

Group 1(23).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".

Group 1(24).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 prices from Binance automatically.

Group 11(2).png