https://github.com/neonarray/crypto-airtable
Update an Airbase table with cryptocurrency ticker data using a third-party API.
https://github.com/neonarray/crypto-airtable
airtable javascript nodejs
Last synced: about 2 months ago
JSON representation
Update an Airbase table with cryptocurrency ticker data using a third-party API.
- Host: GitHub
- URL: https://github.com/neonarray/crypto-airtable
- Owner: NeonArray
- Created: 2019-05-25T01:06:33.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T03:51:37.000Z (over 3 years ago)
- Last Synced: 2025-03-25T04:14:52.320Z (about 1 year ago)
- Topics: airtable, javascript, nodejs
- Language: JavaScript
- Size: 43 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Crypto-Airtable
This script will poll an API endpoint for fresh ticker data on most crytpo-currencies, and then update a base in Airtable. I haven't abstracted the script enough to be used with just any API endpoint, so to get it working with no tweaks - use the `https://api.coinmarketcap.com/v1/ticker/` endpoint. You will need to set up an Airtable base though, and then supply the name of the base and column you want to update, as well as your API keys.
## The Airtable Base
1. Create a new base - I called mine "Portfolio"
2. You really only need at minimum, 2 columns on your base for this app to work (the [brackets] indicate the field type).
a. `ID : [string]` - The ID of the crypto. Use the ID found in the `https://api.coinmarketcap.com/v1/ticker/` data, for example `ripple` or `litecoin`.
b. `Current Value : [Currency]`
## Initializing The Class
The class accepts two positional arguments:
Name | Default | Description
--- | --- | ---
`timer delay` | `60000` | Indicates how often the app should poll the API.
`max records` | `50` | The max number of records to pull from Airtable on setup.
```js
new AirtableTicker(60000, 50);
```
## Configuring
All of the configuration is done in the `.env` file. Take note that the field `COLUMN_TO_UPDATE_IN_AIRTABLE` is expecting the full name of the column, spaces, punctuation, and all.
For example, if your column name is `Current Value (Per Coin)`, your `.env` should reflect that.
`COLUMN_TO_UPDATE_IN_AIRTABLE="Current Value (Per Coin)"`