The Polyhush REST API provides direct access to trading functionality. Use these endpoints when building custom integrations or when the SDK doesn’t fit your needs.
For most use cases, we recommend using the Python SDK which provides a simpler interface with built-in error handling.
Base URL
Authentication
All API requests require authentication via the X-API-Key header:
curl -H "X-API-Key: your-api-key" \
https://api.polyhush.com/api/v1/trading/balance
Never expose your API key in client-side code or public repositories.
Try It Out
Each endpoint in this reference includes an interactive “Try It” section. To use it:
Click the “Authorization” button in the top right
Enter your API key
Click “Try It” on any endpoint to make a live request
Endpoints
Balance & Positions
Method Endpoint Description GET /api/v1/trading/balanceGet USDC balance GET /api/v1/trading/positionsGet current positions
Orders
Market Data
Method Endpoint Description GET /api/v1/markets/token/{token_id}/tickerGet price ticker
All POST requests should use JSON:
curl -X POST https://api.polyhush.com/api/v1/trading/orders \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"token_id": "12345678901234567890",
"side": "BUY",
"shares": 100,
"price": 0.55,
"order_type": "GTC"
}'
Success Response (Order Example)
{
"success" : true ,
"orderID" : "ord_abc123" ,
"status" : "live" ,
"takingAmount" : "0" ,
"makingAmount" : "55.00" ,
"transactionsHashes" : []
}
Error Response
{
"detail" : "Insufficient balance"
}
HTTP Status Codes
Code Description 200Success 400Bad Request - Invalid parameters 401Unauthorized - Invalid API key 403Forbidden - Action not permitted 404Not Found - Resource doesn’t exist 422Validation Error - Invalid input data 429Rate Limited - Too many requests 500Server Error - Internal error
Rate Limits
Endpoint Type Rate Limit Read operations 100 requests/minute Write operations 30 requests/minute Order placement 10 orders/second
When rate limited, you’ll receive a 429 response. Implement exponential backoff for retries.
SDK vs API
Use the SDK when...
Building Python applications
You want simpler error handling
You prefer a Pythonic interface
Use the API when...
Building in other languages
You need maximum control
Integrating with existing systems