Back to Home

API Documentation

Build powerful trading applications with our comprehensive REST API and WebSocket streams. Fast, reliable, and easy to integrate.

Get API Keys

Generate keys in your account settings

Read Docs

Comprehensive guides and references

Test API

Try endpoints in sandbox mode

Go Live

Deploy your trading bot

Getting Started

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.

Base URLs

Production: https://api.bitpaypro.com
Testnet: https://testnet.bitpaypro.com

API Libraries

Official libraries available for Python, JavaScript/Node.js, Java, Go, PHP, and Ruby. Find them on our GitHub repository.

Authentication

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.

Market Data

Access real-time and historical market data for all trading pairs. These endpoints do not require authentication.

Get Ticker Information

GET /v1/ticker/:symbol

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);
  });

Other Market Data Endpoints

  • GET /v1/orderbook/:symbol - Get order book depth
  • GET /v1/trades/:symbol - Get recent trades
  • GET /v1/klines/:symbol - Get candlestick data
  • GET /v1/symbols - Get all trading pairs

Trading

Place, cancel, and manage orders programmatically. All trading endpoints require authentication.

Place New Order

POST /v1/order

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));

Order Parameters

ParameterTypeRequiredDescription
symbolStringYesTrading pair (e.g., BTCUSDT)
sideStringYesBUY or SELL
typeStringYesMARKET, LIMIT, STOP_LOSS, etc.
quantityDecimalYesOrder quantity
priceDecimalNoRequired for LIMIT orders

Other Trading Endpoints

  • DELETE /v1/order/:orderId - Cancel an order
  • GET /v1/order/:orderId - Query order status
  • GET /v1/orders - Get all open orders
  • GET /v1/orders/history - Get order history

WebSocket Streams

Subscribe to real-time data streams for prices, order book updates, and trade execution. WebSocket connections provide the lowest latency data delivery.

WebSocket URL: wss://stream.bitpaypro.com/ws
// 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);
};

Available Streams

  • :symbol@ticker - 24hr ticker statistics
  • :symbol@trade - Real-time trade data
  • :symbol@depth - Order book depth updates
  • :symbol@kline_:interval - Candlestick data

Rate Limits

To ensure fair usage and system stability, API requests are rate limited. Limits vary based on endpoint type and authentication status.

REST API Limits

  • Public Endpoints: 1200 requests/minute
  • Private Endpoints: 600 requests/minute
  • Order Placement: 300 orders/minute
  • Burst Limit: 20 requests/second

WebSocket Limits

  • Connections: 5 per IP address
  • Subscriptions: 200 per connection
  • Messages: 100 messages/second
  • Reconnect Delay: 5 seconds minimum

Error Codes

The API uses standard HTTP status codes and returns detailed error messages in JSON format.

CodeMeaningDescription
200OKRequest successful
400Bad RequestInvalid parameters or malformed request
401UnauthorizedInvalid or missing API credentials
403ForbiddenAPI key lacks required permissions
429Too Many RequestsRate limit exceeded
500Internal Server ErrorServer error, retry with exponential backoff

Need Help with the API?

Our developer support team is here to help you integrate and optimize your applications.