Sand AISand AI MAGI-2ตอนนี้ MAGI-2 อยู่บน SandBase แล้ว: วิดีโอ 1080p พร้อมเสียงในตัวลองใช้เลย

CoinGecko Coin Price by IDs, Symbols, or Names

เอกสาร API
https://api.sandbase.ai/v1/api/coingecko/simple-price

Get the prices of one or more coins by using their unique Coin API IDs, symbols, or names

ราคา
$0.008USD / คำขอ
Method
POST
การตอบกลับ
JSON
พารามิเตอร์
1 จำเป็น · 9 ไม่บังคับ

Playground

อินพุต
Target currency of coins, comma-separated if querying more than 1 currency. *refers to [`/simple/supported_vs_currencies`](/reference/simple-supported-currencies)
Coins' IDs, comma-separated if querying more than 1 coin. *refers to [`/coins/list`](/reference/coins-list)
Include 24-hour change percentage. Default: false
Include 24-hour trading volume. Default: false
Include last updated price time as a UNIX timestamp. Default: false
Include market capitalization. Default: false
For `symbols` lookups, specify `all` to include all matching tokens. Default `top` returns top-ranked tokens by market cap or volume.
Coins' names, comma-separated if querying more than 1 coin.
Decimal places for currency price value
Coins' symbols, comma-separated if querying more than 1 coin.
เอาต์พุตพร้อมใช้งาน

เอาต์พุตของคุณจะแสดงที่นี่

กรอกอินพุตให้ครบ แล้วคลิก Run

API README

CoinGecko Coin Price by IDs, Symbols, or Names API

Returns the market value of one or more coins on CoinGecko, quoted in the currencies you choose. You pass vs_currencies plus a coin identifier as ids, symbols, or names. The response is an object keyed by coin ID, with one number per target currency.

Use cases

  • Show the Bitcoin rate in USD on a dashboard or in a chat bot.
  • Convert a portfolio of coins into several fiat currencies with one call by listing multiple ids and vs_currencies.
  • Add 24-hour change, volume, or market cap to a ticker with the include_* flags.
  • Look up a coin by ticker with symbols when you do not know the CoinGecko coin ID.

Request

curl -X POST "https://api.sandbase.ai/v1/api/coingecko/simple-price" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ids": "bitcoin", "vs_currencies": "usd"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
vs_currenciesstringYesTarget currency of coins, comma-separated if querying more than 1 currency. *refers to /simple/supported_vs_currencies
idsstringNoCoins' IDs, comma-separated if querying more than 1 coin. *refers to /coins/list
include_24hr_changebooleanNoInclude 24-hour change percentage. Default: false
include_24hr_volbooleanNoInclude 24-hour trading volume. Default: false
include_last_updated_atbooleanNoInclude last updated price time as a UNIX timestamp. Default: false
include_market_capbooleanNoInclude market capitalization. Default: false
include_tokensstringNoFor symbols lookups, specify all to include all matching tokens. Default top returns top-ranked tokens by market cap or volume.
namesstringNoCoins' names, comma-separated if querying more than 1 coin.
precisionstringNoDecimal places for currency price value
symbolsstringNoCoins' symbols, comma-separated if querying more than 1 coin.

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "bitcoin": {
    "usd": 76688
  }
}

Response fields

FieldMeaning
bitcoinTop-level key. It is the coin ID that was requested. Each requested coin gets its own key.
bitcoin.usdValue of one coin in the target currency. The key name is the currency code from vs_currencies, so other currencies appear as sibling keys.

Notes

Pricing

$0.008 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.

สำรวจเพิ่มเติม

APIs ที่เกี่ยวข้อง

APIs ทั้งหมด
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

คำถาม

คำถามที่พบบ่อย

ฉันจะใช้ CoinGecko Coin Price by IDs, Symbols, or Names API ได้อย่างไร?

ส่งคำขอ POST ไปที่ https://api.sandbase.ai/v1/api/coingecko/simple-price โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน Playground บนหน้านี้โดยไม่ต้องเขียนโค้ด

CoinGecko Coin Price by IDs, Symbols, or Names API ราคาเท่าไร?

$0.008 ต่อครั้ง คิดจากยอดคงเหลือ SandBase ของคุณ คุณจะถูกเรียกเก็บเฉพาะคำขอที่คุณส่งเท่านั้น ไม่มีค่าสมาชิกรายเดือน

CoinGecko Coin Price by IDs, Symbols, or Names API รับพารามิเตอร์อะไรบ้าง?

ที่ต้องระบุ: vs_currencies (string). ตัวเลือก: ids (string), include_24hr_change (boolean), include_24hr_vol (boolean), include_last_updated_at (boolean), include_market_cap (boolean) และ include_tokens (หนึ่งใน top, all) และอีก 3 รายการ ตาราง Parameters และ Playground ในหน้านี้แสดงทุกฟิลด์

CoinGecko Coin Price by IDs, Symbols, or Names API ส่งคืนอะไร?

การตอบกลับ JSON ที่ส่งกลับในคำขอ HTTP เดียวกัน (แบบซิงโครนัส) README บนหน้านี้มีตัวอย่างการตอบกลับ

ฉันจำเป็นต้องมีบัญชีนักพัฒนาหรือ API key ของ CoinGecko ไหม?

ไม่จำเป็น CoinGecko Coin Price by IDs, Symbols, or Names ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง CoinGecko API แยกต่างหาก