360 Secure SkillHub
360 安全技能中心

nft-tracker

提供一组 shell 命令模板,通过 OpenSea API 获取 NFT 集合的地板价、成交量、持有人数与近期成交事件,并支持查询集合元数据和单枚 NFT 详情,另附地板价阈值告警脚本示例。使用前需自备 API key,依赖 curl 与 jq。

分类:数据
ianalloway
ianalloway
热度 48.33
最近更新 2026-11-06 04:04:50

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add ianalloway/nft-tracker
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
nft-tracker
description
Track NFT collection prices, floor prices, and sales data. Supports Ethereum collections including BAYC, MAYC, CryptoPunks, and more.
homepage
https://docs.opensea.io/reference/api-overview
metadata
{"openclaw":{"emoji":"🖼️","requires":{"bins":["curl","jq"],"env":["OPENSEA_API_KEY"]},"primaryEnv":"OPENSEA_API_KEY","envVars":[{"name":"OPENSEA_API_KEY","required":true,"description":"API key from https://docs.opensea.io/reference/api-keys"}],"install":[{"id":"jq-brew","kind":"brew","formula":"jq","bins":["jq"],"label":"Install jq (brew)"}]}}

NFT Price Tracker

Track NFT collection stats, floor prices, and recent sales using the OpenSea API.

Setup

Export your OpenSea API key (free tier available):

export OPENSEA_API_KEY="your-key"

Popular Collection Slugs

  • boredapeyachtclub - Bored Ape Yacht Club (BAYC)
  • mutant-ape-yacht-club - Mutant Ape Yacht Club (MAYC)
  • cryptopunks - CryptoPunks
  • azuki - Azuki
  • pudgypenguins - Pudgy Penguins
  • doodles-official - Doodles
  • clonex - CloneX

Collection Stats

Get collection floor and volume stats:

curl -s "https://api.opensea.io/api/v2/collections/mutant-ape-yacht-club/stats" \
  -H "X-API-KEY: $OPENSEA_API_KEY" | jq '{
  floor: .total.floor_price,
  volume: .total.volume,
  sales: .total.sales,
  num_owners: .total.num_owners,
  average_price: .total.average_price
}'

BAYC example:

curl -s "https://api.opensea.io/api/v2/collections/boredapeyachtclub/stats" \
  -H "X-API-KEY: $OPENSEA_API_KEY" | jq '.'

Collection Metadata

curl -s "https://api.opensea.io/api/v2/collections/mutant-ape-yacht-club" \
  -H "X-API-KEY: $OPENSEA_API_KEY" | jq '{
  name: .name,
  description: .description,
  image_url: .image_url,
  contracts: .contracts
}'

Recent Events / Sales

curl -s "https://api.opensea.io/api/v2/events/collection/boredapeyachtclub?event_type=sale&limit=10" \
  -H "X-API-KEY: $OPENSEA_API_KEY" | jq '.asset_events[] | {
  event_type: .event_type,
  order_hash: .order_hash,
  chain: .chain
}'

Contract addresses:

  • BAYC: 0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d
  • MAYC: 0x60e4d786628fea6478f785a6d7e704777c86a7c6
  • CryptoPunks: 0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb

NFT Lookup

Get details for a specific token (MAYC #1234):

curl -s "https://api.opensea.io/api/v2/chain/ethereum/contract/0x60e4d786628fea6478f785a6d7e704777c86a7c6/nfts/1234" \
  -H "X-API-KEY: $OPENSEA_API_KEY" | jq '.nft | {name, image_url, owners, traits}'

Price Alerts (Script Example)

Monitor floor price and alert when below threshold:

#!/bin/bash
COLLECTION="mutant-ape-yacht-club"
THRESHOLD=5  # ETH (or collection floor units)

FLOOR=$(curl -s "https://api.opensea.io/api/v2/collections/$COLLECTION/stats" \
  -H "X-API-KEY: $OPENSEA_API_KEY" | jq -r '.total.floor_price // empty')

if [ -n "$FLOOR" ] && (( $(echo "$FLOOR < $THRESHOLD" | bc -l) )); then
  echo "ALERT: $COLLECTION floor is $FLOOR (below $THRESHOLD)"
fi

Tips

  • OpenSea requires an API key for most endpoints — get one at https://docs.opensea.io/reference/api-keys
  • Rate limits apply — cache responses when possible
  • Use collection slugs for stats; use chain + contract + token id for precise NFT lookups
  • The old Reservoir api.reservoir.tools host no longer resolves; prefer OpenSea