idstring必須
Asset platform's ID. *refers to [`/asset_platforms`](/reference/asset-platforms-list)
デフォルト: "ethereum"
https://api.sandbase.ai/v1/api/coingecko/simple-token-priceGet one or more token prices using their token contract addresses
出力はここに表示されます
入力を完了してから[実行]をクリックしてください。
Get one or more token prices using their token contract addresses
The response is the official CoinGecko API response, unchanged.
curl -X POST "https://api.sandbase.ai/v1/api/coingecko/simple-token-price" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id": "ethereum", "contract_addresses": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "vs_currencies": "usd"}'
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Asset platform's ID. *refers to /asset_platforms |
contract_addresses | string | Yes | Token contract addresses, comma-separated if querying more than 1 token |
include_24hr_change | boolean | No | Include 24-hour change percentage. Default: false |
include_24hr_vol | boolean | No | Include 24-hour trading volume. Default: false |
include_last_updated_at | boolean | No | Include last updated price time as a UNIX timestamp. Default: false |
include_market_cap | boolean | No | Include market capitalization. Default: false |
precision | string | No | Decimal places for currency price value |
vs_currencies | string | Yes | Target currency of coins, comma-separated if querying more than 1 currency. *refers to [/simple/supported_vs_currencies](/reference/simple-supported-currencie |
Flat price per call. Failed calls are not charged.
開発を始める
統一認証と使用状況の追跡を備えたプラットフォームAPIエンドポイントです。
curl -X POST "https://api.sandbase.ai/v1/api/coingecko/simple-token-price" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "ethereum",
"vs_currencies": "usd",
"contract_addresses": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
}'SandBaseのAPIキーをサーバー環境に設定してください。リクエストはBearer認証を使用します。
export SANDBASE_API_KEY="YOUR_API_KEY"キーはサーバー側で管理してください。ブラウザコードに公開しないでください。
idstring必須Asset platform's ID. *refers to [`/asset_platforms`](/reference/asset-platforms-list)
デフォルト: "ethereum"
contract_addressesstring必須Token contract addresses, comma-separated if querying more than 1 token
デフォルト: "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"
vs_currenciesstring必須Target currency of coins, comma-separated if querying more than 1 currency. *refers to [`/simple/supported_vs_currencies`](/reference/simple-supported-currencies)
デフォルト: "usd"
include_24hr_changebooleanInclude 24-hour change percentage. Default: false
include_24hr_volbooleanInclude 24-hour trading volume. Default: false
include_last_updated_atbooleanInclude last updated price time as a UNIX timestamp. Default: false
include_market_capbooleanInclude market capitalization. Default: false
precisionstringDecimal places for currency price value
指定可能な値: full, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18
このAPIの保存済みサンプルレスポンスです。表示時にライブリクエストは行われません。
保存済みレスポンスはまだ公開されていません。PlaygroundでAPIを実行し、レスポンスを確認してください。
さらに探索
| API | 価格 | レスポンス |
|---|---|---|
CoinGecko | $0.008 / 回 | JSON |
CoinGecko | $0.008 / 回 | JSON |
CoinGecko | $0.008 / 回 | JSON |
CoinGecko | $0.008 / 回 | JSON |
CoinGecko | $0.008 / 回 | JSON |
CoinGecko | $0.008 / 回 | JSON |
質問
Authorization ヘッダー(Bearer)に SandBase API key を指定し、パラメータを JSON ボディで送信して https://api.sandbase.ai/v1/api/coingecko/simple-token-price に POST リクエストを送ります。このページの Playground で、コードを書かずに試すこともできます。
1回あたり $0.008、SandBase 残高から課金されます。課金対象はご利用分のみで、サブスクリプションはありません。
必須: id (string), contract_addresses (string) と vs_currencies (string)。 任意: include_24hr_change (boolean), include_24hr_vol (boolean), include_last_updated_at (boolean), include_market_cap (boolean) と precision(full, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 のいずれか)。 このページの Parameters テーブルと Playground に、すべてのフィールドが一覧表示されています。
同じ HTTP リクエスト内で返される JSON レスポンスです(同期)。
いいえ。CoinGecko Coin Price by Token Addresses は SandBase 経由で動作するため、SandBase の API key 1つでこのエンドポイントと、カタログ内の他のすべての API とモデルを利用できます。CoinGecko の API アクセスを別途申請する必要はありません。