Hercle
REST
GET/api/v1/pairs/{pair}/{side}/{amount}

Get Pair Size by Amount

Calculate the size of a trade for a given amount and trading pair.

Auth:Bearer <api_key>
Tags:Pairs

Request

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

Path Parameters

NameTypeRequiredDescription
pairstringYesTrading pair in the format BASEQUOTE (e.g., BTCUSDT)
Example: BTCUSDT
sidestringYesTrade side, either "buy" or "sell"
Example: buy
amountnumberYesAmount in quote currency to calculate the trade size for
Example: 10000

Headers

NameTypeRequiredDescription
AuthorizationstringYesBearer token for authentication

Response

Success Response Schema

FieldTypeDescription
idstringUnique identifier for the price quote
pairstringTrading pair (e.g., BTCUSDT)
pricenumberCurrent price for the pair
sizenumberCalculated trade size in base asset
timeStampstringISO 8601 timestamp of the quote

Responses

Calculated trade size

200 application/json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "pair": "BTCUSDT",
  "price": 50000,
  "size": 0.2,
  "timeStamp": "2024-01-01T12:00:00Z"
}

API Tester

Test this endpoint directly against the sandbox environment

Get your API key from Hercle Sandbox

Trading pair in the format BASEQUOTE (e.g., BTCUSDT)

Trade side, either "buy" or "sell"

Amount in quote currency to calculate the trade size for

https://publicapi.sandbox.hercle.financial/api/v1/pairs/{pair}/{side}/{amount}