Hercle
REST
GET/api/v1/price/{pair}/{size}

Get Pair Price

Gets the last pair price based on size.

Auth:Bearer <api_key>
Tags:Pairs

Request

cURL
curl -G https://publicapi.sandbox.hercle.financial/api/v1/price/{pair}/{size} \
  -H "Authorization: Bearer eyJhb..." \
  

Path Parameters

NameTypeRequiredDescription
pairstringYesTrading pair in the format BASE-QUOTE (e.g., BTCUSDT)
Example: BTCUSDT
sizenumberYesTrade size to get the price for
Example: 20

Headers

NameTypeRequiredDescription
AuthorizationstringYesBearer token for authentication

Response

Success Response Schema

FieldTypeDescription
idstringUnique identifier for the price quote
sizenumberTrade size in base asset
pairstringTrading pair (e.g., BTCUSDT)
buyPricenumberCurrent buy price
sellPricenumberCurrent sell price
markPricenumberMark price (mid-market price)
timeStampstringISO 8601 timestamp of the quote

Responses

Calculated trade size

200 application/json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "size": 20,
  "pair": "BTCUSDT",
  "buyPrice": 50000,
  "sellPrice": 49950,
  "markPrice": 49975,
  "timeStamp": "2023-10-05T14:48:00.000Z"
}

API Tester

Test this endpoint directly against the sandbox environment

Get your API key from Hercle Sandbox

Trading pair in the format BASE-QUOTE (e.g., BTCUSDT)

Trade size to get the price for

https://publicapi.sandbox.hercle.financial/api/v1/price/{pair}/{size}