👋
- Open a Google sheet where you wish to use these scripts.
- Go to Tools › Script editor
- Copy the content of
CRYPTO.gs
and paste it in the script editor (replace any existing content). - Save the script with File › Save, name it CRYPTO, then close the script editor.
- Back to your Google sheet, refresh the page, a CRYPTO menu will appear next to Help
- That's it! You now have the
CRYPTO_PRICE()
function available in your sheet.
On your first installation, you won't have the price data right away, so you need to fetch it.
- Go to CRYPTO › Fetch API data.
- Wait for the script to finish running.
- Go to CRYPTO › Refresh prices.
Note: These two steps are required whenever you want to have the latest prices displayed (if you did not enable auto-refresh).
Display prices of a single cell:
=CRYPTO_PRICE(A1)
Display prices of a range (recommended):
=CRYPTO_PRICE(A1:A10)
Display prices of a range for the BTC pair:
=CRYPTO_PRICE(A1:A10, "BTC")
In order to refresh prices automatically, two things needs to happen. First, the data needs to be fetched from the API. Second, you need a "hack" to refresh the =CRYPTO_PRICE
functions.
- Go to Tools › Script editor.
- Go the the Triggers tab.
Create a new trigger that fetch the API data every 5 minutes (could be 10 too, note: I don't recommend every 1 minutes, itit might affect performance).
Create a new trigger that refresh the data every minutes.
You should now have your two triggers: