Welcome to the official documentation for the Foxbit Invest Trading API, your gateway to seamless cryptocurrency trading automation. Designed specifically for clients of the Foxbit Invest platform, our API empowers users to execute buy and sell orders for cryptocurrencies programmatically, enabling the creation of sophisticated trading bots and automation of investment strategies.
The Foxbit Invest Trading API is a powerful tool designed to streamline cryptocurrency trading activities for our platform users. With real-time access to buy and sell orders, updated cryptocurrency quotes, transaction history, and account balance information, users can efficiently manage their portfolios and react swiftly to market changes.
This documentation is aimed at clients of the Foxbit Invest platform who wish to integrate automated cryptocurrency trading into their systems. Whether you're an experienced developer or new to algorithmic trading, our API provides the flexibility and functionality you need to execute transactions programmatically and optimize your trading strategies.
Our API operates on a RESTful architecture, utilizing JSON for data exchange, ensuring compatibility and ease of integration with a wide range of programming languages and platforms. Authentication mechanisms ensure secure access to the API, protecting user data and transactions.
By default, the API enforces a rate limit of 150 requests per 10 seconds. However, some endpoints may have customized rate limits, which will be specified in the documentation for each endpoint.
Authentication is required for accessing certain endpoints of the Foxbit Invest Trading API to ensure secure interactions and protect user data. To authenticate API requests, users need to include specific parameters in the request headers.
x-access-key
: This parameter should contain the API Key generated within the Foxbit Invest platform. The API Key uniquely identifies the user and grants access to the API.
x-access-signature
: The signature is generated using the Secret Key, along with the HTTP method, request path, query parameters (if any), and request body data. This ensures the integrity and authenticity of the request. The signature must be created using HMAC-SHA256 algorithm.
x-access-timestamp
: The timestamp (in milliseconds) indicates when the signature was generated. This parameter helps prevent replay attacks by ensuring that each request is made within a valid timeframe.
function sign(method, path, params, body) {
let queryString = '';
if (params) {
queryString = Object.keys(params).map((key) => {
return `${key}=${encodeURIComponent(params[key])}`;
}).join('&');
}
let rawBody = '';
if (body) {
rawBody = JSON.stringify(body);
}
const timestamp = Date.now();
const preHash = `${timestamp}${method}${path}${queryString}${rawBody}`;
console.debug('PreHash:', preHash);
const signature = CryptoJS.HmacSHA256(preHash, process.env.FOXBIT_INVEST_API_SECRET).toString();
console.debug('Signature:', signature);
return { signature, timestamp };
}
Note: Ensure that you keep your Secret Key secure and never expose it publicly. The generated signature and timestamp must be included in the request headers when accessing authenticated endpoints.
This authentication mechanism ensures secure access to the Foxbit Invest Trading API and helps protect user data and transactions. If you have any questions or encounter any issues regarding authentication, please refer to the documentation or contact our support team for assistance.
The Foxbit Invest Trading API implements a rate limiting policy to ensure fair usage and maintain system stability. This policy applies to all API endpoints by default.
By default, users are allowed a maximum of 150 requests every 10 seconds. If a user exceeds this limit, further requests will be blocked until the next 10-second window begins.
Some endpoints may have specific rate limits tailored to their functionality. If an endpoint has a customized rate limit, it will be clearly specified in the documentation for that endpoint. In case a user exceeds the rate limit for a specific endpoint, they will be temporarily blocked from making further requests for the duration specified by that endpoint's rate limit.
If a user surpasses the rate limit, they will receive a response with a status code indicating that they have exceeded the rate limit.
Suppose an endpoint has a rate limit of 5 requests per 2 seconds. If a user exceeds this limit, they will be blocked from making further requests for a period of 2 seconds, after which they can resume making requests.
Note: It's important for users to monitor their API usage and ensure compliance with rate limiting policies to avoid disruptions in service.
List available OTC Markets.
Rate Limit: This endpoint has the limit of 1 requests
per second
{- "data": {
- "symbol": "btcbrl",
- "name": "BTC/BRL",
- "min_volume": "0.001",
- "max_volume": "100",
- "base": {
- "precision": 8,
- "symbol": "btc"
}, - "quote": {
- "precision": 8,
- "symbol": "brl"
}
}
}
Request a quotation with best price available
Rate Limit: This endpoint has the limit of 3 requests
per 10 seconds
market_symbol required | string The market symbol of the order to be created |
side required | string Enum: "BUY" "SELL" The side of the operation that you will place the order |
quantity required | string The quantity of the base currency you want to buy or sell, expressed in string format |
{- "market_symbol": "btcbrl",
- "side": "BUY",
- "quantity": "0.42"
}
{- "rfq_id": "faebd8ec-a70f-4193-bea3-543353b7c84c",
- "market_symbol": "btcbrl",
- "side": "BUY",
- "quantity": "0.145",
- "price": "178195.13",
- "valid_until": "2024-01-01T00:00:00.000Z"
}
Execute a quotation previously requested
Rate Limit: This endpoint has the limit of 5 requests
per 10 seconds
client_order_id | string Client self managed order id |
rfq_id required | string Generated quote id |
{- "client_order_id": "123456",
- "rfq_id": "faebd8ec-a70f-4193-bea3-543353b7c84c"
}
{- "rfq_id": "faebd8ec-a70f-4193-bea3-543353b7c84c",
- "client_order_id": "123456",
- "market_symbol": "btcbrl",
- "price": "1890.40",
- "quantity": "0.001",
- "side": "BUY",
- "status": "CREATED",
- "created_at": "2024-01-01T00:00:00.000Z"
}
Get the history of executed RFQs
Rate Limit: This endpoint has the limit of 5 requests
per 2 seconds
page required | number >= 1 Default: 1 Example: page=1 Page number |
limit required | number [ 1 .. 20 ] Default: 10 Example: limit=10 Number of items per page |
{- "data": [
- {
- "rfq_id": "722e13aa-c5af-4313-8068-2b94c7ae6b16 ",
- "client_order_id": "77209d9d-7419-43b9-ae56-6b7c75fb4cf7",
- "price": "318249.73",
- "quantity": "0.5",
- "status": "CREATED",
- "error_message": "The order could not be executed at this price",
- "side": "BUY",
- "created_at": "2023-08-02T14:00:00Z",
- "market_symbol": "BTCBRL"
}
], - "total": 89
}