Build powerful trading applications with our comprehensive REST API and WebSocket streams. Fast, reliable, and easy to integrate.
Generate keys in your account settings
Comprehensive guides and references
Try endpoints in sandbox mode
Deploy your trading bot
The BitPayPro API allows you to integrate our cryptocurrency exchange functionality into your own applications. Our REST API provides endpoints for trading, account management, and market data, while our WebSocket streams deliver real-time price updates and order book data.
Official libraries available for Python, JavaScript/Node.js, Java, Go, PHP, and Ruby. Find them on our GitHub repository.
API requests are authenticated using API keys. You can generate API keys from your account dashboard. Each request must include your API key and secret in the headers.
// Authentication Example
const API_KEY = 'your_api_key';
const API_SECRET = 'your_api_secret';
const headers = {
'X-API-KEY': API_KEY,
'X-API-SECRET': API_SECRET,
'Content-Type': 'application/json'
};
fetch('https://api.bitpaypro.com/v1/account', {
method: 'GET',
headers: headers
})
.then(response => response.json())
.then(data => console.log(data));Security Note: Never share your API secret or commit it to version control. Store credentials securely using environment variables.
Access real-time and historical market data for all trading pairs. These endpoints do not require authentication.
Returns 24-hour price statistics for a trading pair.
// Get Market Data
fetch('https://api.bitpaypro.com/v1/ticker/BTCUSDT')
.then(response => response.json())
.then(data => {
console.log('Price:', data.lastPrice);
console.log('24h Change:', data.priceChangePercent);
});Place, cancel, and manage orders programmatically. All trading endpoints require authentication.
Create a new order (market, limit, stop-loss, etc.).
// Place a Limit Order
const orderData = {
symbol: 'BTCUSDT',
side: 'BUY',
type: 'LIMIT',
quantity: 0.001,
price: 45000,
timeInForce: 'GTC'
};
fetch('https://api.bitpaypro.com/v1/order', {
method: 'POST',
headers: headers,
body: JSON.stringify(orderData)
})
.then(response => response.json())
.then(data => console.log('Order placed:', data));| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | String | Yes | Trading pair (e.g., BTCUSDT) |
| side | String | Yes | BUY or SELL |
| type | String | Yes | MARKET, LIMIT, STOP_LOSS, etc. |
| quantity | Decimal | Yes | Order quantity |
| price | Decimal | No | Required for LIMIT orders |
Subscribe to real-time data streams for prices, order book updates, and trade execution. WebSocket connections provide the lowest latency data delivery.
// WebSocket Real-time Data
const ws = new WebSocket('wss://stream.bitpaypro.com/ws');
ws.onopen = () => {
// Subscribe to BTC/USDT ticker
ws.send(JSON.stringify({
method: 'SUBSCRIBE',
params: ['btcusdt@ticker'],
id: 1
}));
};
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log('Price update:', data);
};To ensure fair usage and system stability, API requests are rate limited. Limits vary based on endpoint type and authentication status.
The API uses standard HTTP status codes and returns detailed error messages in JSON format.
| Code | Meaning | Description |
|---|---|---|
| 200 | OK | Request successful |
| 400 | Bad Request | Invalid parameters or malformed request |
| 401 | Unauthorized | Invalid or missing API credentials |
| 403 | Forbidden | API key lacks required permissions |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Server error, retry with exponential backoff |
Our developer support team is here to help you integrate and optimize your applications.