# FAQs

<details>

<summary>What APIs does Backpack support?</summary>

Backpack offers two ways to integrate, depending on whether you need request/response actions or real-time streaming data.

#### REST API

Use the REST API for on-demand actions like fetching market/account data and managing orders.

Common endpoints include:

* GET /markets
* GET /balances
* POST /orders
* DELETE /orders

#### WebSocket API

Use the WebSocket API for low-latency, real-time streams

Common use cases include:

* Subscribing to order book updates
* Subscribing to candlestick (kline) streams
* Subscribing to authenticated account events (e.g., order and position updates)

</details>

<details>

<summary>Can the API be used for futures trading?</summary>

Yes. Backpack supports both spot and perpetual futures through the same order and account endpoints. To trade perps, use a perp market symbol\
\
For example:\
POST /orders - SOL\_USDC\_PERP

</details>

<details>

<summary>Can I withdraw assets using the API?</summary>

To enable withdrawals, strict security controls are required (including two-factor authentication).

To configure a withdrawal address with mandatory 2FA, **please use:**\
<https://backpack.exchange/settings/withdrawal-addresses?twoFactorWithdrawalAddress=true>

**twoFactorToken parameter** (<https://docs.backpack.exchange/#tag/Capital/operation/request\\_withdrawal:\\~:text=asset%20to%20withdraw.-,twoFactorToken,-string)is> currently disabled

</details>

<details>

<summary>What are the API rate limits? Are they different per server or per subaccount?</summary>

Rate limits are applied per subaccount, not per server. By default, each subaccount can make up to 2000 requests per minute across standard REST endpoints\
\
Historical market data endpoints are limited at 30 requests per minute per subaccount. (“Historical endpoints” refers to REST routes that return time-range data such as candles/trades.)

If you hit a limit, you’ll receive HTTP 429 responses. Consider using WebSocket streams for high-frequency market data.

</details>

<details>

<summary>What are the common errors when placing orders?</summary>

<table data-header-hidden><thead><tr><th width="256.142333984375"></th><th></th><th></th></tr></thead><tbody><tr><td>Error Code</td><td>Description</td><td>Resolution</td></tr><tr><td>INVALID_CLIENT_REQUEST'</td><td>Invalid signature</td><td>Verify query string construction method (sorting, instruction value). Also verify that your boolean values in query string  are lowercase. “True” should be “true”.</td></tr><tr><td>INVALID_CLIENT_REQUEST'</td><td>Request has expired</td><td>Time that took request to reach exchange servers exceeded X-Window and window value. Try to increase the window</td></tr><tr><td>INVALID_CLIENT_REQUEST'</td><td>Quantity decimal too long</td><td>Adjust quantity to stepSize</td></tr><tr><td>INVALID_CLIENT_REQUEST'</td><td>Invalid X-Signature Header</td><td>Query string was signed with wrong keypair<br>Verify that you use ED25519</td></tr><tr><td>429</td><td>Too many requests</td><td>Reduce request frequency; consider WebSocket streaming</td></tr></tbody></table>

</details>

<details>

<summary>Where can I find SDKs?</summary>

The official SDK is currently available only in Rust: <https://github.com/backpack-exchange/bpx-api-client>\
\
Please refer to the following page for community-maintained examples in various languages:\
<https://support.backpack.exchange/exchange/api-and-developer-docs/api-clients>

</details>

<details>

<summary>How can I get real-time market data for a trading pair?</summary>

Use WebSocket streams for live market updates:

[Book Ticker](https://docs.backpack.exchange/#tag/Streams/Public/Book-ticker) (bookTicker.\<symbol>)\
Best bid/ask prices and quantities in real time. Ideal for top-of-book displays.

[Depth](https://docs.backpack.exchange/#tag/Streams/Public/Depth) (depth.\<symbol>)\
Incremental order-book updates. Start by fetching an initial snapshot via REST, then apply depth deltas from the stream. Depth is available in real-time or aggregated modes (e.g., 200ms / 600ms / 1000ms) to reduce traffic.\
\
See the full list of streams here: [https://docs.backpack.exchange/#tag/Streams](https://docs.backpack.exchange/#tag/Streamshttps://docs.backpack.exchange/#tag/Streams)

</details>

<details>

<summary>How can I improve the stability of my trading bot?</summary>

Recommended best practices:

* Prefer WebSocket subscriptions for real-time order/trade updates instead of polling REST
* Implement retry + exponential backoff for REST requests and WS reconnects
* Keep a local cache of frequently used reference data (markets, symbols, filters) and refresh periodically
* Monitor and alert on critical API errors (auth failures, expired requests, and 429 rate limits)

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.backpack.exchange/exchange/api-and-developer-docs/faqs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
