Google Sheets Integration
Blokiments API Google Sheets integration
Last updated
Blokiments API Google Sheets integration
Last updated
A Google Docs version of the guide is available here.
This document will show you how to automatically fetch and update your spreadsheet crypto data using Google Apps Script and Blokiments API.
Create a new Google Spreadsheet or use an existing one.
You MUST SPECIFY 2 columns:
A1 -> ADDRESS - (contract/pool address) This will determine which token/pool you want to analyze. It can be either a token address or a pool address.
B1 -> CHAIN - This will determine what chain to look for in your token/pool.
Available values: solana
, ethereum
, bsc
, arbitrum
, base
, tron
, apechain
Next, ADD the TOKENS you want to analyze. Example:
Now, you need to select which metric you want to see. You do this by naming the columns from C onwards with specific names.
EXAMPLE - we want to see the TICKER name (C1), if the token is a SCAM (D1), Beta vs. BTC (E1), and Holders HII (F1) for our tokens
Remember! The column name must exactly match the available metric name. You can select as many as you wish.
For quick copy-paste:
For the script to run, you also need an API Key.
Register on Blokiments. Go to Blokiments - REFERRAL LINK
Use the referral link to obtain great deals and exclusive features in the future
If you don't have an account, click Register in the upper right corner to create one.
Log in with your credentials and navigate to API Keys in the hamburger menu on the top left:
Click on the orange button with a +
on it to start creating a new API key. And then name it as you wish. The key name is only for you to separate if you have multiple keys. Once you name it, click the orange button Create new key.
You can now copy and save the new API key. If you lose the saved key at any time, you can revisit the “API key” section of the Blokiments web app and copy the key again.
Return to the Google Spreadsheet we set up in the first section of this tutorial.
On the top of the spreadsheet, click on Extensions > Apps Script.
Please select the following script and copy it. Then, paste the script into the App Scripts grey window we opened before.
Script Overview
The script will:
Fetch Blokiments data for each address and network combination listed in the spreadsheet’s columns A and B using the Blokiments API
Parse the JSON response from the response and extract the data
Write the data to your active spreadsheet
Now, we have a very important step: scroll to the top of the script in the App Scripts. Now, you need to replace the “API_KEY” in the first line of the script with the API key you created in the previous section (Obtaining an API key). Go to Blokiments and copy the key now.
So, now, this part of the script:
It should look something like this:
Two things to consider:
Each user will have a different API key; the key shown in this picture, “Pq1lfppsp10oapppeo141oeqro23reg0f_lags” is just for tutorial purposes; your key will be different.
Now, the script in the App Scripts should look something like this:
Save the script by clicking on the Save
icon at the top of the window:
Now, we want to run the script. In the same tab where you have clicked “Save Button,” click the dropdown menu to ensure the method “main” is selected. Then, Run the script to populate the Google Spreadsheet we created earlier.
The first time you run the script, you need to review permissions since this is an unverified script you just created:
Click on advanced options and then click go to Untitled project (unsafe)
Accept all conditions that will appear and click Allow in the pop-up window. After the script was run, if there was no error, you should get a similar output:
The data can now be found in your spreadsheet.
If you want to change addresses and chains, add more metrics to track, or refresh the data, go to the spreadsheet we created, make the desired changes, and ensure it is saved (usually autosaves).
Go again to extensions > App Script; the script should already be there, and click on Run.
NOW YOU ARE DONE. You can check the rest of this tutorial to get more information.
Full API docs -> https://api.blokiments.com/documentation
The blockchain on which this token and pool are found.
Address of the token and address of the pool.
They are not the same thing!
A token contract address is a unique address that represents a token on the blockchain.
In DEX (decentralized exchange) trading, a pair address refers to the smart contract address of a liquidity pool for a specific token pair. One token can have multiple pools or pair addresses.
Every token needs to specify how many “decimals” it has. When you buy 1 PEPE on dextools, this “1” is a human-friendly number. The actual number is 1 * 10^(d), where “d” is the decimals of the token.
The name of the token and the token’s symbol.
If the selected token was marked as a scam by our security engine. We account for previous rug pulls, honeypots, or scams.
The amount of liquidity (in USD) for the given pool.
Percentage amount of tokens used for liquidity that are locked or burned.
For example, if 100% is locked or burned, there is almost no way you can get the rug pulled (of course, there are different types of scams that can still happen).
(!!! Some liqs are scammy. Locker providers still have their backdoors. Also, this doesn’t protect you against hidden mint !!!)
The total market cap is calculated by multiplying the total token supply by the current price.
The total token supply is the number of coins created minus any coins burned (removed from circulation).
The circulating market cap is calculated by multiplying all the circulating tokens supplied with the current price.
Circulating supply is defined as the amount of coins circulating in the market and tradeable by the public.
Alpha measures the performance of a token relative to its expected return based on a specific benchmark (like BTC). It helps assess whether a token is outperforming or underperforming after accounting for its inherent risk and market conditions.
Here’s what different alpha values mean:
Alpha > 0: The token has outperformed its benchmark
Alpha = 0: The token has performed as expected, matching its benchmark's return.
Alpha < 0: The token has underperformed its benchmark.
Beta measures a token's price relative to a specific benchmark, like Bitcoin, Ethereum, or Solana. It helps assess the token's volatility and risk compared to the benchmark.
Here's what different beta values mean:
Beta = 1: The token moves in sync with the market. The token will likely do the same if the market rises or falls by 5%.
Beta > 1: The token is more volatile than the market. For example, if the market rises by 5%, the token might rise by 7% (and fall more sharply in downturns).
Beta < 1: The token is less volatile than the market. If the market rises or falls by 5%, the token's movement may be smaller, like 3%.
Beta = 0: No correlation with the market; the token's price moves independently.
Negative Beta: The token moves in the opposite direction of the market. If the market rises, the token tends to fall, and vice versa.
RSI is a tool that measures how fast and how much the price of a token changes over some time, in this case, 30 days. It helps determine whether a token might be overbought (too high and could drop) or oversold (too low and could rise). The RSI value ranges from 0 to 100:
RSI > 70 suggests the token might be overbought.
RSI < 30 suggests the token might be oversold.
A moving average is a calculation that shows the average price of a token over a specific period - in the current case, this is the last 7 days. It smooths out short-term price changes and helps identify trends. For example, if the token's price is going up steadily, the moving average will also go up, showing a clear upward trend. It's like looking at the big picture of the price instead of focusing on every small change.
It tells us how much a price has changed in a given interval.
HOLDER describes how many unique wallets are holding this token.
Change in holders tells us how many holders have changed in a given interval.
Exp: holder_change_1d = 30, means that 30 new wallets have started holding this token
It tells us what % of supply the top X holders hold.
Exp: HOLDERS_TOP10_SUM = 20%. The top 20 whale wallets hold 20% of all token supply.
DEX wallets are excluded.
The Herfindahl-Hirschman Index of the selected token. The Herfindahl-Hirschman Index (HHI) is a common measure of market concentration used to determine market competitiveness.
Identifies the wallet rank at which half the total token supply is held. For example, if the median rank is 50, the first 50 holders collectively own 50% of the total supply. Indicates whether the token supply is top-heavy (dominated by a few wallets) or more evenly distributed. The higher the value, the better.
The percentage of the total token supply held by the token deployer. The deployer is the wallet that created the token contract. Indicates whether the deployer significantly influences the token's market dynamics.
You must NOT remove quote characters ( ) surrounding your API key.