Follow our Status Page for real-time updates on system performance and maintenance schedules.
You can also subscribe to receive notifications about any incidents or scheduled maintenance that may affect the API's availability.
For support with the Foxbit API, please visit our Help Center.
Welcome to the official Foxbit's trader and developer documentation! Here, you'll find everything you need to know to integrate and utilize our services effectively. Whether you're a seasoned trader or just starting out, our comprehensive documentation provides clear guidance on how to make the most out of our API.
We also have a full API usage examples repository demonstrating how to integrate and utilize our API, and in Javascript for the WebSocket example: Example Repository
This API provides public channels, accessible through specific URLs:
You can view the full list of available channels for both public subscriptions in the navigation menu.
Ready to get started? Dive into our documentation and unleash the full potential of our Exchange API. Whether you're building trading automation, conducting research, or developing innovative solutions, our API provides the tools you need to succeed.
Happy coding! 🚀
If you don't find something here, you can check our others API's documentation:
The Rate Limit is divided into five topics, these being connection, concurrent connection, subscriptions by message, subscriptions by connections and messages by period.
Note: Rate limits for public connections are controlled by IP Address.
If a channel does not have rate limit information in its documentation, it will use our global rate limit values:
| # | Public |
|---|---|
| Connections per period | 10 connection per 2 seconds |
| Messages per period | 10 messages per 2 seconds |
| Concurrent connections | 30 concurrent connections |
| Subscriptions per message | 25 subscriptions per message |
| Subscriptions per connections | 50 subscriptions per connection |
The Ping channel enables users to verify their connection to the server. When a ping is sent, the server will respond with a "success" event message if the connection is active.
Additionally, the Ping channel can be used to keep the connection alive. If the connection remains idle for too long, the server will close it. Regularly sending pings prevents this from happening. This functionality is available for public connections.
Recommendation: It is recommended to send a ping message every 20 seconds for each open connection to maintain optimal connection health and prevent automatic disconnection due to inactivity.
To send a ping, use the following message format:
| type | string Value: "message" The desired event to be executed | ||
Array of objects An array of channels intended for action execution | |||
Array
| |||
{- "type": "message",
- "params": [
- {
- "channel": "ping"
}
]
}This message will be sent when user was successfully pinged
| type | string The executed event | ||
| event | string The event emitted by the server | ||
object Channel data on which the event was emitted | |||
| |||
object The data returned by the server | |||
| |||
{- "type": "message",
- "event": "success",
- "params": {
- "channel": "ping"
}, - "data": {
- "message": "pong"
}
}Provides a summary data for a market, including the latest traded price, volume, and price changes over 24hr. Users will receive updates every 1000ms until they send an unsubscribe call.
To subscribe or unsubscribe from WebSocket channels, use the following message format: The type field determines the action ("subscribe" or "unsubscribe"), while params specifies the target channels and markets.
| type | string The desired event to be executed Value: "subscribe" | ||||
Array of objects An array of channels intended for action execution | |||||
Array
| |||||
{- "type": "subscribe",
- "params": [
- {
- "channel": "ticker",
- "market_symbol": "btcbrl"
}
]
}This message will be sent when user was successfully subscribed to the channel with specified market data
| type | string The executed event | ||||
| event | string The event emitted by the server | ||||
object Channel data on which the event was emitted | |||||
| |||||
{- "type": "subscribe",
- "event": "success",
- "params": {
- "channel": "ticker",
- "market_symbol": "btcbrl"
}
}This message will be sent when user was successfully unsubscribed from the channel with specified market data
| type | string The executed event | ||||
| event | string The event emitted by the server | ||||
object Channel data on which the event was emitted | |||||
| |||||
{- "type": "unsubscribe",
- "event": "success",
- "params": {
- "channel": "ticker",
- "market_symbol": "btcbrl"
}
}This message will be sent when user sent invalid payload, the connection will be closed automatically when errors occurs
| type | string The executed event |
| event | string The event emitted by the server |
| message | string Subscription error |
{- "type": "subscribe",
- "event": "error",
- "message": "Invalid market 'invalid-market' for channel 'channel'"
}This message will be sent at every market change if user have successfully subscribed
| type | string The executed event | ||||||||
| event | string The event emitted by the server | ||||||||
object Channel data on which the event was emitted | |||||||||
| |||||||||
object Update data emitted by the channel | |||||||||
| |||||||||
{- "type": "subscribe",
- "event": "update",
- "params": {
- "channel": "ticker",
- "market_symbol": "btcbrl"
}, - "data": {
- "best": {
- "bid": "6423.57",
- "ask": "6436.53"
}, - "last_traded": {
- "price": "6423.57",
- "quantity": "0.96183964"
}, - "rolling_24h": {
- "price_change": "-0.4165607307408487",
- "price_change_percent": 10,
- "volume": "4319.63870783",
- "trades_count": 10585,
- "low": "4433",
- "high": "11111",
- "open": "6249.64"
}, - "ts": 1717788720000
}
}Streams the current bid and ask orders in the market, showing price levels and available quantities. Users will receive updates every 1000ms by default, unless a different interval is specified, until they send an unsubscribe call.
Available intervals:
To subscribe or unsubscribe from WebSocket channels, use the following message format: The type field determines the action ("subscribe" or "unsubscribe"), while params specifies the target channels and markets.
| type | string The desired event to be executed Value: "subscribe" | ||||||
Array of objects An array of channels intended for action execution | |||||||
Array
| |||||||
{- "type": "subscribe",
- "params": [
- {
- "channel": "orderbook-1000",
- "market_symbol": "btcbrl",
- "snapshot": true
}
]
}This message will be sent when user was successfully subscribed to the channel with specified market data
| type | string The executed event | ||||
| event | string The event emitted by the server | ||||
object Channel data on which the event was emitted | |||||
| |||||
{- "type": "subscribe",
- "event": "success",
- "params": {
- "channel": "orderbook-1000",
- "market_symbol": "btcbrl"
}
}This message will be sent when user was successfully unsubscribed from the channel with specified market data
| type | string The executed event | ||||
| event | string The event emitted by the server | ||||
object Channel data on which the event was emitted | |||||
| |||||
{- "type": "unsubscribe",
- "event": "success",
- "params": {
- "channel": "orderbook-100",
- "market_symbol": "btcbrl"
}
}This message provides a snapshot of the current orderbook state when you first subscribe to the orderbook channel. The snapshot is essential for initializing your local orderbook copy and serves as the foundation for maintaining an accurate, real-time orderbook in memory.
Depth: The orderbook snapshot returns the top 100 levels for both buy and sell sides.
Purpose and Usage:
sequence_id which is crucial for maintaining data consistency Sequential Processing:
After receiving the snapshot, all subsequent orderbook update events will be sequential and incremental. Each update event includes first_sequence_id and last_sequence_id to ensure you don't miss any orderbook changes and can maintain a perfectly synchronized local copy.
Implementation Strategy:
sequence_id from the snapshotfirst_sequence_id and last_sequence_id to maintain your local orderbookExample Implementation: For a complete example of how to manage the orderbook in memory using JavaScript, check out our sample implementation: JavaScript Orderbook Management Example
| type | string The executed event | ||||||
| event | string The event emitted by the server | ||||||
object Channel data on which the event was emitted | |||||||
| |||||||
object Update data emitted by the channel | |||||||
| |||||||
{- "type": "subscribe",
- "event": "snapshot",
- "params": {
- "channel": "orderbook",
- "market_symbol": "btcbrl"
}, - "data": {
- "sequence_id": 123321,
- "asks": [
- [
- "1000000.00",
- "0.0001"
]
], - "bids": [
- [
- "1000000.00",
- "0.0001"
]
]
}
}This message will be sent when user sent invalid payload, the connection will be closed automatically when errors occurs
| type | string The executed event |
| event | string The event emitted by the server |
| message | string Subscription error |
{- "type": "subscribe",
- "event": "error",
- "message": "Invalid market 'invalid-market' for channel 'channel'"
}This message will be sent at every market change if user have successfully subscribed
| type | string The executed event | ||||||||||
| event | string The event emitted by the server | ||||||||||
object Channel data on which the event was emitted | |||||||||||
| |||||||||||
object Update data emitted by the channel | |||||||||||
| |||||||||||
{- "type": "subscribe",
- "event": "update",
- "params": {
- "channel": "orderbook-100",
- "market_symbol": "btcbrl"
}, - "data": {
- "ts": 1661538954309,
- "first_sequence_id": 1,
- "last_sequence_id": 10,
- "asks": [
- [
- "1000000.00",
- "0.0001"
]
], - "bids": [
- [
- "1000000.00",
- "0.0001"
]
]
}
}Streams aggregated market data over fixed time intervals (e.g., 1m, 5m, 1h), including open, high, low, close prices, and traded volume. Users will receive updates at the end of each interval until they send an unsubscribe call.
Available intervals:
| time | 1m | 5m | 15m | 30m | 1h | 2h | 4h | 6h | 12h | 1d | 1w | 2w |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| seconds | 60 | 300 | 900 | 1800 | 3600 | 7200 | 14400 | 21600 | 43200 | 86400 | 604800 | 1209600 |
To subscribe or unsubscribe from WebSocket channels, use the following message format: The type field determines the action ("subscribe" or "unsubscribe"), while params specifies the target channels and markets.
| type | string The desired event to be executed Value: "subscribe" | ||||
Array of objects An array of channels intended for action execution | |||||
Array
| |||||
{- "type": "subscribe",
- "params": [
- {
- "channel": "candle-60",
- "market_symbol": "btcbrl"
}
]
}This message will be sent when user was successfully subscribed to the channel with specified market data
| type | string The executed event | ||||
| event | string The event emitted by the server | ||||
object Channel data on which the event was emitted | |||||
| |||||
{- "type": "subscribe",
- "event": "success",
- "params": {
- "channel": "candle-60",
- "market_symbol": "btcbrl"
}
}This message will be sent when user was successfully unsubscribed from the channel with specified market data
| type | string The executed event | ||||
| event | string The event emitted by the server | ||||
object Channel data on which the event was emitted | |||||
| |||||
{- "type": "unsubscribe",
- "event": "success",
- "params": {
- "channel": "candle-60",
- "market_symbol": "btcbrl"
}
}This message will be sent when user sent invalid payload, the connection will be closed automatically when errors occurs
| type | string The executed event |
| event | string The event emitted by the server |
| message | string Subscription error |
{- "type": "subscribe",
- "event": "error",
- "message": "Invalid market 'invalid-market' for channel 'channel'"
}This message will be sent at every market change if user have successfully subscribed
| type | string The executed event | ||||||||||||
| event | string The event emitted by the server | ||||||||||||
object Channel data on which the event was emitted | |||||||||||||
| |||||||||||||
Array of objects[ items ] Update data emitted by the channel | |||||||||||||
Array Array
| |||||||||||||
{- "type": "subscribe",
- "event": "update",
- "params": {
- "channel": "candle-60",
- "market_symbol": "btcbrl"
}, - "data": [
- 1685019840000,
- "133294.4051",
- "131389.5942",
- "133294.405",
- "131389.5942",
- "0.0172"
]
}Provides a real-time feed of executed trades, showing each transaction’s price, quantity, timestamp and taker sides. Users will receive updates as trades occur until they send an unsubscribe call.
To subscribe or unsubscribe from WebSocket channels, use the following message format: The type field determines the action ("subscribe" or "unsubscribe"), while params specifies the target channels and markets.
| type | string The desired event to be executed Value: "subscribe" | ||||
Array of objects An array of channels intended for action execution | |||||
Array
| |||||
{- "type": "subscribe",
- "params": [
- {
- "channel": "trades",
- "market_symbol": "btcbrl"
}
]
}This message will be sent when user was successfully subscribed to the channel with specified market data
| type | string The executed event | ||||
| event | string The event emitted by the server | ||||
object Channel data on which the event was emitted | |||||
| |||||
{- "type": "subscribe",
- "event": "success",
- "params": {
- "channel": "trades",
- "market_symbol": "btcbrl"
}
}This message will be sent when user was successfully unsubscribed from the channel with specified market data
| type | string The executed event | ||||
| event | string The event emitted by the server | ||||
object Channel data on which the event was emitted | |||||
| |||||
{- "type": "unsubscribe",
- "event": "success",
- "params": {
- "channel": "trades",
- "market_symbol": "btcbrl"
}
}This message will be sent when user sent invalid payload, the connection will be closed automatically when errors occurs
| type | string The executed event |
| event | string The event emitted by the server |
| message | string Subscription error |
{- "type": "subscribe",
- "event": "error",
- "message": "Invalid market 'invalid-market' for channel 'channel'"
}This message will be sent at every market change if user have successfully subscribed
| type | string The executed event | ||||||||||
| event | string The event emitted by the server | ||||||||||
object Channel data on which the event was emitted | |||||||||||
| |||||||||||
Array of objects Update data emitted by the channel | |||||||||||
Array
| |||||||||||
{- "type": "subscribe",
- "event": "update",
- "params": {
- "channel": "trade",
- "market_symbol": "btcbrl"
}, - "data": [
- {
- "id": 123456789,
- "quantity": "0.0001",
- "price": "100000",
- "taker_side": "BUY",
- "ts": 1629820800000
}
]
}