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
| Name | Type | Required | Description |
|---|---|---|---|
| pair | string | Yes | Trading pair in the format BASEQUOTE (e.g., BTCUSDT) Example: BTCUSDT |
| side | string | Yes | Trade side, either "buy" or "sell" Example: buy |
| amount | number | Yes | Amount in quote currency to calculate the trade size for Example: 10000 |
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer token for authentication |
Response
Success Response Schema
Calculated trade size
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the price quote |
pair | string | Trading pair (e.g., BTCUSDT) |
price | number | Current price for the pair |
size | number | Calculated trade size in base asset |
timeStamp | string | ISO 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}