Import Coinranking API Data to Airtable

Mar 11, 2021Andy Cloke

In this guide, you'll learn to import cryptocurrency prices to Airtable using the Coinranking API. Coinranking provides prices for all cryptocurrencies through their free API.

We'll use this API and the Data Fetcher Airtable extension to create a crypto portfolio tracker in Airtable.

Install Data Fetcher

Create Output Table

  • Create a table in your base called 'Coins'.
  • Add a field called 'Symbol' with type 'Single line text'.
  • Add a field called 'Price' with type 'Currency' and the maximum precision (number of decimal places).
Screenshot 2021-03-11 at 19.13.55.png

Import Coinranking API Data to Airtable

  • On the home screen of the Data Fetcher extension, click 'Create request'.

Screenshot 2021-02-17 at 16.12.14.png

  • On the create request screen, enter the request name 'Fetch Coin Prices'.

Based on the Coinranking API documentation the base URL for all API requests is 'https://api.coinranking.com/v2/'. We'll use the '/coins' endpoint to get prices for each cryptocurrency.

  • Enter this URL on the create request screen:

https://api.coinranking.com/v2/coins

  • Set the output table to the 'Coins' table by clicking 'Use current'.
  • Set the output view to 'Grid view' by clicking 'Use current'.

Screenshot 2021-03-11 at 19.47.31.png
  • Click 'Run'. You'll see a loading message while the request runs, then the response field mapping modal will open.
  • Click 'Filter all' to remove all fields, then re-add the following field mappings:
  • 'data.coins.symbol' -> 'Symbol'
  • 'data.coins.name' -> 'Name'
  • 'data.coins.price' -> 'Price'. Change the 'Data type' to 'Currency' first.
  • Click 'Confirm'. The request will run again and update the 'Coins' table.
  • Click 'Advanced' to open the Advanced settings and under 'Update based on Field', choose the 'Symbol' field. The extension will use this field to ensure the coins in your base match those in Coinranking.
  • Click 'Save'.

Pagination

By default, Coinranking gives returns 50 coins, but we can fetch more by turning on pagination.

  • In the Advanced settings under 'Pagination' select 'Offset'.
  • Set the number of pages to fetch to '3'. You can set it higher if you want to fetch more pages.
  • In the 'Offset parameter' input, enter 'offset'.
  • In the 'Limit parameter' input, enter 'limit'.
  • In the 'Limit value' input enter '100'. Coinranking will now return 3 pages of 100 coins.
  • Click 'Save' to save your request.
  • Click 'Run' to fetch 300 (3 pages x 100 coins per page) coins.

Build a Crypto Portfolio Tracker in Airtable

  • Create a table in your base called 'Portfolio'.
  • Change the primary field to 'Id' with type 'Autonumber'.
  • Add a field called 'Coin' that is linked to the 'Coins' table.
  • Add a field called 'Price' that is a lookup of the 'Coin' field's price.
  • Add a single select field called 'Exchange' with some options for the coin exchanges you use, e.g. 'Binance', 'Coinbase' e.t.c.
  • Add a field called 'Balance' with type 'Number'. This is how much of the coin you have in that exchange.
  • Add a formula field called 'Value (USD)' with the formula '{Price}*Balance' and select 'Currency' formatting with the maximum precision.

Screenshot 2021-02-24 at 09.53.15.png

Update Coin Prices Automatically

At the moment, we have to fetch prices from Coinranking's API by clicking the 'Run' button. However, we can use Data Fetcher's (paid) scheduled requests feature to automate this.

To upgrade your account, In Data Fetcher, scroll to Schedule and click 'Upgrade'.

schedule options

Choose a plan from the different options depending on your needs and enter your payment details.

data fetcher upgrade pricing plans.png

In Data Fetcher, click 'I've done this'.

Schedule Data Fetcher

Under Schedule click '+ Authorize'.

Schedule Data Fetcher

A window will open where you'll be prompted to authorize which Airtable bases you want Data Fetcher to have access to.

We recommended selecting 'All current and future bases in all current and future workspaces' to avoid any issues with unauthorized bases in the future.

Click 'Grant access'.

schedule-authorize-bases.jpg

Back in Data Fetcher, you'll see Schedule this request is now toggled on.

Select a schedule for the Coinranking Airtable integration to run. You can choose intervals of 'Minutes', 'Hours', 'Days' or 'Months', then click 'Save'.

Now any changes to your Coinranking data will be imported into Airtable automatically on your chosen schedule.

Schedule this request

Related Posts

How to Connect to the Coinbase API in Airtable with No-Code

How to Connect to the Coinbase API in Airtable with No-Code

Oct 11, 2022

Rosie Threlfall

CoinbaseCryptocurrency
How to Create an Airtable Crypto Tracker

How to Create an Airtable Crypto Tracker

Apr 12, 2022

Rosie Threlfall

Cryptocurrency
Import Historical Crypto Market Data in Airtable

Import Historical Crypto Market Data in Airtable

Feb 17, 2022

Andy Cloke

CoinGeckoCryptocurrency