glassnode-cli
Original:🇺🇸 English
Translated
Use the Glassnode CLI (gn) to list assets and metrics, fetch on-chain and market data from the Glassnode API, and manage config. Use when the user asks about Glassnode, on-chain data, crypto metrics, gn commands, or needs to call the Glassnode API from the terminal.
4installs
Sourceglassnode/glassnode-cli
Added on
NPX Install
npx skill4agent add glassnode/glassnode-cli glassnode-cliTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Glassnode CLI (gn
)
gnCommand-line interface for the Glassnode API.
Setup
If the command is not available you need to install the CLI. See the Installation section in the README for install and setup options.
gnQuick start:
bash
gn asset list
gn metric get market/price_usd_close --asset BTC --since 30dCommands
List assets
bash
gn asset list
gn asset list --filter "asset.semantic_tags.exists(tag,tag=='stablecoin')"
gn asset list --filter "asset.id=='BTC'"
# Prune to specific fields (returns array of objects)
gn asset list --prune id -o json
gn asset list -p id,symbol -o jsonDescribe an asset
bash
gn asset describe BTCList metrics
bash
gn metric list
gn metric list --asset BTC
gn metric list -a BTC -e binance -i 24h
gn metric list --assets BTC --assets ETH
gn metric list --from-exchange binance --to-exchange coinbaseFilter by any metadata query parameters: , , , , , , , , , , or multiple .
--currency--exchange--interval--from-exchange--to-exchange--miner--maturity--network--period--quote-symbol--assetsDescribe a metric (discover valid parameters)
bash
gn metric describe market/price_usd_close
gn metric describe market/price_usd_close --asset BTCFetch metric data
bash
gn metric get market/price_usd_close --asset BTC --interval 24h
gn metric get market/price_usd_close --asset BTC --since 2024-01-01 --until 2024-02-01
gn metric get market/price_usd_close --asset BTC --since 30d
gn metric get indicators/sopr --asset BTC --interval 24h --since 30d
gn metric get distribution/balance_exchanges --asset BTC --exchange binance --currency usdBulk fetch (multiple assets)
Append to the metric path. Repeat (or ) for each asset, or use for all:
/bulk-a--asset-a '*'bash
gn metric get market/marketcap_usd/bulk -a BTC -a ETH -a SOL -s 1d
gn metric get market/marketcap_usd/bulk -a '*' --interval 24h --since 30dConfig set / get
bash
gn config set api-key=your-key
gn config set output=csv
gn config get api-key
gn config get allGlobal Flags
| Flag | Short | Description |
|---|---|---|
| Glassnode API key | |
| | Output format: |
| Print the request URL without executing | |
| Timestamp format in output |
Best Practices
- Always call before
gn metric describe <path>to discover valid parameters, assets, exchanges, and intervals for a metric.gn metric get - Use (default) for structured output suitable for piping to
--output json.jq - Use to preview the API request URL without executing:
--dry-run.gn metric get market/price_usd_close --asset BTC --since 30d --dry-run - For bulk metrics (path ending in ), use
/bulkwith specific assets or-afor all.-a '*' - Relative time values are supported for and
--since: e.g.--until,30d,7d.1h
Output Formats
- (default) — JSON, suitable for
--output jsonprocessingjq - — CSV format, suitable for spreadsheets
--output csv - — human-readable ASCII table
--output table
bash
# Pipe JSON to jq
gn metric get market/price_usd_close -a BTC --since 7d | jq '.[].v'
# Export to CSV
gn metric get market/price_usd_close -a BTC --since 30d -o csv > prices.csv
# Quick look in the terminal
gn metric get market/price_usd_close -a BTC --since 7d -o table