
Coinank Openapi
- 13 installs
- 12 repo stars
- Updated August 3, 2026
- okx/plugin-store
Helps with ai & agent building tasks during AI-assisted development.
About
coinank-openapi is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.
- coinank-openapi
- AI & Agent Building
- AI-coding skill
Coinank Openapi by the numbers
- 13 all-time installs (skills.sh)
- +3 installs in the week ending Aug 4, 2026 (Skillselion tracking)
- Ranked #11,389 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/okx/plugin-store --skill coinank-openapiAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 13 |
|---|---|
| repo stars | ★ 12 |
| Last updated | August 3, 2026 |
| Repository | okx/plugin-store ↗ |
What it does
Helps with ai & agent building tasks during AI-assisted development.
Files
Pre-flight Dependencies (auto-injected by Plugin Store CI)
Run once per session before first use. These checks ensure required tools are installed.
Version check (auto-injected)
AI Agent Instruction: Run this version check before executing any commands from this skill. The check is a read-only fetch fromraw.githubusercontent.com— it does not install anything. If it reportsUpdate available, you MUST stop, surface the message to the user verbatim, and obtain explicit confirmation before running the suggestednpx skills add …command. Do not run the update silently. After a confirmed update completes, re-read this SKILL.md before proceeding.
# Check for skill updates (1-hour cache).
# Network scope: this block calls raw.githubusercontent.com for the version probe only.
# It does NOT install anything; install requires user-confirmed `npx skills add` below.
UPDATE_CACHE="$HOME/.plugin-store/update-cache/coinank-openapi"
CACHE_MAX=3600
LOCAL_VER="1.0.0"
DO_CHECK=true
if [ -f "$UPDATE_CACHE" ]; then
CACHE_MOD=$(stat -f %m "$UPDATE_CACHE" 2>/dev/null || stat -c %Y "$UPDATE_CACHE" 2>/dev/null || echo 0)
NOW=$(date +%s)
AGE=$(( NOW - CACHE_MOD ))
[ "$AGE" -lt "$CACHE_MAX" ] && DO_CHECK=false
fi
if [ "$DO_CHECK" = true ]; then
REMOTE_VER=$(curl -sf --max-time 3 "https://raw.githubusercontent.com/okx/plugin-store/main/skills/coinank-openapi/plugin.yaml" | grep '^version' | head -1 | tr -d '"' | awk '{print $2}')
if [ -n "$REMOTE_VER" ]; then
mkdir -p "$HOME/.plugin-store/update-cache"
echo "$REMOTE_VER" > "$UPDATE_CACHE"
fi
fi
REMOTE_VER=$(cat "$UPDATE_CACHE" 2>/dev/null || echo "$LOCAL_VER")
if [ "$REMOTE_VER" != "$LOCAL_VER" ]; then
echo "Update available: coinank-openapi v$LOCAL_VER -> v$REMOTE_VER."
echo "ACTION REQUIRED: ask the user to confirm before running:"
echo " npx skills add okx/plugin-store --skill coinank-openapi --global"
echo "(This contacts the npm registry and github.com/okx/plugin-store and overwrites this skill. Do NOT auto-run.)"
fiInstall onchainos CLI + Skills (auto-injected)
# 1. Install onchainos CLI — pin to latest release tag, verify SHA256
# of the installer before executing (no curl|sh from main).
if ! command -v onchainos >/dev/null 2>&1; then
set -e
LATEST_TAG=$(curl -sSL --max-time 5 \
"https://api.github.com/repos/okx/onchainos-skills/releases/latest" \
| sed -n 's/.*"tag_name"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' | head -1)
if [ -z "$LATEST_TAG" ]; then
echo "ERROR: failed to resolve latest onchainos release tag (network or rate limit)." >&2
echo " Manual install: https://github.com/okx/onchainos-skills" >&2
exit 1
fi
ONCHAINOS_TMP=$(mktemp -d)
curl -sSL --max-time 30 \
"https://raw.githubusercontent.com/okx/onchainos-skills/${LATEST_TAG}/install.sh" \
-o "$ONCHAINOS_TMP/install.sh"
curl -sSL --max-time 30 \
"https://github.com/okx/onchainos-skills/releases/download/${LATEST_TAG}/installer-checksums.txt" \
-o "$ONCHAINOS_TMP/installer-checksums.txt"
EXPECTED=$(awk '$2 ~ /install\.sh$/ {print $1; exit}' "$ONCHAINOS_TMP/installer-checksums.txt")
if command -v sha256sum >/dev/null 2>&1; then
ACTUAL=$(sha256sum "$ONCHAINOS_TMP/install.sh" | awk '{print $1}')
else
ACTUAL=$(shasum -a 256 "$ONCHAINOS_TMP/install.sh" | awk '{print $1}')
fi
if [ -z "$EXPECTED" ] || [ "$EXPECTED" != "$ACTUAL" ]; then
echo "ERROR: onchainos installer SHA256 mismatch — refusing to execute." >&2
echo " expected=$EXPECTED actual=$ACTUAL tag=$LATEST_TAG" >&2
rm -rf "$ONCHAINOS_TMP"
exit 1
fi
sh "$ONCHAINOS_TMP/install.sh"
rm -rf "$ONCHAINOS_TMP"
set +e
fi
# 2. Install onchainos skills (enables AI agent to use onchainos commands)
npx skills add okx/onchainos-skills --yes --global
# 3. Install plugin-store skills (enables plugin discovery and management)
npx skills add okx/plugin-store --skill plugin-store --yes --global---
Overview
CoinAnk OpenAPI provides access to cryptocurrency derivatives market data, including K-lines, ETFs, open interest, long/short ratios, funding rates, liquidations, order flow, whale activity, and related analytics. Use direct API-key authentication when available, or use Agent Payments Protocol / x402 pay-per-call access through the latest OKX payment skill when CoinAnk returns a payment challenge.
Pre-flight Checks
Before using this skill, ensure:
1. Review the user's requested market-data task and select the matching reference OpenAPI file under references/ when endpoint details are needed. 2. If COINANK_API_KEY is available, use API-key mode and send it only in the apikey request header. 3. If no API key is available, send the original request first and only start Agent Payments Protocol / x402 payment handling after a real HTTP 402 Payment Required challenge or an OKX payment-skill charge requirement. 4. For paid challenges, use okx-agent-payments-protocol; do not implement wallet signing manually in this skill. 5. Confirm any payment with amount greater than zero with the user before payment execution. Zero-amount challenges are valid and must remain exactly zero.
Commands
This is a skill-only plugin. The command names below describe agent workflows, not a shipped local binary.
coinank-openapi quickstart
Use when the user is new to the plugin or has not chosen an access mode. Explain API-key access, Agent Payments Protocol / x402 pay-per-call access, and the OKX charge payment method when required by the OKX payment skill.
Output: Recommended access mode, required prerequisites, and the safest next request.
Example: Ask the agent to run the coinank-openapi quickstart flow before the first CoinAnk data request.
coinank-openapi query-market-data
Use when the user asks for CoinAnk market data such as K-lines, funding rates, liquidations, open interest, long/short ratios, order flow, ETF data, whale activity, or trending symbols.
Output: A concise answer based on the selected CoinAnk endpoint, including key parameters used and any access or payment requirements encountered.
Example: Ask for BTC funding rates, ETH liquidation heatmap data, or Binance BTCUSDT open interest.
coinank-openapi use-api-key
Use when COINANK_API_KEY is available or the user wants direct membership access. Send the request with the apikey header and do not start a pay-per-call flow unless the user explicitly requests it.
Output: Final API response summary or a clear authentication/API-level error.
Example: Query /api/fundingRate/current with the user's CoinAnk API key.
coinank-openapi pay-per-call
Use only after CoinAnk returns a real HTTP 402 Payment Required challenge or the OKX payment skill indicates a required payment flow. Delegate payment execution to okx-agent-payments-protocol, including x402 proof generation or the newer charge method when required.
Output: User-facing payment summary, confirmation request when amount is greater than zero, and final replayed API response after successful payment.
Example: Complete a zero-amount payment challenge without coercing 0 to 0.000001, then replay the same request with the generated payment data.
Access Modes
This skill supports two access paths:
1. Direct mode -- use COINANK_API_KEY in the apikey request header. 2. Pay-per-call mode -- pay via Agent Payments Protocol or x402 when CoinAnk returns an HTTP 402 Payment Required challenge, then replay the same request.
COINANK_API_KEY is optional. If it is not present, the skill must still attempt access discovery and use Agent Payments Protocol or x402 when available.
First-Time User Guidance
When a new user starts using this skill, make the access options explicit:
- If the user already has a CoinAnk API membership, tell them to provide
COINANK_API_KEY. - If the user does not have a CoinAnk API membership, tell them they can still try Agent Payments Protocol or x402 pay-per-call access when CoinAnk returns a payment challenge.
- Do not present API membership as the only way to use the skill.
Dependencies for Agent Payments Protocol / x402
Agent Payments Protocol / x402 pay-per-call mode depends on the OKX Onchain OS payment stack:
okx-agent-payments-protocolokx-agentic-wallet
Use the latest okx-agent-payments-protocol skill. It supports both payment-proof generation for Agent Payments Protocol / x402 challenges and the newer charge payment method. Do not hard-code an older x402-only flow; delegate payment execution to okx-agent-payments-protocol and follow the payment method returned or required by that skill.
If an Agent Payments Protocol, x402, or charge payment flow is needed but those skills are unavailable, instruct the user to install or update okx/onchainos-skills first.
Zero-Amount Payment Challenges
Agent Payments Protocol / x402 challenges with an amount of 0 are valid and must be supported. Do not treat a zero-amount challenge as malformed, unpaid, or unsupported.
When the challenge amount is 0:
- Clearly tell the user that the request requires a payment proof but the charge amount is zero.
- Continue through
okx-agent-payments-protocolto generate the required proof or authorization with the original zero amount. - Replay the exact same request with the generated payment header.
- Do not replace
0with any fallback, minimum, dust, or micro amount such as0.000001USDC/USDT. - Do not require paid-call confirmation solely because the amount is zero, but still respect any wallet or protocol confirmation required to sign/authorize the proof.
Agent Payments Protocol / x402 Signing Scheme Constraint
When a payment challenge is signed, the signing scheme must match the signer type:
- EOA private key -> use the `exact` scheme.
- OKX contract wallet / OKX wallet session signing -> use the `aggr_deferred` scheme.
Do not mix these paths:
- Do not use
aggr_deferredfor EOA private-key signing. - Do not use
exactfor OKX contract-wallet signing.
Operating Mode
This skill must operate in an on-demand loading mode. Do not read every OpenAPI file by default. Load only the schema needed for the user's request.
Required Workflow
When handling a user request, follow this sequence strictly:
1. Read the project README Read README.md before making any request so you follow the documented conventions, access modes, and edge cases.
2. Identify the relevant API category Scan the filenames under {baseDir}/references/ and determine which OpenAPI file matches the user's request.
3. Read only the required schema Open only the selected .json file and inspect its paths, parameters, response shape, and endpoint-specific restrictions. In the paths object, each key is an API path.
4. Validate request parameters Confirm required parameters, supported enum values, and whether the endpoint accepts optional fields such as endTime, size, interval, or exchanges.
5. Choose the access strategy
- If
COINANK_API_KEYis present, prefer direct mode first. - If
COINANK_API_KEYis absent, use discovery mode: send the original request without an API key and let the server tell you whether the route is public, payable via Agent Payments Protocol or x402, or still unavailable without membership.
6. Construct the original request Build the exact request the user asked for.
- Base URL: use
https://open-api.coinank.comunless the schema specifies a different server. - Authentication:
- Direct mode: send
apikey: $COINANK_API_KEY - Discovery mode: do not send
apikeyand do not fabricate any payment header before seeing a real402 - Timestamps: if the endpoint accepts
endTime, prefer a current millisecond timestamp unless the user explicitly requested another time. - Examples: timestamps shown in OpenAPI example fields are historical examples only and must not be reused as-is.
7. Send the original request first Always send the original request before attempting wallet login, payment signing, or payment header construction.
8. Interpret the response
- HTTP 2xx + business code `"1"`: return the result.
- HTTP 402: this route is payment-gated. Switch into the Agent Payments Protocol / x402 payment flow.
- HTTP 2xx + business code `"-3"`:
- If an API key was supplied, treat it as invalid or insufficient and tell the user to fix their CoinAnk access.
- If no API key was supplied and no HTTP 402 challenge was returned, explain that the request did not enter the Agent Payments Protocol / x402 payment path and still cannot be completed without valid access.
- Other failures: explain the failure clearly and include the key technical reason.
9. Run the Agent Payments Protocol / x402 payment flow only after a real payment requirement Use okx-agent-payments-protocol and follow its confirmation, login, signing, charge, and replay flow.
- For HTTP
402 Payment Requiredchallenges, generate the required Agent Payments Protocol / x402 payment proof and replay the same request. - If the latest OKX payment skill indicates or requires the newer
chargepayment method, use thatchargeflow instead of forcing the legacy x402-only proof path. - Do not check wallet status before a real payment requirement is known.
- Do not log in preemptively.
- Do not charge speculatively.
- If the challenge amount is
0, treat it as a valid zero-amount payment challenge and still generate the required proof or authorization using exactly0; never coerce it to0.000001or any other minimum non-zero amount. - If signing with an EOA private key, use the `exact` scheme when the OKX payment flow uses x402 proof signing.
- If signing with an OKX contract wallet / wallet session, use the `aggr_deferred` scheme when the OKX payment flow uses x402 proof signing.
10. Replay the exact same request After the OKX payment flow completes, replay the same method, URL, query parameters, and request body. Only add the payment header or authorization data required by the selected Agent Payments Protocol / x402 or charge flow.
11. Return the final paid response Return the successful result from the replayed request, not the intermediate 402 payload.
Multi-Call Guard
If the user asks for a wide analysis that would likely require multiple paid API calls and there is no valid COINANK_API_KEY, stop and warn that the task may incur multiple Agent Payments Protocol / x402 payments. Ask for confirmation before triggering a multi-call paid workflow.
Critical Rules
- Do not bulk-load schemas
Unless the user explicitly requests cross-category analysis, do not open multiple OpenAPI JSON files at once.
- Do not invent parameters
Pass only the parameters defined by the selected schema. Some endpoints return empty results when extra parameters are added.
- Do not invent payment support
Treat a request as Agent Payments Protocol / x402 payable only when CoinAnk actually returns an HTTP 402 Payment Required challenge. A challenge amount of 0 is still a valid payment challenge and must remain exactly zero throughout proof generation.
- Do not mix signing schemes
Use exact for EOA private-key signing, and use aggr_deferred for OKX contract-wallet or OKX wallet-session signing.
- Do not bypass the challenge
Never attempt Agent Payments Protocol / x402 signing unless you have already received a real 402 response for the exact request being made.
- Do not mutate the paid request
The replayed request must match the original request exactly except for the payment header.
- Validate required arguments first
Ensure all required parameters are present and schema-compliant before making the request.
- Respect the documented response shape
CoinAnk success is "code": "1" as a string, not a number.
- Handle failures clearly
If the request or payment flow fails, explain the issue in user-friendly language and preserve the technical cause for troubleshooting.
API Key Mode
Users with CoinAnk membership can configure direct access:
export COINANK_API_KEY="your_api_key"Use direct mode whenever a valid API key is available, unless the user explicitly asks to use Agent Payments Protocol or x402 pay-per-call payment instead.
Timestamp Rules
endTime must be a current millisecond timestamp
# Correct
NOW=$(python3 -c "import time; print(int(time.time()*1000))")
# Wrong on macOS: %3N is not supported
NOW=$(date +%s%3N)If an endpoint requires endTime, use a current millisecond timestamp unless the user explicitly specifies another valid time range.
Parameter Rules
Do not send unsupported parameters
Some endpoints do not accept endTime or size. For example, liquidation heatmap endpoints such as getLiqHeatMap can return empty data when unsupported parameters are included. Follow the selected schema exactly.
exchanges is required for aggregate endpoints
For aggregate market-order endpoints such as getAggCvd, getAggBuySellCount, getAggBuySellValue, and getAggBuySellVolume, the exchanges parameter must be present. Use exchanges= to aggregate across all exchanges.
interval values vary by endpoint
Supported interval values differ by API family. Always confirm the allowed values in the selected schema's parameter descriptions.
| Endpoint Type | Supported interval Values |
|---|---|
| K-line / market-order stats / long-short ratio / open interest | 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d |
Liquidation heatmap (getLiqHeatMap) | 12h, 1d, 3d, 1w, 2w, 1M, 3M, 6M, 1Y |
| RSI screener | 1H, 4H, 1D |
| Funding-rate heatmap | 1D, 1W, 1M, 6M |
Response Handling
Successful CoinAnk responses use "code": "1". Some endpoints return nested payloads inside data, for example:
{"success": true, "code": "1", "data": {"success": true, "code": "1", "data": [...]}}Inspect the actual response shape and unwrap nested data fields when necessary.
Notes on Agent Payments Protocol / x402 Availability
CoinAnk supports Agent Payments Protocol or x402 pay-per-call access. In practice, the skill must still rely on the server's real HTTP behavior for each request. If a request does not return an HTTP 402 challenge, the skill must not fabricate a payment flow.
Notes on OpenAPI Examples
Values shown in references/*.json, especially timestamps in example fields, are historical examples only. Replace them with live values when building requests.
Error Handling
| Error | Cause | Resolution |
|---|---|---|
HTTP 401 | Missing, invalid, or rejected apikey, or payment data rejected by the gateway/upstream service | Check whether API-key mode or pay-per-call mode is intended. Do not retry with fabricated credentials. If using pay-per-call, request a fresh challenge and replay the same request with the generated payment data. |
HTTP 402 Payment Required | CoinAnk requires Agent Payments Protocol / x402 payment for this request | Delegate payment handling to okx-agent-payments-protocol. Confirm non-zero amounts with the user, support zero-amount challenges exactly as returned, and replay the original request after payment proof or charge completion. |
| Missing or unsupported endpoint parameters | Required query parameters are absent, stale, or not accepted by the selected CoinAnk endpoint | Read the relevant OpenAPI reference file, ask the user for missing values, and follow timestamp and symbol formatting rules. |
| Payment-skill unavailable | The required OKX payment helper is not installed or not accessible | Explain that pay-per-call mode requires okx-agent-payments-protocol; ask the user to install or enable it, or use API-key mode if available. |
| Rate limit, timeout, or upstream unavailable | CoinAnk or a CDN/cache layer temporarily rejected or failed the request | Report the failure clearly, avoid duplicate paid replays without user confirmation, and retry only when safe. |
Security Notices
- This plugin is for market-data retrieval and payment orchestration only; it does not execute trades or move assets by itself.
- Never request, print, persist, or expose private keys, seed phrases, API keys, payment proofs, authorization headers, or wallet-session credentials.
- Use
COINANK_API_KEYonly from the user's configured environment or secret store, and send it only as the CoinAnkapikeyheader. - Delegate Agent Payments Protocol / x402 proof generation, OKX wallet signing, and
chargehandling tookx-agent-payments-protocol; do not bypass its confirmation flow. - Confirm every non-zero payment amount with the user before execution. Do not charge speculatively.
- Treat zero-amount payment challenges as valid, but never coerce zero to a non-zero fallback amount.
{
"schema_version": 1,
"name": "coinank-openapi",
"version": "1.0.0",
"description": "Access CoinAnk crypto derivatives market data via API key or Agent Payments Protocol/x402 pay-per-call.",
"author": {
"name": "CoinAnk",
"github": "coinank"
},
"license": "MIT",
"category": "analytics",
"api_calls": [
"open-api.coinank.com",
"s.cdnblock.com"
]
}
MIT License
Copyright (c) 2026 CoinAnk
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
schema_version: 1
name: coinank-openapi
version: 1.0.0
description: Access CoinAnk crypto derivatives market data via API key or Agent Payments Protocol/x402 pay-per-call.
author:
name: CoinAnk
github: coinank
license: MIT
category: dapp
components:
skill:
dir: "."
api_calls:
- open-api.coinank.com
- s.cdnblock.com
<div align="center">
CoinAnk OpenAPI Skill
> Crypto derivatives data engine for AI agents_
<br />
   
<br />
简体中文 · English
<br />
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" alt="-----" />
</div>
<div align="center">
What is CoinAnk OpenAPI Skill?
One sentence to query data. 18 categories of derivatives indicators at your fingertips.
</div>
<div align="center">
CoinAnk OpenAPI Skill is an OKX Plugin Store plugin that provides LLMs with comprehensive crypto derivatives market data capabilities. It covers K-lines, ETF, open interest, long/short ratios, funding rates, liquidations, order flow, whale movements and more — 18 categories, 59 real-time data endpoints, all battle-tested and verified, with support for both direct CoinAnk API-key access and Agent Payments Protocol or x402 pay-per-call access.
</div>
<div align="center">
<table> <tr><td>
- All 59 endpoints tested and verified
- All requests are GET — simple and efficient
- Supports direct API-key access and Agent Payments Protocol or x402 pay-per-call access
</td></tr> </table>
<br /> <img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" alt="-----" />
Data Coverage
</div>
<div align="center"> <table> <tr> <td width="50%">
Market & Price
| Category | Endpoints | API Level |
|---|---|---|
| K-Lines | 1 | API1 |
| ETF | 5 | API1 |
| Coins & Pairs | 4 | API1 |
| Indicators | 10 | API1 |
| News & Flash | 2 | API2 |
</td> <td width="50%">
Derivatives Depth
| Category | Endpoints | API Level |
|---|---|---|
| Open Interest | 7 | API1 |
| Funding Rates | 7 | API1 |
| Long/Short Ratio | 6 | API1 |
| Liquidation | 8 | API1 |
| RSI Screener | 1 | API2 |
</td> </tr> <tr> <td width="50%">
Institutional-Grade
| Category | Endpoints | API Level |
|---|---|---|
| Large Orders | 2 | API3 |
| Market Order Stats | 8 | API3 |
| Order Book | 3 | API3 |
| Fund Flow | 2 | API3 |
| Order Flow | 1 | API3 |
| Net Long/Short | 1 | API3 |
</td> <td width="50%">
On-Chain & Whales
| Category | Endpoints | API Level |
|---|---|---|
| HyperLiquid Whales | 2 | API2 |
| Trending Rankings | 8 | API2 |
</td> </tr> </table> </div>
<div align="center">
Total: 18 categories · 59 endpoints
<br /> <img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" alt="-----" />
Quick Start
</div>
For first-time users, the access choice should be explicit:
- If you have CoinAnk API membership, provide
COINANK_API_KEY - If you do not have CoinAnk API membership, you can still use Agent Payments Protocol or x402 for one-off paid calls when CoinAnk returns a payment challenge
# 1. Install or update the OKX Plugin Store package
git clone https://github.com/okx/plugin-store.gitMode 1: Direct CoinAnk API-key Access
export COINANK_API_KEY="your_api_key_here"Mode 2: Agent Payments Protocol or x402 Pay-per-call Access
If you do not have a CoinAnk API membership, you can still pay for a single request through Agent Payments Protocol or x402 via OKX Onchain OS:
Use the latest okx-agent-payments-protocol skill. The newer OKX payment skill supports both Agent Payments Protocol / x402 proof-based payment and the new charge payment method; follow the payment method returned or required by the OKX skill.
# Install OKX Onchain OS skills
npx skills add okx/onchainos-skills
# Log in to the wallet for Agent Payments Protocol / x402 signing
onchainos wallet loginBuyer-side integration reference: https://web3.okx.com/zh-hans/onchainos/dev-docs/payments/payment-use-buyer-ai
<div align="center">
Then query directly with natural language in an agent that supports the OKX Plugin Store:
</div>
> "Check the current BTC funding rate"
> "Show me the liquidation data for the past 24 hours"
> "Get the ETH long/short ratio"<div align="center"> <br /> <img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" alt="-----" />
Authentication & Request Spec
</div>
| Item | Description |
|---|---|
| Base URL | https://open-api.coinank.com |
| Auth | Direct mode: apikey: <your_api_key>; Agent Payments Protocol / x402 mode: payment header generated by the payment flow |
| Method | All GET |
| Response | application/json |
| Success | {"success": true, "code": "1", "data": ...} |
Access Modes
| Mode | Use Case | Requirement |
|---|---|---|
| Direct API-key access | You already have CoinAnk API membership | Set COINANK_API_KEY |
| Agent Payments Protocol or x402 pay-per-call | You do not have CoinAnk API membership but want to pay for a single call | Install okx/onchainos-skills |
Standard Response
{
"success": true,
"code": "1",
"data": [ ... ]
}Error Codes
| code | Meaning |
|---|---|
1 | Success |
-3 | Invalid API key or auth failure |
-7 | Time range exceeded (bad endTime) |
0 | System error (missing params or server error) |
Agent Payments Protocol / x402 Response Behavior
When CoinAnk returns HTTP 402 Payment Required for a request, the agent must complete payment first, then replay the same request instead of treating the 402 as the final business response.
Example Request Notes
The endpoint examples below default to direct API-key mode. In Agent Payments Protocol / x402 mode, the URL and request parameters stay the same; the agent simply replays the same request with the required payment header after payment succeeds.
<div align="center"> <br /> <img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" alt="-----" />
Important Notes
</div>
1. Timestamps Must Be Milliseconds & Current
All endTime parameters require millisecond timestamps close to the current time. Expired or malformed timestamps return code: -7.
# Correct: use python3 (cross-platform)
NOW=$(python3 -c "import time; print(int(time.time()*1000))")
# Wrong: macOS date doesn't support %3N, produces invalid values like "17228693N"
NOW=$(date +%s%3N) # Don't use this!2. API Level System
Endpoints are divided into API1–API4 levels. Higher levels unlock more endpoints. Each endpoint indicates its minimum required API level.
3. exchanges Parameter Must Be Passed
For aggregate market order endpoints (getAggCvd, getAggBuySellCount, etc.), the exchanges parameter is required (pass an empty string exchanges= to aggregate all exchanges).
4. Example Timestamps Are Historical
Timestamps in the references/ directory JSON files are historical examples only. Always use real-time generated timestamps when making calls.
5. Agent Payments Protocol / x402 starts when CoinAnk returns HTTP 402
CoinAnk supports Agent Payments Protocol or x402 pay-per-call access. The skill still starts the payment flow only when the server actually returns an HTTP 402 Payment Required challenge for the exact request.
If there is no COINANK_API_KEY and the route returns only a business error such as code: "-3" without an HTTP 402, then that route is still membership-only and has not been exposed through Agent Payments Protocol or x402.
6. Recommended Agent Payments Protocol / x402 Flow
For a payment-gated request, the recommended Agent Payments Protocol / x402 flow is:
1. Send the original request first, without pre-login and without speculative payment. 2. If the server returns HTTP 402 Payment Required, decode the payment challenge. 3. Show the user the payment network, token, amount, and recipient; if the amount is greater than 0, wait for user confirmation. 4. Use the latest okx-agent-payments-protocol skill to handle payment. It supports both Agent Payments Protocol / x402 payment proofs and the newer charge payment method. 5. If the OKX payment skill returns or requires the charge method, use the charge flow instead of forcing the older x402-only proof flow. 6. Replay the exact same request with only the required payment header or authorization data for the selected payment method added.
If the payment challenge amount is 0, it is still a valid Agent Payments Protocol / x402 challenge. The agent must not treat a zero amount as an error or unsupported case, and must not fall back, round up, or coerce 0 to a minimum non-zero amount such as 0.000001 USDC/USDT; it should tell the user that the request requires a payment proof or authorization but will not charge funds, then continue through the OKX payment skill to generate the proof, authorization, or charge request with the original 0 amount and replay the request.
Agent Payments Protocol / x402 is therefore best suited for one-off queries, ad hoc lookups, and low-frequency access. It is not a good default for wide fan-out workflows when the user has no API key.
7. Agent Payments Protocol / x402 Signing Scheme Constraint
The signing scheme must match the signer type:
- If you sign with an EOA private key, you must use the `exact` scheme
- If you sign with an OKX contract wallet / OKX wallet session, you must use the `aggr_deferred` scheme
Do not mix these two paths, or the payment flow and signing semantics will be inconsistent.
<div align="center"> <br /> <img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" alt="-----" />
API Details
</div>
---
<details> <summary><strong>1. K-Lines</strong> — 1 endpoint · API1</summary>
<br />
GET /api/kline/lists — K-Line Market Data
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
symbol | Yes | string | Trading pair | BTCUSDT |
exchange | Yes | string | Exchange | Binance |
endTime | Yes | number | Millisecond timestamp | current timestamp |
size | Yes | integer | Count, max 500 | 10 |
interval | Yes | string | Period, see enums | 1h |
productType | Yes | string | SWAP futures / SPOT spot | SWAP |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/kline/lists?symbol=BTCUSDT&exchange=Binance&endTime=$NOW&size=10&interval=1h&productType=SWAP"</details>
---
<details> <summary><strong>2. ETF</strong> — 5 endpoints · API1</summary>
<br />
GET /api/etf/getUsBtcEtf — US BTC ETF List
No parameters required
GET /api/etf/getUsEthEtf — US ETH ETF List
No parameters required
GET /api/etf/usBtcInflow — US BTC ETF Historical Net Inflow
No parameters required
GET /api/etf/usEthInflow — US ETH ETF Historical Net Inflow
No parameters required
GET /api/etf/hkEtfInflow — HK ETF Historical Net Inflow
No parameters required
curl -H "apikey: $APIKEY" "https://open-api.coinank.com/api/etf/getUsBtcEtf"
curl -H "apikey: $APIKEY" "https://open-api.coinank.com/api/etf/getUsEthEtf"
curl -H "apikey: $APIKEY" "https://open-api.coinank.com/api/etf/usBtcInflow"
curl -H "apikey: $APIKEY" "https://open-api.coinank.com/api/etf/usEthInflow"
curl -H "apikey: $APIKEY" "https://open-api.coinank.com/api/etf/hkEtfInflow"</details>
---
<details> <summary><strong>3. HyperLiquid Whales</strong> — 2 endpoints · API2</summary>
<br />
GET /api/hyper/topPosition — Whale Position Rankings
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
sortBy | Yes | string | Sort field | positionValue |
sortType | Yes | string | desc / asc | desc |
page | Yes | integer | Page number | 1 |
size | Yes | integer | Page size | 10 |
GET /api/hyper/topAction — Latest Whale Activity
No parameters required
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/hyper/topPosition?sortBy=positionValue&sortType=desc&page=1&size=10"
curl -H "apikey: $APIKEY" "https://open-api.coinank.com/api/hyper/topAction"</details>
---
<details> <summary><strong>4. Net Long & Short</strong> — 1 endpoint · API3</summary>
<br />
GET /api/netPositions/getNetPositions — Net Long/Short History
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
exchange | Yes | string | Exchange | Binance |
symbol | Yes | string | Trading pair | BTCUSDT |
interval | Yes | string | Period | 1h |
endTime | Yes | number | Millisecond timestamp | current timestamp |
size | Yes | integer | Count, max 500 | 10 |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/netPositions/getNetPositions?exchange=Binance&symbol=BTCUSDT&interval=1h&endTime=$NOW&size=10"</details>
---
<details> <summary><strong>5. Large Orders</strong> — 2 endpoints · API3</summary>
<br />
GET /api/trades/largeTrades — Large Market Orders
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
symbol | Yes | string | Trading pair | BTCUSDT |
productType | Yes | string | SWAP / SPOT | SWAP |
amount | Yes | string | Min amount (USD) | 10000000 |
endTime | Yes | string | Millisecond timestamp | current timestamp |
size | Yes | string | Count, max 500 | 10 |
GET /api/bigOrder/queryOrderList — Large Limit Orders
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
symbol | Yes | string | Trading pair | BTCUSDT |
exchangeType | Yes | string | SWAP / SPOT / FUTURES | SWAP |
size | Yes | integer | Count, max 500 | 10 |
amount | Yes | number | Min amount (USD) | 1000000 |
side | Yes | string | ask sell / bid buy | ask |
exchange | Yes | string | Exchange (Binance / OKX / Coinbase) | Binance |
isHistory | Yes | string | true historical / false real-time | true |
startTime | No | number | End timestamp (recommended for isHistory=true) | current timestamp |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/trades/largeTrades?symbol=BTCUSDT&productType=SWAP&amount=10000000&endTime=$NOW&size=10"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/bigOrder/queryOrderList?symbol=BTCUSDT&exchangeType=SWAP&size=10&amount=1000000&side=ask&exchange=Binance&isHistory=true&startTime=$NOW"</details>
---
<details> <summary><strong>6. Coins & Trading Pairs</strong> — 4 endpoints · API1</summary>
<br />
GET /api/instruments/getLastPrice — Real-Time Price
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
symbol | Yes | string | Trading pair | BTCUSDT |
exchange | Yes | string | Exchange | Binance |
productType | Yes | string | SWAP / SPOT | SWAP |
GET /api/instruments/getCoinMarketCap — Coin Market Cap Info
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
baseCoin | Yes | string | Coin | BTC |
GET /api/baseCoin/list — Supported Coins List
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
productType | Yes | string | SWAP / SPOT | SWAP |
GET /api/baseCoin/symbols — Supported Trading Pairs
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
exchange | Yes | string | Exchange | Binance |
productType | Yes | string | SWAP / SPOT | SWAP |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/instruments/getLastPrice?symbol=BTCUSDT&exchange=Binance&productType=SWAP"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/instruments/getCoinMarketCap?baseCoin=BTC"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/baseCoin/list?productType=SWAP"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/baseCoin/symbols?exchange=Binance&productType=SWAP"</details>
---
<details> <summary><strong>7. Long/Short Ratio</strong> — 6 endpoints · API1</summary>
<br />
GET /api/longshort/buySell — Global Long/Short Buy/Sell Ratio
API Level: API3
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
baseCoin | Yes | string | Coin | BTC |
interval | Yes | string | Period | 1h |
endTime | Yes | string | Millisecond timestamp | current timestamp |
size | Yes | string | Count | 10 |
GET /api/longshort/realtimeAll — Exchange Real-Time Long/Short Ratio
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
baseCoin | Yes | string | Coin | BTC |
interval | Yes | string | 5m/15m/30m/1h/2h/4h/6h/8h/12h/1d | 1h |
GET /api/longshort/person — Long/Short Account Ratio
Supported: Binance / OKX / Bybit
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
exchange | Yes | string | Exchange | Binance |
symbol | Yes | string | Trading pair | BTCUSDT |
interval | Yes | string | Period | 1h |
endTime | Yes | string | Millisecond timestamp | current timestamp |
size | Yes | string | Count, max 500 | 10 |
GET /api/longshort/position — Top Trader Long/Short (Position)
Supported: Binance / OKX / Huobi — Same params as person.
GET /api/longshort/account — Top Trader Long/Short (Account)
Supported: Binance / OKX / Huobi — Same params as person.
GET /api/longshort/kline — Long/Short Ratio K-Line
Supported: Binance / OKX / Huobi
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
exchange | Yes | string | Exchange | Binance |
symbol | Yes | string | Trading pair | BTCUSDT |
interval | Yes | string | Period | 1h |
endTime | Yes | string | Millisecond timestamp | current timestamp |
size | Yes | string | Count, max 500 | 10 |
type | Yes | string | longShortPerson / longShortPosition / longShortAccount | longShortPerson |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/longshort/realtimeAll?baseCoin=BTC&interval=1h"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/longshort/person?exchange=Binance&symbol=BTCUSDT&interval=1h&endTime=$NOW&size=10"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/longshort/kline?exchange=Binance&symbol=BTCUSDT&interval=1h&endTime=$NOW&size=10&type=longShortPerson"</details>
---
<details> <summary><strong>8. Market Order Stats</strong> — 8 endpoints · API3</summary>
<br />
Split into per-symbol and aggregated (cross-exchange) groups.
Per-Symbol Series (requires exchange + symbol)
| Endpoint | Description |
|---|---|
GET /api/marketOrder/getCvd | CVD (Cumulative Volume Delta) |
GET /api/marketOrder/getBuySellCount | Taker buy/sell count |
GET /api/marketOrder/getBuySellValue | Taker buy/sell value (USD) |
GET /api/marketOrder/getBuySellVolume | Taker buy/sell volume (coin) |
Common Parameters:
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
exchange | Yes | string | Exchange (Binance / OKX / Bybit / Bitget) | Binance |
symbol | Yes | string | Trading pair | BTCUSDT |
interval | Yes | string | Period | 1h |
endTime | Yes | string | Millisecond timestamp | current timestamp |
size | Yes | integer | Count, max 500 | 10 |
productType | Yes | string | SWAP / SPOT | SWAP |
Aggregated Series (by baseCoin across exchanges)
| Endpoint | Description |
|---|---|
GET /api/marketOrder/getAggCvd | Aggregated CVD |
GET /api/marketOrder/getAggBuySellCount | Aggregated buy/sell count |
GET /api/marketOrder/getAggBuySellValue | Aggregated buy/sell value |
GET /api/marketOrder/getAggBuySellVolume | Aggregated buy/sell volume |
Common Parameters:
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
baseCoin | Yes | string | Coin | BTC |
interval | Yes | string | Period | 1h |
endTime | Yes | string | Millisecond timestamp | current timestamp |
size | Yes | integer | Count, max 500 | 10 |
productType | Yes | string | SWAP / SPOT | SWAP |
exchanges | Yes | string | Pass empty string to aggregate all | (empty) |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/marketOrder/getCvd?exchange=Binance&symbol=BTCUSDT&interval=1h&endTime=$NOW&size=10&productType=SWAP"
# Note: exchanges param is required, pass empty string to aggregate all
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/marketOrder/getAggCvd?baseCoin=BTC&interval=1h&endTime=$NOW&size=10&productType=SWAP&exchanges="</details>
---
<details> <summary><strong>9. News & Flash</strong> — 2 endpoints · API2</summary>
<br />
GET /api/news/getNewsList — News/Flash List
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
type | Yes | string | 1 flash / 2 news | 1 |
lang | Yes | string | zh Chinese / en English | en |
page | Yes | string | Page number | 1 |
pageSize | Yes | string | Page size | 10 |
isPopular | Yes | string | Featured: true / false | false |
search | Yes | string | Search keyword, empty string for none | (empty) |
GET /api/news/getNewsDetail — News Detail
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
id | Yes | string | News ID (from list endpoint) | 69a2f40912d08f6a781aedd0 |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/news/getNewsList?type=1&lang=en&page=1&pageSize=10&isPopular=false&search="
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/news/getNewsDetail?id=69a2f40912d08f6a781aedd0"</details>
---
<details> <summary><strong>10. Indicators</strong> — 10 endpoints · API1</summary>
<br />
The following indicators require no parameters.
| Endpoint | Description |
|---|---|
GET /api/indicator/getBtcMultiplier | 2-Year MA Multiplier |
GET /api/indicator/getCnnEntity | Fear & Greed Index |
GET /api/indicator/getAhr999 | AHR999 Accumulation Index |
GET /api/indicator/getPuellMultiple | Puell Multiple |
GET /api/indicator/getBtcPi | Pi Cycle Top Indicator |
GET /api/indicator/getMovingAvgHeatmap | 200-Week MA Heatmap |
GET /api/indicator/getAltcoinSeason | Altcoin Season Index |
GET /api/indicator/getMarketCapRank — Market Cap Dominance Ranking
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
symbol | Yes | string | Coin | BTC |
GET /api/indicator/getGrayscaleOpenInterest — Grayscale Holdings
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
symbol | Yes | string | Coin | BTC |
GET /api/indicator/index/charts — Rainbow Chart & Composite Indicators
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
type | Yes | string | Chart type | bitcoin-rainbow-v2 |
curl -H "apikey: $APIKEY" "https://open-api.coinank.com/api/indicator/getCnnEntity"
curl -H "apikey: $APIKEY" "https://open-api.coinank.com/api/indicator/getMarketCapRank?symbol=BTC"
curl -H "apikey: $APIKEY" "https://open-api.coinank.com/api/indicator/index/charts?type=bitcoin-rainbow-v2"</details>
---
<details> <summary><strong>11. Open Interest</strong> — 7 endpoints · API1</summary>
<br />
GET /api/openInterest/all — Real-Time OI (All Exchanges)
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
baseCoin | Yes | string | Coin | BTC |
GET /api/openInterest/v2/chart — Aggregated OI History
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
baseCoin | Yes | string | Coin | BTC |
exchange | Yes | string | Exchange, empty string for all | (empty) |
interval | Yes | string | Period | 1h |
size | Yes | string | Count, max 500 | 10 |
type | Yes | string | USD or coin name (e.g. BTC) | USD |
endTime | Yes | number | Millisecond timestamp | current timestamp |
GET /api/openInterest/symbol/Chart — Symbol OI History
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
exchange | Yes | string | Exchange | Binance |
symbol | Yes | string | Trading pair | BTCUSDT |
interval | Yes | string | Period | 1h |
endTime | Yes | number | Millisecond timestamp | current timestamp |
size | Yes | string | Count, max 500 | 10 |
type | Yes | string | USD / coin name | USD |
GET /api/openInterest/kline — Symbol OI K-Line
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
exchange | Yes | string | Exchange | Binance |
symbol | Yes | string | Trading pair | BTCUSDT |
interval | Yes | string | Period | 1h |
endTime | Yes | number | Millisecond timestamp | current timestamp |
size | Yes | integer | Count | 10 |
GET /api/openInterest/aggKline — Aggregated OI K-Line
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
baseCoin | Yes | string | Coin | BTC |
interval | Yes | string | Period | 1h |
endTime | Yes | number | Millisecond timestamp | current timestamp |
size | Yes | integer | Count | 10 |
GET /api/tickers/topOIByEx — Real-Time OI by Exchange
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
baseCoin | Yes | string | Coin | BTC |
GET /api/instruments/oiVsMc — Historical OI/Market Cap Ratio
API Level: API2
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
baseCoin | Yes | string | Coin | BTC |
endTime | Yes | string | Millisecond timestamp | current timestamp |
size | Yes | string | Count, max 500 | 100 |
interval | Yes | string | Period | 1h |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/openInterest/all?baseCoin=BTC"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/openInterest/aggKline?baseCoin=BTC&interval=1h&endTime=$NOW&size=10"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/instruments/oiVsMc?baseCoin=BTC&endTime=$NOW&size=100&interval=1h"</details>
---
<details> <summary><strong>12. Trending Rankings</strong> — 8 endpoints · API2</summary>
<br />
GET /api/instruments/visualScreener — Visual Screener
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
interval | Yes | string | 15m / 1h / 4h / 24h | 15m |
GET /api/instruments/oiVsMarketCap — OI/Market Cap Ranking
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
page | Yes | integer | Page number | 1 |
size | Yes | integer | Page size | 10 |
sortBy | Yes | string | Sort field | openInterest |
sortType | Yes | string | desc / asc | desc |
GET /api/instruments/longShortRank — Long/Short Ratio Ranking
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
sortBy | Yes | string | Sort field | longRatio |
sortType | Yes | string | desc / asc | desc |
size | Yes | integer | Page size | 10 |
page | Yes | integer | Page number | 1 |
GET /api/instruments/oiRank — Open Interest Ranking
Same params as longShortRank, sortBy example: openInterest.
GET /api/trades/count — Trade Count Ranking
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
productType | Yes | string | SWAP / SPOT | SWAP |
sortBy | Yes | string | e.g. h1Count (1h), d1Count (1d) | h1Count |
sortType | Yes | string | desc / asc | desc |
GET /api/instruments/liquidationRank — Liquidation Ranking
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
sortBy | Yes | string | e.g. liquidationH24 | liquidationH24 |
sortType | Yes | string | desc / asc | desc |
page | Yes | integer | Page number | 1 |
size | Yes | integer | Page size | 10 |
GET /api/instruments/priceRank — Price Change Ranking
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
sortBy | Yes | string | e.g. priceChangeH24 | priceChangeH24 |
sortType | Yes | string | desc / asc | desc |
GET /api/instruments/volumeRank — Volume Change Ranking
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
sortBy | Yes | string | e.g. h24Volume | h24Volume |
sortType | Yes | string | desc / asc | desc |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/instruments/visualScreener?interval=15m"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/trades/count?productType=SWAP&sortBy=h1Count&sortType=desc"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/instruments/priceRank?sortBy=priceChangeH24&sortType=desc"</details>
---
<details> <summary><strong>13. Liquidation</strong> — 8 endpoints · API1</summary>
<br />
GET /api/liquidation/allExchange/intervals — Real-Time Liquidation Stats
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
baseCoin | Yes | string | Coin | BTC |
GET /api/liquidation/aggregated-history — Aggregated Liquidation History
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
baseCoin | Yes | string | Coin | BTC |
interval | Yes | string | Period | 1h |
endTime | Yes | number | Millisecond timestamp | current timestamp |
size | Yes | integer | Count | 10 |
GET /api/liquidation/history — Symbol Liquidation History
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
exchange | Yes | string | Exchange | Binance |
symbol | Yes | string | Trading pair | BTCUSDT |
interval | Yes | string | Period | 1h |
endTime | Yes | number | Millisecond timestamp | current timestamp |
size | Yes | integer | Count | 10 |
GET /api/liquidation/orders — Liquidation Orders
API Level: API3
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
baseCoin | Yes | string | Coin | BTC |
exchange | Yes | string | Exchange | Binance |
side | Yes | string | long / short | long |
amount | Yes | number | Min liquidation amount (USD) | 100 |
endTime | Yes | number | Millisecond timestamp | current timestamp |
GET /api/liqMap/getLiqMap — Liquidation Map
API Level: API4
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
symbol | Yes | string | Trading pair | BTCUSDT |
exchange | Yes | string | Exchange | Binance |
interval | Yes | string | Period | 1d |
GET /api/liqMap/getAggLiqMap — Aggregated Liquidation Map
API Level: API4
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
baseCoin | Yes | string | Coin | BTC |
interval | Yes | string | Period | 1d |
GET /api/liqMap/getLiqHeatMap — Liquidation Heatmap
API Level: API4
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
exchange | Yes | string | Exchange | Binance |
symbol | Yes | string | Trading pair | BTCUSDT |
interval | Yes | string | Period | 1d |
GET /api/liqMap/getLiqHeatMapSymbol — Supported Heatmap Symbols
API Level: API1 | No parameters required
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/liquidation/allExchange/intervals?baseCoin=BTC"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/liquidation/orders?baseCoin=BTC&exchange=Binance&side=long&amount=100&endTime=$NOW"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/liqMap/getLiqHeatMapSymbol"</details>
---
<details> <summary><strong>14. Order Book</strong> — 3 endpoints · API3</summary>
<br />
GET /api/orderBook/v2/bySymbol — Order Book Depth History (by Symbol)
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
symbol | Yes | string | Trading pair | BTCUSDT |
exchange | Yes | string | Exchange | Binance |
rate | Yes | number | Price precision ratio | 0.01 |
productType | Yes | string | SWAP / SPOT | SWAP |
interval | Yes | string | Period | 1h |
endTime | Yes | number | Millisecond timestamp | current timestamp |
size | Yes | integer | Count, max 500 | 10 |
GET /api/orderBook/v2/byExchange — Order Book Depth History (by Exchange)
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
baseCoin | Yes | string | Coin | BTC |
productType | Yes | string | SWAP / SPOT | SWAP |
interval | Yes | string | Period | 1h |
endTime | Yes | number | Millisecond timestamp | current timestamp |
size | Yes | integer | Count, max 500 | 10 |
exchanges | Yes | string | Exchange name | Binance |
type | Yes | string | Price precision ratio | 0.01 |
GET /api/orderBook/getHeatMap — Order Book Liquidity Heatmap
API Level: API4
The endTime parameter is validated by the CDN cache layer and must be a current millisecond timestamp.| Param | Required | Type | Description | Example |
|---|---|---|---|---|
exchange | Yes | string | Exchange (currently Binance only) | Binance |
symbol | Yes | string | Trading pair | BTCUSDT |
interval | Yes | string | 1m / 3m / 5m | 1m |
endTime | Yes | string | Millisecond timestamp (must be current, expired times return 401) | current timestamp |
size | Yes | string | Count, max 500 | 10 |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/orderBook/v2/bySymbol?symbol=BTCUSDT&exchange=Binance&rate=0.01&productType=SWAP&interval=1h&endTime=$NOW&size=10"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/orderBook/getHeatMap?exchange=Binance&symbol=BTCUSDT&interval=1m&endTime=$NOW&size=10"</details>
---
<details> <summary><strong>15. Fund Flow</strong> — 2 endpoints · API3</summary>
<br />
GET /api/fund/fundReal — Real-Time Fund Flow
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
productType | Yes | string | SWAP / SPOT | SWAP |
page | Yes | integer | Page number | 1 |
size | Yes | integer | Page size | 10 |
sortBy | Yes | string | Sort field, e.g. h1net (1h net inflow) | h1net |
sortType | Yes | string | desc / asc | desc |
baseCoin | Yes | string | Coin (empty string for all) | BTC |
GET /api/fund/getFundHisList — Historical Fund Flow
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
baseCoin | Yes | string | Coin | BTC |
endTime | Yes | number | Millisecond timestamp | current timestamp |
productType | Yes | string | SWAP / SPOT | SWAP |
size | Yes | integer | Count | 10 |
interval | Yes | string | Period | 1h |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/fund/fundReal?productType=SWAP&page=1&size=10&sortBy=h1net&sortType=desc&baseCoin=BTC"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/fund/getFundHisList?baseCoin=BTC&endTime=$NOW&productType=SWAP&size=10&interval=1h"</details>
---
<details> <summary><strong>16. Order Flow</strong> — 1 endpoint · API3</summary>
<br />
GET /api/orderFlow/lists — Order Flow Data
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
exchange | Yes | string | Exchange | Binance |
symbol | Yes | string | Trading pair | BTCUSDT |
interval | Yes | string | Period | 1h |
endTime | Yes | number | Millisecond timestamp | current timestamp |
size | Yes | integer | Count | 10 |
productType | Yes | string | SWAP / SPOT | SWAP |
tickCount | Yes | integer | Tick count | 1 |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/orderFlow/lists?exchange=Binance&symbol=BTCUSDT&interval=1h&endTime=$NOW&size=10&productType=SWAP&tickCount=1"</details>
---
<details> <summary><strong>17. Funding Rates</strong> — 7 endpoints · API1</summary>
<br />
GET /api/fundingRate/hist — Historical Funding Rates (Cross-Exchange)
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
baseCoin | Yes | string | Coin | BTC |
exchangeType | Yes | string | Quote type: USDT / USD (coin-margined) | USDT |
endTime | Yes | number | Millisecond timestamp | current timestamp |
size | Yes | integer | Count | 10 |
GET /api/fundingRate/current — Real-Time Funding Rate Ranking
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
type | Yes | string | current / day / week / month / year | current |
GET /api/fundingRate/accumulated — Accumulated Funding Rate
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
type | Yes | string | day / week / month / year | day |
GET /api/fundingRate/indicator — Symbol Funding Rate History
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
exchange | Yes | string | Exchange (Binance / OKX / Bybit / Huobi / Gate / Bitget) | Binance |
symbol | Yes | string | Trading pair | BTCUSDT |
interval | Yes | string | Period | 1h |
endTime | Yes | string | Millisecond timestamp | current timestamp |
size | Yes | string | Count, max 500 | 10 |
GET /api/fundingRate/kline — Funding Rate K-Line
Same params as fundingRate/indicator.
GET /api/fundingRate/getWeiFr — Weighted Funding Rate
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
baseCoin | Yes | string | Coin | BTC |
interval | Yes | string | Period | 1h |
endTime | Yes | string | Millisecond timestamp | current timestamp |
size | Yes | string | Count, max 500 | 10 |
GET /api/fundingRate/frHeatmap — Funding Rate Heatmap
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
type | Yes | string | openInterest by OI / marketCap by market cap | marketCap |
interval | Yes | string | 1D / 1W / 1M / 6M | 1M |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/fundingRate/current?type=current"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/fundingRate/accumulated?type=day"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/fundingRate/frHeatmap?type=marketCap&interval=1M"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/fundingRate/getWeiFr?baseCoin=BTC&interval=1h&endTime=$NOW&size=10"</details>
---
<details> <summary><strong>18. RSI Screener</strong> — 1 endpoint · API2</summary>
<br />
GET /api/rsiMap/list — RSI Indicator Screener
| Param | Required | Type | Description | Example |
|---|---|---|---|---|
interval | Yes | string | Period (note uppercase): 1H / 4H / 1D | 1H |
exchange | Yes | string | Exchange | Binance |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/rsiMap/list?interval=1H&exchange=Binance"</details>
<div align="center"> <br /> <img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" alt="-----" />
Enum Reference
</div>
<details> <summary><strong>interval (K-Line / Historical Data Periods)</strong></summary>
<br />
| Value | Description |
|---|---|
1m | 1 minute |
3m | 3 minutes |
5m | 5 minutes |
15m | 15 minutes |
30m | 30 minutes |
1h | 1 hour |
2h | 2 hours |
4h | 4 hours |
6h | 6 hours |
8h | 8 hours |
12h | 12 hours |
1d | 1 day |
RSI Screener uses uppercase:1H,4H,1D
Funding Rate Heatmap uses:1D,1W,1M,6M
</details>
<details> <summary><strong>exchange (Major Exchanges)</strong></summary>
<br />
| Value | Exchange |
|---|---|
Binance | Binance |
OKX | OKX |
Bybit | Bybit |
Bitget | Bitget |
Gate | Gate.io |
Huobi | HTX (Huobi) |
Bitmex | BitMEX |
dYdX | dYdX |
Bitfinex | Bitfinex |
CME | CME Group |
Kraken | Kraken |
Deribit | Deribit |
</details>
<details> <summary><strong>productType (Product Types)</strong></summary>
<br />
| Value | Description |
|---|---|
SWAP | Perpetual Futures |
SPOT | Spot |
FUTURES | Delivery Futures |
</details>
<details> <summary><strong>sortBy Common Fields</strong></summary>
<br />
| Endpoint Type | Common sortBy Values |
|---|---|
| OI Ranking | openInterest |
| Liquidation Ranking | liquidationH24, liquidationH12, liquidationH8, liquidationH4, liquidationH1 |
| Price Ranking | priceChangeH24, priceChangeH1, priceChangeM5 |
| Volume Ranking | h24Volume, h1Volume |
| Trade Count Ranking | h1Count, d1Count, h4Count |
| Fund Flow | h1net, h4net, h8net, h24net |
| Whale Positions | positionValue, unrealizedPnl |
</details>
<div align="center"> <br /> <img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" alt="-----" />
<br />
License
MIT License — CoinAnk
<br />
Built for AI-powered crypto derivatives intelligence.<br />
<sub>Made by <a href="https://github.com/coinank">CoinAnk</a></sub>
</div>
<div align="center">
CoinAnk OpenAPI Skill
> AI Agent 的加密衍生品数据引擎_
<br />
   
<br />
简体中文 · English
<br />
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" alt="-----" />
</div>
<div align="center">
什么是 CoinAnk OpenAPI Skill?
一句话查数据。18 大类衍生品指标,尽在掌握。
</div>
<div align="center">
CoinAnk OpenAPI Skill 是一个 OKX Plugin Store 插件,为大语言模型提供完整的加密货币衍生品市场数据能力。覆盖 K 线、ETF、持仓、多空比、资金费率、爆仓、订单流、鲸鱼动向等 18 大类、59 个实时数据接口,全部经过实测验证可用,并支持 CoinAnk API Key 直连 与 Agent Payments Protocol 或 x402 按次支付 两种访问模式。
</div>
<div align="center">
<table> <tr><td>
- 全部 59 个接口经过实测验证
- 所有请求均为 GET,简洁高效
- 支持 API Key 直连 与 Agent Payments Protocol 或 x402 按次付费
</td></tr> </table>
<br /> <img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" alt="-----" />
数据覆盖
</div>
<div align="center"> <table> <tr> <td width="50%">
行情与价格
| 分类 | 接口数 | API等级 |
|---|---|---|
| K 线 | 1 | API1 |
| ETF | 5 | API1 |
| 币种和交易对 | 4 | API1 |
| 指标数据 | 10 | API1 |
| 新闻快讯 | 2 | API2 |
</td> <td width="50%">
衍生品深度
| 分类 | 接口数 | API等级 |
|---|---|---|
| 未平仓合约 | 7 | API1 |
| 资金费率 | 7 | API1 |
| 多空比 | 6 | API1 |
| 爆仓数据 | 8 | API1 |
| RSI 选币器 | 1 | API2 |
</td> </tr> <tr> <td width="50%">
机构级数据
| 分类 | 接口数 | API等级 |
|---|---|---|
| 大额订单 | 2 | API3 |
| 市价单统计 | 8 | API3 |
| 订单本 | 3 | API3 |
| 资金流 | 2 | API3 |
| 订单流 | 1 | API3 |
| 净多头/净空头 | 1 | API3 |
</td> <td width="50%">
链上与鲸鱼
| 分类 | 接口数 | API等级 |
|---|---|---|
| HyperLiquid 鲸鱼 | 2 | API2 |
| 热门排行 | 8 | API2 |
</td> </tr> </table> </div>
<div align="center">
合计:18 大类 · 59 个接口
<br /> <img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" alt="-----" />
快速开始
</div>
首次使用时,请直接按下面两种方式选择:
- 如果你有 CoinAnk API 会员,请提供
COINANK_API_KEY - 如果你没有 CoinAnk API 会员,也可以直接使用 Agent Payments Protocol 或 x402 进行单次调用与支付
# 1. 安装或更新 OKX Plugin Store package
git clone https://github.com/okx/plugin-store.git模式一:CoinAnk API Key 直连
export COINANK_API_KEY="your_api_key_here"模式二:Agent Payments Protocol 或 x402 按次支付
如果你没有 CoinAnk API 会员,也可以通过 OKX Onchain OS 使用 Agent Payments Protocol 或 x402 完成单次调用支付:
请使用最新版 okx-agent-payments-protocol。新版 OKX 支付 skill 支持 Agent Payments Protocol / x402 proof 方式,也支持新的 charge 支付方式;实际支付方式以 OKX skill 返回或要求的流程为准。
# 安装 OKX Onchain OS skills
npx skills add okx/onchainos-skills
# 登录钱包(用于后续 Agent Payments Protocol / x402 支付签名)
onchainos wallet loginOKX Buyer 侧接入参考: https://web3.okx.com/zh-hans/onchainos/dev-docs/payments/payment-use-buyer-ai
<div align="center">
然后在支持 OKX Plugin Store 的 Agent 中直接用自然语言查询:
</div>
> "查一下 BTC 当前的资金费率"
> "看看过去 24 小时的爆仓数据"
> "获取以太坊的多空比"<div align="center"> <br /> <img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" alt="-----" />
认证与请求规范
</div>
| 项目 | 说明 |
|---|---|
| Base URL | https://open-api.coinank.com |
| 认证方式 | API Key 直连:apikey: <your_api_key>;Agent Payments Protocol / x402:由支付流生成对应支付 Header |
| 请求方法 | 全部为 GET |
| 响应格式 | application/json |
| 成功标志 | {"success": true, "code": "1", "data": ...} |
访问模式
| 模式 | 适用场景 | 要求 |
|---|---|---|
| API Key 直连 | 你已有 CoinAnk API 会员 | 设置 COINANK_API_KEY |
| Agent Payments Protocol 或 x402 按次支付 | 你没有 CoinAnk API 会员,但希望为单次请求付费 | 安装 okx/onchainos-skills |
标准响应结构
{
"success": true,
"code": "1",
"data": [ ... ]
}错误码说明
| code | 含义 |
|---|---|
1 | 成功 |
-3 | API Key 无效或认证失败 |
-7 | 超出允许访问的时间范围(endTime 参数错误) |
0 | 系统错误(参数缺失或服务端异常) |
Agent Payments Protocol / x402 响应说明
当 CoinAnk 对某个请求返回 HTTP 402 Payment Required 时,Agent 应先完成支付,再重放同一个请求,而不是把 402 当成最终业务结果。
示例请求说明
下文接口示例默认展示 API Key 直连模式。如果使用 Agent Payments Protocol / x402,实际请求参数和 URL 不变,只是在支付成功后由 Agent 为原请求补充支付 Header 再重放。
<div align="center"> <br /> <img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" alt="-----" />
关键注意事项
</div>
1. 时间戳必须是毫秒级且为当前时间
所有 endTime 参数均为毫秒级时间戳,且必须接近当前时间。传入过期或格式错误的时间戳会返回 code: -7。
# 正确:使用 python3 生成(跨平台兼容)
NOW=$(python3 -c "import time; print(int(time.time()*1000))")
# 错误:macOS 的 date 命令不支持 %3N,会生成如 "17228693N" 的无效值
NOW=$(date +%s%3N) # 不要用这个!2. API 权限等级
接口分为 API1~API4 四个级别,级别越高可访问的接口越多。每个接口标注了所需最低 API 等级。
3. exchanges 参数传空字符串
getAggCvd、getAggBuySellCount 等聚合市价单接口中,exchanges 参数必须传入(传空字符串 exchanges= 表示聚合所有交易所)。
4. OpenAPI 文件中的时间戳仅为示例
references/ 目录下 JSON 文件中的 example 时间戳均为历史示例,调用时应使用实时生成的时间戳。
5. Agent Payments Protocol / x402 只在卖家返回 HTTP 402 时生效
这个 skill 不会“假设”某个接口支持 Agent Payments Protocol 或 x402。只有当 CoinAnk 服务端对该请求真实返回 HTTP 402 Payment Required 挑战时,Agent 才会进入按次支付流程。
如果你没有 COINANK_API_KEY,而接口返回的是业务错误(例如 code: "-3")但没有 HTTP 402,说明该路由当前仍然只支持会员访问,尚未开启 Agent Payments Protocol 或 x402。
6. Agent Payments Protocol / x402 单次调用流程
当某个请求命中 Agent Payments Protocol / x402 时,推荐流程是:
1. 先按原请求发送一次,不预先登录、不预先扣费。 2. 如果服务端返回 HTTP 402 Payment Required,解析支付挑战。 3. 向用户展示本次支付的网络、币种、金额、收款地址;如果金额大于 0,则等待用户确认。 4. 使用最新版 okx-agent-payments-protocol 处理支付;它同时支持 Agent Payments Protocol / x402 支付证明和新的 charge 支付方式。 5. 如果 OKX 支付 skill 返回或要求 charge 方式,则走 charge 流程,不要强制套用旧的 x402-only proof 流程。 6. 仅在原请求基础上追加支付 Header 或所选支付方式要求的授权数据,重放同一个请求。
如果支付挑战中的金额为 0,它仍然是有效的 Agent Payments Protocol / x402 挑战。Agent 不应将 0 金额视为错误或不支持,也不能把 0 兜底、抬高或转换成 0.000001 USDC/USDT 等最小非零金额;应提示用户本次请求需要支付证明或授权但不会扣费,然后使用原始 0 金额继续通过 OKX 支付 skill 生成证明、授权或 charge 请求并重放请求。
这意味着 Agent Payments Protocol / x402 是按请求计费,更适合单次查询、临时取数和低频调用,不适合在没有 API Key 的情况下直接做大规模多接口扇出分析。
7. Agent Payments Protocol / x402 签名 scheme 约束
接入 Agent Payments Protocol / x402 时,签名 scheme 必须和签名主体保持一致:
- 如果使用 EOA 钱包私钥 签名,必须使用 `exact` scheme
- 如果使用 OKX 合约钱包 / OKX 钱包会话签名,必须使用 `aggr_deferred` scheme
不要混用这两条路径,否则会导致支付流程和签名语义不匹配。
<div align="center"> <br /> <img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" alt="-----" />
接口详情
</div>
---
<details> <summary><strong>1. K 线</strong> — 1 个接口 · API1</summary>
<br />
GET /api/kline/lists — K线行情数据
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
symbol | Yes | string | 交易对 | BTCUSDT |
exchange | Yes | string | 交易所 | Binance |
endTime | Yes | number | 毫秒时间戳,返回此时间之前的数据 | 当前时间戳 |
size | Yes | integer | 数量,最大 500 | 10 |
interval | Yes | string | 周期,见枚举值 | 1h |
productType | Yes | string | SWAP 合约 / SPOT 现货 | SWAP |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/kline/lists?symbol=BTCUSDT&exchange=Binance&endTime=$NOW&size=10&interval=1h&productType=SWAP"</details>
---
<details> <summary><strong>2. ETF</strong> — 5 个接口 · API1</summary>
<br />
GET /api/etf/getUsBtcEtf — 美国 BTC ETF 列表
无需参数
GET /api/etf/getUsEthEtf — 美国 ETH ETF 列表
无需参数
GET /api/etf/usBtcInflow — 美国 BTC ETF 历史净流入
无需参数
GET /api/etf/usEthInflow — 美国 ETH ETF 历史净流入
无需参数
GET /api/etf/hkEtfInflow — 港股 ETF 历史净流入
无需参数
curl -H "apikey: $APIKEY" "https://open-api.coinank.com/api/etf/getUsBtcEtf"
curl -H "apikey: $APIKEY" "https://open-api.coinank.com/api/etf/getUsEthEtf"
curl -H "apikey: $APIKEY" "https://open-api.coinank.com/api/etf/usBtcInflow"
curl -H "apikey: $APIKEY" "https://open-api.coinank.com/api/etf/usEthInflow"
curl -H "apikey: $APIKEY" "https://open-api.coinank.com/api/etf/hkEtfInflow"</details>
---
<details> <summary><strong>3. HyperLiquid 鲸鱼</strong> — 2 个接口 · API2</summary>
<br />
GET /api/hyper/topPosition — 鲸鱼持仓排行
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
sortBy | Yes | string | 排序字段 | positionValue |
sortType | Yes | string | desc 降序 / asc 升序 | desc |
page | Yes | integer | 页码 | 1 |
size | Yes | integer | 每页数量 | 10 |
GET /api/hyper/topAction — 鲸鱼最新动态
无需参数
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/hyper/topPosition?sortBy=positionValue&sortType=desc&page=1&size=10"
curl -H "apikey: $APIKEY" "https://open-api.coinank.com/api/hyper/topAction"</details>
---
<details> <summary><strong>4. 净多头和净空头</strong> — 1 个接口 · API3</summary>
<br />
GET /api/netPositions/getNetPositions — 净多头/净空头历史
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
exchange | Yes | string | 交易所 | Binance |
symbol | Yes | string | 交易对 | BTCUSDT |
interval | Yes | string | 周期 | 1h |
endTime | Yes | number | 毫秒时间戳 | 当前时间戳 |
size | Yes | integer | 数量,最大 500 | 10 |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/netPositions/getNetPositions?exchange=Binance&symbol=BTCUSDT&interval=1h&endTime=$NOW&size=10"</details>
---
<details> <summary><strong>5. 大额订单</strong> — 2 个接口 · API3</summary>
<br />
GET /api/trades/largeTrades — 大额市价订单
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
symbol | Yes | string | 交易对 | BTCUSDT |
productType | Yes | string | SWAP 合约 / SPOT 现货 | SWAP |
amount | Yes | string | 最小金额(USD) | 10000000 |
endTime | Yes | string | 毫秒时间戳 | 当前时间戳 |
size | Yes | string | 数量,最大 500 | 10 |
GET /api/bigOrder/queryOrderList — 大额限价订单
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
symbol | Yes | string | 交易对 | BTCUSDT |
exchangeType | Yes | string | SWAP 永续 / SPOT 现货 / FUTURES 交割 | SWAP |
size | Yes | integer | 数量,最大 500 | 10 |
amount | Yes | number | 最低金额(USD) | 1000000 |
side | Yes | string | ask 卖 / bid 买 | ask |
exchange | Yes | string | 交易所(Binance / OKX / Coinbase) | Binance |
isHistory | Yes | string | true 历史 / false 实时 | true |
startTime | No | number | 截止时间戳(isHistory=true 时建议传当前时间戳) | 当前时间戳 |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/trades/largeTrades?symbol=BTCUSDT&productType=SWAP&amount=10000000&endTime=$NOW&size=10"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/bigOrder/queryOrderList?symbol=BTCUSDT&exchangeType=SWAP&size=10&amount=1000000&side=ask&exchange=Binance&isHistory=true&startTime=$NOW"</details>
---
<details> <summary><strong>6. 币种和交易对</strong> — 4 个接口 · API1</summary>
<br />
GET /api/instruments/getLastPrice — 实时价格
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
symbol | Yes | string | 交易对 | BTCUSDT |
exchange | Yes | string | 交易所 | Binance |
productType | Yes | string | SWAP / SPOT | SWAP |
GET /api/instruments/getCoinMarketCap — 币种市值信息
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
baseCoin | Yes | string | 币种 | BTC |
GET /api/baseCoin/list — 支持的币种列表
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
productType | Yes | string | SWAP / SPOT | SWAP |
GET /api/baseCoin/symbols — 支持的交易对列表
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
exchange | Yes | string | 交易所 | Binance |
productType | Yes | string | SWAP / SPOT | SWAP |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/instruments/getLastPrice?symbol=BTCUSDT&exchange=Binance&productType=SWAP"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/instruments/getCoinMarketCap?baseCoin=BTC"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/baseCoin/list?productType=SWAP"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/baseCoin/symbols?exchange=Binance&productType=SWAP"</details>
---
<details> <summary><strong>7. 多空比</strong> — 6 个接口 · API1</summary>
<br />
GET /api/longshort/buySell — 全市场多空买卖比
API等级:API3
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
baseCoin | Yes | string | 币种 | BTC |
interval | Yes | string | 周期 | 1h |
endTime | Yes | string | 毫秒时间戳 | 当前时间戳 |
size | Yes | string | 数量 | 10 |
GET /api/longshort/realtimeAll — 交易所实时多空比
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
baseCoin | Yes | string | 币种 | BTC |
interval | Yes | string | 周期,可选 5m/15m/30m/1h/2h/4h/6h/8h/12h/1d | 1h |
GET /api/longshort/person — 多空持仓人数比
支持交易所:Binance / OKX / Bybit
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
exchange | Yes | string | 交易所 | Binance |
symbol | Yes | string | 交易对 | BTCUSDT |
interval | Yes | string | 周期 | 1h |
endTime | Yes | string | 毫秒时间戳 | 当前时间戳 |
size | Yes | string | 数量,最大 500 | 10 |
GET /api/longshort/position — 大户多空比(持仓量)
支持交易所:Binance / OKX / Huobi — 参数与 person 相同。
GET /api/longshort/account — 大户多空比(账户数)
支持交易所:Binance / OKX / Huobi — 参数与 person 相同。
GET /api/longshort/kline — 多空比 K 线
支持交易所:Binance / OKX / Huobi
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
exchange | Yes | string | 交易所 | Binance |
symbol | Yes | string | 交易对 | BTCUSDT |
interval | Yes | string | 周期 | 1h |
endTime | Yes | string | 毫秒时间戳 | 当前时间戳 |
size | Yes | string | 数量,最大 500 | 10 |
type | Yes | string | longShortPerson 人数比 / longShortPosition 持仓比 / longShortAccount 账户比 | longShortPerson |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/longshort/realtimeAll?baseCoin=BTC&interval=1h"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/longshort/person?exchange=Binance&symbol=BTCUSDT&interval=1h&endTime=$NOW&size=10"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/longshort/kline?exchange=Binance&symbol=BTCUSDT&interval=1h&endTime=$NOW&size=10&type=longShortPerson"</details>
---
<details> <summary><strong>8. 市价单统计指标</strong> — 8 个接口 · API3</summary>
<br />
分为单交易对和聚合(跨交易所)两组。
单交易对系列(需指定 exchange + symbol)
| 接口 | 说明 |
|---|---|
GET /api/marketOrder/getCvd | CVD(主动买卖量差) |
GET /api/marketOrder/getBuySellCount | 主动买卖笔数 |
GET /api/marketOrder/getBuySellValue | 主动买卖额(USD) |
GET /api/marketOrder/getBuySellVolume | 主动买卖量(币本位) |
公共参数:
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
exchange | Yes | string | 交易所(Binance / OKX / Bybit / Bitget) | Binance |
symbol | Yes | string | 交易对 | BTCUSDT |
interval | Yes | string | 周期 | 1h |
endTime | Yes | string | 毫秒时间戳 | 当前时间戳 |
size | Yes | integer | 数量,最大 500 | 10 |
productType | Yes | string | SWAP / SPOT | SWAP |
聚合系列(按 baseCoin 跨交易所聚合)
| 接口 | 说明 |
|---|---|
GET /api/marketOrder/getAggCvd | 聚合 CVD |
GET /api/marketOrder/getAggBuySellCount | 聚合买卖笔数 |
GET /api/marketOrder/getAggBuySellValue | 聚合买卖额 |
GET /api/marketOrder/getAggBuySellVolume | 聚合买卖量 |
公共参数:
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
baseCoin | Yes | string | 币种 | BTC |
interval | Yes | string | 周期 | 1h |
endTime | Yes | string | 毫秒时间戳 | 当前时间戳 |
size | Yes | integer | 数量,最大 500 | 10 |
productType | Yes | string | SWAP / SPOT | SWAP |
exchanges | Yes | string | 传空字符串表示聚合所有交易所 | (空) |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/marketOrder/getCvd?exchange=Binance&symbol=BTCUSDT&interval=1h&endTime=$NOW&size=10&productType=SWAP"
# 注意:exchanges 参数必须传入,传空字符串表示聚合全部
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/marketOrder/getAggCvd?baseCoin=BTC&interval=1h&endTime=$NOW&size=10&productType=SWAP&exchanges="</details>
---
<details> <summary><strong>9. 新闻快讯</strong> — 2 个接口 · API2</summary>
<br />
GET /api/news/getNewsList — 新闻/快讯列表
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
type | Yes | string | 1 快讯 / 2 新闻 | 1 |
lang | Yes | string | 语言:zh 中文 / en 英文 | zh |
page | Yes | string | 页码 | 1 |
pageSize | Yes | string | 每页数量 | 10 |
isPopular | Yes | string | 是否推荐:true / false | false |
search | Yes | string | 搜索关键词,无则传空字符串 | (空) |
GET /api/news/getNewsDetail — 新闻详情
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
id | Yes | string | 新闻 ID(从列表接口获取) | 69a2f40912d08f6a781aedd0 |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/news/getNewsList?type=1&lang=zh&page=1&pageSize=10&isPopular=false&search="
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/news/getNewsDetail?id=69a2f40912d08f6a781aedd0"</details>
---
<details> <summary><strong>10. 指标数据</strong> — 10 个接口 · API1</summary>
<br />
以下指标无需参数,直接请求即可。
| 接口 | 说明 |
|---|---|
GET /api/indicator/getBtcMultiplier | 两年 MA 乘数 |
GET /api/indicator/getCnnEntity | 贪婪恐惧指数 |
GET /api/indicator/getAhr999 | ahr999 囤币指标 |
GET /api/indicator/getPuellMultiple | 普尔系数(Puell Multiple) |
GET /api/indicator/getBtcPi | Pi 循环顶部指标 |
GET /api/indicator/getMovingAvgHeatmap | 200 周均线热力图 |
GET /api/indicator/getAltcoinSeason | 山寨季指数 |
GET /api/indicator/getMarketCapRank — 市值占比排名
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
symbol | Yes | string | 币种 | BTC |
GET /api/indicator/getGrayscaleOpenInterest — 灰度持仓数据
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
symbol | Yes | string | 币种 | BTC |
GET /api/indicator/index/charts — 彩虹图等综合指标
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
type | Yes | string | 图表类型 | bitcoin-rainbow-v2 |
curl -H "apikey: $APIKEY" "https://open-api.coinank.com/api/indicator/getCnnEntity"
curl -H "apikey: $APIKEY" "https://open-api.coinank.com/api/indicator/getMarketCapRank?symbol=BTC"
curl -H "apikey: $APIKEY" "https://open-api.coinank.com/api/indicator/index/charts?type=bitcoin-rainbow-v2"</details>
---
<details> <summary><strong>11. 未平仓合约</strong> — 7 个接口 · API1</summary>
<br />
GET /api/openInterest/all — 实时持仓列表(全交易所)
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
baseCoin | Yes | string | 币种 | BTC |
GET /api/openInterest/v2/chart — 币种聚合持仓历史
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
baseCoin | Yes | string | 币种 | BTC |
exchange | Yes | string | 交易所,传空字符串查全部 | (空) |
interval | Yes | string | 周期 | 1h |
size | Yes | string | 数量,最大 500 | 10 |
type | Yes | string | USD 美元计价 / 币种名(如 BTC)币本位 | USD |
endTime | Yes | number | 毫秒时间戳 | 当前时间戳 |
GET /api/openInterest/symbol/Chart — 交易对持仓历史
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
exchange | Yes | string | 交易所 | Binance |
symbol | Yes | string | 交易对 | BTCUSDT |
interval | Yes | string | 周期 | 1h |
endTime | Yes | number | 毫秒时间戳 | 当前时间戳 |
size | Yes | string | 数量,最大 500 | 10 |
type | Yes | string | USD / 币种名 | USD |
GET /api/openInterest/kline — 交易对持仓 K 线
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
exchange | Yes | string | 交易所 | Binance |
symbol | Yes | string | 交易对 | BTCUSDT |
interval | Yes | string | 周期 | 1h |
endTime | Yes | number | 毫秒时间戳 | 当前时间戳 |
size | Yes | integer | 数量 | 10 |
GET /api/openInterest/aggKline — 聚合持仓 K 线
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
baseCoin | Yes | string | 币种 | BTC |
interval | Yes | string | 周期 | 1h |
endTime | Yes | number | 毫秒时间戳 | 当前时间戳 |
size | Yes | integer | 数量 | 10 |
GET /api/tickers/topOIByEx — 实时持仓(按交易所统计)
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
baseCoin | Yes | string | 币种 | BTC |
GET /api/instruments/oiVsMc — 历史持仓市值比
API等级:API2
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
baseCoin | Yes | string | 币种 | BTC |
endTime | Yes | string | 毫秒时间戳 | 当前时间戳 |
size | Yes | string | 数量,最大 500 | 100 |
interval | Yes | string | 周期 | 1h |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/openInterest/all?baseCoin=BTC"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/openInterest/aggKline?baseCoin=BTC&interval=1h&endTime=$NOW&size=10"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/instruments/oiVsMc?baseCoin=BTC&endTime=$NOW&size=100&interval=1h"</details>
---
<details> <summary><strong>12. 热门排行</strong> — 8 个接口 · API2</summary>
<br />
GET /api/instruments/visualScreener — 视觉筛选器
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
interval | Yes | string | 15m / 1h / 4h / 24h | 15m |
GET /api/instruments/oiVsMarketCap — 持仓/市值排行
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
page | Yes | integer | 页码 | 1 |
size | Yes | integer | 每页数量 | 10 |
sortBy | Yes | string | 排序字段 | openInterest |
sortType | Yes | string | desc / asc | desc |
GET /api/instruments/longShortRank — 多空持仓人数比排行
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
sortBy | Yes | string | 排序字段 | longRatio |
sortType | Yes | string | desc / asc | desc |
size | Yes | integer | 每页数量 | 10 |
page | Yes | integer | 页码 | 1 |
GET /api/instruments/oiRank — 持仓量排行榜
参数同 longShortRank,sortBy 示例值:openInterest。
GET /api/trades/count — 交易笔数排行
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
productType | Yes | string | SWAP / SPOT | SWAP |
sortBy | Yes | string | 排序字段,如 h1Count(1小时)、d1Count(1天) | h1Count |
sortType | Yes | string | desc / asc | desc |
GET /api/instruments/liquidationRank — 爆仓排行榜
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
sortBy | Yes | string | 排序字段,如 liquidationH24 | liquidationH24 |
sortType | Yes | string | desc / asc | desc |
page | Yes | integer | 页码 | 1 |
size | Yes | integer | 每页数量 | 10 |
GET /api/instruments/priceRank — 价格变化排行
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
sortBy | Yes | string | 如 priceChangeH24(24h涨跌幅) | priceChangeH24 |
sortType | Yes | string | desc / asc | desc |
GET /api/instruments/volumeRank — 交易量变化排行
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
sortBy | Yes | string | 如 h24Volume(24h交易量) | h24Volume |
sortType | Yes | string | desc / asc | desc |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/instruments/visualScreener?interval=15m"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/trades/count?productType=SWAP&sortBy=h1Count&sortType=desc"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/instruments/priceRank?sortBy=priceChangeH24&sortType=desc"</details>
---
<details> <summary><strong>13. 爆仓数据</strong> — 8 个接口 · API1</summary>
<br />
GET /api/liquidation/allExchange/intervals — 各时间段实时爆仓统计
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
baseCoin | Yes | string | 币种 | BTC |
GET /api/liquidation/aggregated-history — 聚合爆仓历史
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
baseCoin | Yes | string | 币种 | BTC |
interval | Yes | string | 周期 | 1h |
endTime | Yes | number | 毫秒时间戳 | 当前时间戳 |
size | Yes | integer | 数量 | 10 |
GET /api/liquidation/history — 交易对爆仓历史
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
exchange | Yes | string | 交易所 | Binance |
symbol | Yes | string | 交易对 | BTCUSDT |
interval | Yes | string | 周期 | 1h |
endTime | Yes | number | 毫秒时间戳 | 当前时间戳 |
size | Yes | integer | 数量 | 10 |
GET /api/liquidation/orders — 爆仓订单列表
API等级:API3
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
baseCoin | Yes | string | 币种 | BTC |
exchange | Yes | string | 交易所 | Binance |
side | Yes | string | long 多 / short 空 | long |
amount | Yes | number | 最低爆仓金额(USD) | 100 |
endTime | Yes | number | 毫秒时间戳 | 当前时间戳 |
GET /api/liqMap/getLiqMap — 清算地图
API等级:API4
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
symbol | Yes | string | 交易对 | BTCUSDT |
exchange | Yes | string | 交易所 | Binance |
interval | Yes | string | 周期 | 1d |
GET /api/liqMap/getAggLiqMap — 聚合清算地图
API等级:API4
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
baseCoin | Yes | string | 币种 | BTC |
interval | Yes | string | 周期 | 1d |
GET /api/liqMap/getLiqHeatMap — 清算热力图
API等级:API4
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
exchange | Yes | string | 交易所 | Binance |
symbol | Yes | string | 交易对 | BTCUSDT |
interval | Yes | string | 周期 | 1d |
GET /api/liqMap/getLiqHeatMapSymbol — 清算热图支持的交易对列表
API等级:API1 | 无需参数
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/liquidation/allExchange/intervals?baseCoin=BTC"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/liquidation/orders?baseCoin=BTC&exchange=Binance&side=long&amount=100&endTime=$NOW"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/liqMap/getLiqHeatMapSymbol"</details>
---
<details> <summary><strong>14. 订单本</strong> — 3 个接口 · API3</summary>
<br />
GET /api/orderBook/v2/bySymbol — 按交易对查询挂单深度历史
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
symbol | Yes | string | 交易对 | BTCUSDT |
exchange | Yes | string | 交易所 | Binance |
rate | Yes | number | 价格精度比例 | 0.01 |
productType | Yes | string | SWAP / SPOT | SWAP |
interval | Yes | string | 周期 | 1h |
endTime | Yes | number | 毫秒时间戳 | 当前时间戳 |
size | Yes | integer | 数量,最大 500 | 10 |
GET /api/orderBook/v2/byExchange — 按交易所查询挂单深度历史
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
baseCoin | Yes | string | 币种 | BTC |
productType | Yes | string | SWAP / SPOT | SWAP |
interval | Yes | string | 周期 | 1h |
endTime | Yes | number | 毫秒时间戳 | 当前时间戳 |
size | Yes | integer | 数量,最大 500 | 10 |
exchanges | Yes | string | 交易所名称 | Binance |
type | Yes | string | 价格精度比例 | 0.01 |
GET /api/orderBook/getHeatMap — 挂单流动性热力图
API等级:API4
此接口 endTime 参数会被 CDN 缓存层校验,必须传入当前毫秒时间戳。| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
exchange | Yes | string | 交易所(目前仅支持 Binance) | Binance |
symbol | Yes | string | 交易对 | BTCUSDT |
interval | Yes | string | 周期:1m / 3m / 5m | 1m |
endTime | Yes | string | 毫秒时间戳(必须传当前时间,过期时间会被 CDN 拦截返回 401) | 当前时间戳 |
size | Yes | string | 数量,最大 500 | 10 |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/orderBook/v2/bySymbol?symbol=BTCUSDT&exchange=Binance&rate=0.01&productType=SWAP&interval=1h&endTime=$NOW&size=10"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/orderBook/getHeatMap?exchange=Binance&symbol=BTCUSDT&interval=1m&endTime=$NOW&size=10"</details>
---
<details> <summary><strong>15. 资金流</strong> — 2 个接口 · API3</summary>
<br />
GET /api/fund/fundReal — 实时资金流
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
productType | Yes | string | SWAP / SPOT | SWAP |
page | Yes | integer | 页码 | 1 |
size | Yes | integer | 每页数量 | 10 |
sortBy | Yes | string | 排序字段,如 h1net(1h净流入) | h1net |
sortType | Yes | string | desc / asc | desc |
baseCoin | Yes | string | 币种(传空字符串查全部) | BTC |
GET /api/fund/getFundHisList — 历史资金流
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
baseCoin | Yes | string | 币种 | BTC |
endTime | Yes | number | 毫秒时间戳 | 当前时间戳 |
productType | Yes | string | SWAP / SPOT | SWAP |
size | Yes | integer | 数量 | 10 |
interval | Yes | string | 周期 | 1h |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/fund/fundReal?productType=SWAP&page=1&size=10&sortBy=h1net&sortType=desc&baseCoin=BTC"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/fund/getFundHisList?baseCoin=BTC&endTime=$NOW&productType=SWAP&size=10&interval=1h"</details>
---
<details> <summary><strong>16. 订单流</strong> — 1 个接口 · API3</summary>
<br />
GET /api/orderFlow/lists — 订单流数据
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
exchange | Yes | string | 交易所 | Binance |
symbol | Yes | string | 交易对 | BTCUSDT |
interval | Yes | string | 周期 | 1h |
endTime | Yes | number | 毫秒时间戳 | 当前时间戳 |
size | Yes | integer | 数量 | 10 |
productType | Yes | string | SWAP / SPOT | SWAP |
tickCount | Yes | integer | tick 数量 | 1 |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/orderFlow/lists?exchange=Binance&symbol=BTCUSDT&interval=1h&endTime=$NOW&size=10&productType=SWAP&tickCount=1"</details>
---
<details> <summary><strong>17. 资金费率</strong> — 7 个接口 · API1</summary>
<br />
GET /api/fundingRate/hist — 历史资金费率(跨交易所)
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
baseCoin | Yes | string | 币种 | BTC |
exchangeType | Yes | string | 计价币类型:USDT / USD(币本位) | USDT |
endTime | Yes | number | 毫秒时间戳 | 当前时间戳 |
size | Yes | integer | 数量 | 10 |
GET /api/fundingRate/current — 实时资金费率排行
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
type | Yes | string | current 实时 / day 1日 / week 1周 / month 1月 / year 1年 | current |
GET /api/fundingRate/accumulated — 累计资金费率
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
type | Yes | string | day / week / month / year | day |
GET /api/fundingRate/indicator — 交易对资金费率历史
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
exchange | Yes | string | 交易所(Binance / OKX / Bybit / Huobi / Gate / Bitget) | Binance |
symbol | Yes | string | 交易对 | BTCUSDT |
interval | Yes | string | 周期 | 1h |
endTime | Yes | string | 毫秒时间戳 | 当前时间戳 |
size | Yes | string | 数量,最大 500 | 10 |
GET /api/fundingRate/kline — 资金费率 K 线
参数与 fundingRate/indicator 相同。
GET /api/fundingRate/getWeiFr — 加权资金费率
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
baseCoin | Yes | string | 币种 | BTC |
interval | Yes | string | 周期 | 1h |
endTime | Yes | string | 毫秒时间戳 | 当前时间戳 |
size | Yes | string | 数量,最大 500 | 10 |
GET /api/fundingRate/frHeatmap — 资金费率热力图
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
type | Yes | string | openInterest 按持仓 / marketCap 按市值 | marketCap |
interval | Yes | string | 1D / 1W / 1M / 6M | 1M |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/fundingRate/current?type=current"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/fundingRate/accumulated?type=day"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/fundingRate/frHeatmap?type=marketCap&interval=1M"
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/fundingRate/getWeiFr?baseCoin=BTC&interval=1h&endTime=$NOW&size=10"</details>
---
<details> <summary><strong>18. RSI 选币器</strong> — 1 个接口 · API2</summary>
<br />
GET /api/rsiMap/list — RSI 指标筛选
| 参数 | 必填 | 类型 | 说明 | 示例 |
|---|---|---|---|---|
interval | Yes | string | 周期(注意大写H/D):1H / 4H / 1D 等 | 1H |
exchange | Yes | string | 交易所 | Binance |
curl -H "apikey: $APIKEY" \
"https://open-api.coinank.com/api/rsiMap/list?interval=1H&exchange=Binance"</details>
<div align="center"> <br /> <img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" alt="-----" />
枚举值速查
</div>
<details> <summary><strong>interval(K线/历史数据周期)</strong></summary>
<br />
| 值 | 说明 |
|---|---|
1m | 1 分钟 |
3m | 3 分钟 |
5m | 5 分钟 |
15m | 15 分钟 |
30m | 30 分钟 |
1h | 1 小时 |
2h | 2 小时 |
4h | 4 小时 |
6h | 6 小时 |
8h | 8 小时 |
12h | 12 小时 |
1d | 1 天 |
RSI 选币器使用大写:1H、4H、1D
资金费率热力图使用:1D、1W、1M、6M
</details>
<details> <summary><strong>exchange(主流交易所)</strong></summary>
<br />
| 值 | 说明 |
|---|---|
Binance | 币安 |
OKX | 欧易 |
Bybit | Bybit |
Bitget | Bitget |
Gate | Gate.io |
Huobi | 火币 |
Bitmex | BitMEX |
dYdX | dYdX |
Bitfinex | Bitfinex |
CME | 芝商所 |
Kraken | Kraken |
Deribit | Deribit |
</details>
<details> <summary><strong>productType(产品类型)</strong></summary>
<br />
| 值 | 说明 |
|---|---|
SWAP | 永续合约 |
SPOT | 现货 |
FUTURES | 交割合约 |
</details>
<details> <summary><strong>sortBy 常用字段</strong></summary>
<br />
| 接口类型 | 常用 sortBy 值 |
|---|---|
| 持仓排行 | openInterest |
| 爆仓排行 | liquidationH24、liquidationH12、liquidationH8、liquidationH4、liquidationH1 |
| 价格排行 | priceChangeH24、priceChangeH1、priceChangeM5 |
| 交易量排行 | h24Volume、h1Volume |
| 笔数排行 | h1Count、d1Count、h4Count |
| 资金流 | h1net、h4net、h8net、h24net |
| 鲸鱼持仓 | positionValue、unrealizedPnl |
</details>
<div align="center"> <br /> <img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" alt="-----" />
<br />
License
MIT License — CoinAnk
<br />
Built for AI-powered crypto derivatives intelligence.<br />
<sub>Made by <a href="https://github.com/coinank">CoinAnk</a></sub>
</div>
{
"openapi": "3.0.1",
"info": {
"title": "默认模块",
"description": "",
"version": "1.0.0"
},
"tags": [
{
"name": "币种和交易对"
}
],
"paths": {
"/api/instruments/getLastPrice": {
"get": {
"summary": "获取交易对实时价格(API等级1)",
"deprecated": false,
"description": "获取交易对的实时价格。<font color = 'red'> # 需要API等级:API1及以上</font>",
"tags": [
"币种和交易对"
],
"parameters": [
{
"name": "symbol",
"in": "query",
"description": "交易对",
"required": true,
"example": "ETHUSDT",
"schema": {
"type": "string"
}
},
{
"name": "exchange",
"in": "query",
"description": "交易所",
"required": true,
"example": "Binance",
"schema": {
"type": "string"
}
},
{
"name": "productType",
"in": "query",
"description": "SWAP 合约 SPOT 现货",
"required": true,
"example": "SWAP",
"schema": {
"type": "string"
}
},
{
"name": "apikey",
"in": "header",
"description": "Register and activate to obtain apikey",
"required": true,
"example": "{{apikey}}",
"schema": {
"type": "string",
"default": "{{apikey}}"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
},
"headers": {}
}
},
"security": []
}
},
"/api/instruments/getCoinMarketCap": {
"get": {
"summary": "获取币种市值(API等级1)",
"deprecated": false,
"description": "获取币种市值。<font color = 'red'> # 需要API等级:API1及以上</font>",
"tags": [
"币种和交易对"
],
"parameters": [
{
"name": "baseCoin",
"in": "query",
"description": "",
"required": true,
"example": "BTC",
"schema": {
"type": "string"
}
},
{
"name": "apikey",
"in": "header",
"description": "Register and activate to obtain apikey",
"required": true,
"example": "{{apikey}}",
"schema": {
"type": "string",
"default": "{{apikey}}"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
},
"headers": {}
}
},
"security": []
}
},
"/api/baseCoin/list": {
"get": {
"summary": "支持的币种(API等级1)",
"deprecated": false,
"description": "返回所有支持的币种,支持现货和合约 <font color = 'red'> # 需要API等级:API1及以上</font>",
"tags": [
"币种和交易对"
],
"parameters": [
{
"name": "productType",
"in": "query",
"description": "SWAP or SPOT",
"required": true,
"example": "SWAP",
"schema": {
"type": "string"
}
},
{
"name": "apikey",
"in": "header",
"description": "Register and activate to obtain apikey",
"required": true,
"example": "{{apikey}}",
"schema": {
"type": "string",
"default": "{{apikey}}"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
},
"example": {
"success": true,
"code": "1",
"data": [
"BTC",
"ETH",
"SOL",
"XRP",
"DOGE",
"BNB",
"TON",
"LTC",
"1000PEPE",
"AVAX",
"WIF",
"SUI",
"BCH",
"DOT",
"1000BONK",
"ADA",
"FTM",
"AAVE",
"LINK",
"FIL",
"ORDI",
"NEAR",
"DOGS",
"WLD",
"OP",
"TRX",
"TIA",
"ARB",
"NOT",
"PEPE",
"ATOM",
"MKR",
"APT",
"PEOPLE",
"NEIROETH",
"INJ",
"UNI",
"ETC",
"ONDO",
"CRV",
"SEI",
"REEF",
"EOS",
"STRK",
"TRB",
"ENA",
"KAS",
"FET",
"BOME",
"TAO",
"POPCAT",
"1000SATS",
"DYDX",
"APE",
"AR",
"JUP",
"ENS",
"LDO",
"GALA",
"STX",
"RUNE",
"ZRO",
"BNX",
"CFX",
"1000FLOKI",
"MEW",
"RENDER",
"GMT",
"ICP",
"SUN",
"IO",
"ETHFI",
"ZK",
"VIDT",
"1000RATS",
"JTO",
"SAGA",
"BIGTIME",
"HBAR",
"BLUR",
"SAND",
"RARE",
"IMX",
"JASMY",
"PYTH",
"AXS",
"SATS",
"PENDLE",
"DAR",
"1000SHIB",
"SHIB",
"VET",
"BSV",
"XLM",
"RDNT",
"MANA",
"ALGO",
"ARKM",
"BRETT",
"BAKE",
"W",
"1INCH",
"GRT",
"AEVO",
"MASK",
"LPT",
"CHZ",
"BB",
"SUNDOG",
"TONCOIN",
"LISTA",
"FLOKI",
"MANTA",
"SUSHI",
"COMP",
"SHIB1000",
"TURBO",
"OM",
"ZEC",
"BOND",
"BANANA",
"ZETA",
"MEME",
"SSV",
"YGG",
"THETA",
"KSM",
"EGLD",
"NEO",
"XAI",
"XMR",
"ATH",
"TRU",
"STORJ",
"SNX",
"MYRO",
"CAKE",
"LQTY",
"STMX",
"TNSR",
"DYM",
"AUCTION",
"ROSE",
"GMX",
"1000LUNC",
"CHR",
"MINA",
"UXLINK",
"RSR",
"QNT",
"REZ",
"SUPER",
"ZEN",
"ALT",
"CELO",
"CORE",
"10000SATS",
"SFP",
"XTZ",
"YFI",
"HIGH",
"MNT",
"COTI",
"FLOW",
"USDC",
"MAX",
"ASTR",
"WOO",
"CKB",
"TOKEN",
"FLUX",
"UNFI",
"GTC",
"IOTA",
"BLZ",
"PIXEL",
"HNT",
"CYBER",
"LUNA2",
"UMA",
"LEVER",
"MERL",
"ACE",
"ANKR",
"ALPACA",
"ENJ",
"RVN",
"RPL",
"ZIL",
"FLM",
"BAL",
"KLAY",
"VELO",
"MAGIC",
"QTUM",
"FXS",
"OMNI",
"ORDER",
"ACH",
"POL",
"KEY",
"LRC",
"API3",
"KNC",
"ALICE",
"HOOK",
"ZRX",
"DASH",
"KAVA",
"TWT",
"BGB",
"LINA",
"STG",
"BENDOG",
"AI",
"IOTX",
"ID",
"PORTAL",
"POLYX",
"ONE",
"VOXEL",
"AXL",
"USTC",
"ORBS",
"BEL",
"LUNC",
"LUNA",
"GLM",
"DOG",
"AGI",
"1000000MOG",
"MOVR",
"BONK",
"GAS",
"C98",
"ARPA",
"ONT",
"BTCDOM",
"TLM",
"MAVIA",
"ULTI",
"1000BEER",
"BAND",
"PERP",
"NMR",
"VANRY",
"DUSK",
"HIFI",
"EDU",
"NFP",
"NULS",
"LOOM",
"METIS",
"JOE",
"IOST",
"L3",
"XEM",
"HOT",
"MAV",
"GFT",
"BAT",
"BSW",
"BEAM",
"SXP",
"AMB",
"LIT",
"AGLD",
"ICX",
"VGX",
"BLAST",
"PAXG",
"CRO",
"BICO",
"ZKJ",
"TOMI",
"T",
"PONKE",
"10000LADYS",
"ALPHA",
"SKL",
"SYN",
"LSK",
"CELR",
"CTSI",
"ETHW",
"MIR",
"ILV",
"MTL",
"BADGER",
"DENT",
"MBOX",
"PHB",
"CVC",
"WAVES",
"NKN",
"XVS",
"NTRN",
"DOP1",
"REN",
"SYS",
"CVX",
"TAIKO",
"BEAMX",
"G",
"PRCL",
"RON",
"CAT",
"SPELL",
"DRIFT",
"ATA",
"POWR",
"SLP",
"BNT",
"AVAIL",
"XVG",
"GME",
"SLERF",
"RLC",
"OGN",
"ETHBTC",
"QUICK",
"CHESS",
"XCH",
"HFT",
"RIF",
"CLOUD",
"WAXP",
"ARK",
"CTC",
"OMG",
"PIXFI",
"LOOKS",
"RONIN",
"1000TURBO",
"OXT",
"1000XEC",
"DEGEN",
"10000WEN",
"ONG",
"MOCA",
"VRA",
"1000BTT",
"AERGO",
"AIDOGE",
"ZEUS",
"AKT",
"COMBO",
"DGB",
"FLR",
"STEEM",
"FOXY",
"RATS",
"JST",
"CSPR",
"PENG",
"CTK",
"AUDIO",
"FTN",
"USDE",
"DODOX",
"ZKSYNC",
"SWEAT",
"SC",
"SILLY",
"1000APU",
"CETUS",
"AIOZ",
"DODO",
"MOTHER",
"RAY",
"SPEC",
"AERO",
"ZKF",
"1000000PEIPEI",
"KDA",
"SLF",
"A8",
"GODS",
"MASA",
"FIRE",
"$ALT",
"GLMR",
"ZBCN",
"SNT",
"1000BTTC",
"MAXNEW",
"ANC",
"WSB",
"MON",
"RSS3",
"XNO",
"IDEX",
"AKRO",
"LAI",
"SCA"
]
}
}
},
"headers": {}
}
},
"security": []
}
},
"/api/baseCoin/symbols": {
"get": {
"summary": " 支持的交易对(API等级1)",
"deprecated": false,
"description": "返回所有支持的交易对,支持合约和交易所,支持按交易所过滤 <font color = 'red'> # 需要API等级:API1及以上</font>\n",
"tags": [
"币种和交易对"
],
"parameters": [
{
"name": "exchange",
"in": "query",
"description": "",
"required": true,
"example": "Binance",
"schema": {
"type": "string"
}
},
{
"name": "productType",
"in": "query",
"description": "SWAP or SPOT ",
"required": true,
"example": "SWAP",
"schema": {
"type": "string"
}
},
{
"name": "apikey",
"in": "header",
"description": "Register and activate to obtain apikey",
"required": true,
"example": "{{apikey}}",
"schema": {
"type": "string",
"default": "{{apikey}}"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"code": {
"type": "string"
},
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"symbol": {
"type": "string"
},
"baseCoin": {
"type": "string"
},
"exchangeName": {
"type": "string"
}
},
"required": [
"symbol",
"baseCoin",
"exchangeName"
]
}
}
},
"required": [
"success",
"code",
"data"
]
}
}
},
"headers": {}
}
},
"security": []
}
}
},
"components": {
"schemas": {},
"responses": {},
"securitySchemes": {}
},
"servers": [
{
"url": "https://open-api.coinank.com",
"description": "Prod Env"
}
],
"security": []
}coinank-openapi
Overview
CoinAnk OpenAPI gives agents access to cryptocurrency derivatives market data across K-lines, ETFs, open interest, long/short ratios, funding rates, liquidations, order flow, whale activity, and related analytics.
The plugin supports direct CoinAnk API-key access and pay-per-call access through Agent Payments Protocol / x402 via the latest OKX payment skill, including the newer charge payment method when required by the OKX payment flow.
Prerequisites
- Optional: a CoinAnk API key with the required API level for the requested endpoint.
- For pay-per-call access: install or update
okx/onchainos-skillssookx-agent-payments-protocolandokx-agentic-walletare available. - Network access to
open-api.coinank.com.
Quick Start
1. Ask the agent to run the coinank-openapi quickstart flow to review access options and choose API-key mode or Agent Payments Protocol / x402 pay-per-call mode. 2. If you have a CoinAnk API key, set COINANK_API_KEY and call the desired endpoint with the apikey header. 3. If you do not have an API key, send the original request first and let CoinAnk return an HTTP 402 Payment Required challenge when pay-per-call access is available. 4. Use the latest okx-agent-payments-protocol skill to complete the required proof, authorization, or charge flow, then replay the same request with the generated payment data.