I am trying to get all tickers (currency pairs) with their corresponding Bid and Ask price data in one single JSON payload response from the Coinbase REST API. If I have GET request for each individual ticker symbol, I will have to avoid getting a 729 error as mentioned in the Coinbase API documentation.
I have a GET request to this URL -> https://api-public.sandbox.pro.coinbase.com/products/BTC-USD/book
Which returns the data I need for BTC-USD, but actually I am interested in all of tickers listed on the exchange with their corresponding Bid and Ask price data in one single query.
For exmaple, many other exchanges replace the currency code acronym with "ALL." So my JSON payload response would look something like the following:
I have tried setting a timer function to parse individual tickers 3 seconds at a time but that is not the fastest way to get all the data I need from the JSON.
JSON response should look something like this:
{
"ticker": [
{
"symbol": "ABBCBTC",
"24hrHigh": "0.00000850",
"last": "0.00000842",
"24hrVol": "1507399.04",
"ask": "0.0000084",
"24hrLow": "0.00000813",
"bid": "0.00000833",
"24hrAmt": "12.52040928"
},
{
"symbol": "ABTETH",
"24hrHigh": "0.001078",
"last": "0.001078",
"24hrVol": "5.27",
"ask": "0.001988",
"24hrLow": "0.000964",
"bid": "0.000983",
"24hrAmt": "0.005681"
},
{
"symbol": "ABTUSDT",
"24hrHigh": "0.212",
"last": "0.202",
"24hrVol": "944.91",
"ask": "0.203",
"24hrLow": "0.190",
"bid": "0.197",
"24hrAmt": "183.148"
},
{
"symbol": "ABYSSETH",
"24hrHigh": "0.0000500",
"last": "0.0000500",
"24hrVol": "0",
"ask": "0.000055",
"24hrLow": "0.0000500",
"bid": "0.0000301",
"24hrAmt": "0.0000000"
},
{
"symbol": "ACDCBTC",
"24hrHigh": "0.000000011",
"last": "0.000000010",
"24hrVol": "86773.47",
"ask": "0.00000001",
"24hrLow": "0.000000009",
"bid": "0.000000009",
"24hrAmt": "0.000858894"
},
{
"symbol": "ACDCUSDT",
"24hrHigh": "0.000110",
"last": "0.000107",
"24hrVol": "24011.63",
"ask": "0.000107",
"24hrLow": "0.000085",
"bid": "0.000087",
"24hrAmt": "2.088214"
},
{
"symbol": "ADDETH",
"24hrHigh": "0.000046",
"last": "0.000046",
"24hrVol": "0",
"ask": "0.000062",
"24hrLow": "0.000046",
"bid": "--",
"24hrAmt": "0.000000"
},
{
"symbol": "ADIETH",
"24hrHigh": "0.00000310",
"last": "0.00000310",
"24hrVol": "0",
"ask": "0.00000744",
"24hrLow": "0.00000310",
"bid": "0.0000031",
"24hrAmt": "0.00000000"
},
{
"symbol": "ADNBTC",
"24hrHigh": "0.0000000378",
"last": "0.0000000375",
"24hrVol": "551104713.07",
"ask": "0.0000000379",
"24hrLow": "0.0000000366",
"bid": "0.0000000367",
"24hrAmt": "20.4085431339"
}
]
}