Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
804 views
in Technique[技术] by (71.8m points)

java - How to use Binance API, simple GET price by ticker

I would like to get only one pair from the response. And I can't really understand how I should pass my parameter.

Instructions say:

Symbol price ticker

GET /api/v3/ticker/price

Latest price for a symbol or symbols.

Weight: 1 for a single symbol; 2 when the symbol parameter is omitted

Parameters:

Name Type Mandatory Description

symbol STRING NO -

If the symbol is not sent, prices for all symbols will be returned in an array."

I'm able to get all symbols in the response body, but can't get a single one. I have already tried (in Postman) these endpoints:

  1. https://api.binance.com/api/v3/ticker/price/btcusdt
  2. https://api.binance.com/api/v3/ticker/price/symbol=btcusdt
  3. https://api.binance.com/api/v3/ticker/price/?symbol=btcusdt

Here is the link to entire API: https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md#24hr-ticker-price-change-statistics

So, which endpoint is correct? postman result

question from:https://stackoverflow.com/questions/65864645/how-to-use-binance-api-simple-get-price-by-ticker

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...