> For the complete documentation index, see [llms.txt](https://docs.sfox.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sfox.com/rest-api/orders/get-all-open-orders.md).

# Get All Open Orders

<mark style="color:green;">**`GET`**</mark> `https://api.sfox.com/v1/orders`

Retrieve a list of all orders currently open in your account.

{% hint style="info" %}
[**Rate Limit**](/rest-api/rate-limits.md)**: 10 requests per 10 seconds**

sFOX recommends using the [**Orders WebSocket feed**](/websocket-api/orders-and-account-data/orders.md) instead, which streams order updates in real-time and does not count towards your request limit.
{% endhint %}

### Query Paramaters

<table><thead><tr><th width="211">Parameter</th><th width="133">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>limit</code></strong></td><td>int</td><td>Limit on the number of results to return. Default and maximum = <code>50</code>. Each response will include no more than 50 results.</td></tr><tr><td><strong><code>before</code></strong></td><td>int</td><td>Pagination parameter. Return results that occurred before (older) than the specified ID (<code>id</code> from response body).</td></tr><tr><td><strong><code>after</code></strong></td><td>int</td><td>Pagination parameter. Return results that occurred after (newer) than the specified ID (<code>id</code> from response body).</td></tr><tr><td><strong><code>action</code></strong></td><td>string</td><td>Filter response to only include orders with the specified action/side. Possible values: <code>buy</code> or <code>sell</code> (case sensitive).</td></tr><tr><td><strong><code>currency_pair</code></strong></td><td>string</td><td>Filter response to only include orders on the specified currency pair (<code>pair</code> from response body). Format: <code>&#x3C;basequote></code> e.g. <code>btcusd</code>.</td></tr><tr><td><strong><code>algorithm_id</code></strong></td><td>int</td><td>Filter response to only include orders with the specified <code>algorithm_id</code>/order type. Possible values: <a href="/pages/-MksB3OWKUp0-RnwDoxN">Order Types</a>.</td></tr><tr><td><strong><code>status</code></strong></td><td>string</td><td>Filter response to only include orders with the specified order status (<code>status</code> from response body). Possible values: <a href="/pages/-Mkd5fv0VwgWbHGXHO7z">Order Statuses</a> (case sensitive).</td></tr></tbody></table>

### Responses

<details>

<summary><mark style="color:green;">200</mark></summary>

```json
[
    {
        "id": 2008562,
        "side_id": 500,
        "action": "Buy",
        "algorithm_id": 201,
        "algorithm": "Limit",
        "type": "Limit",
        "pair": "ethusd",
        "quantity": 2.5,
        "price": 1750,
        "amount": 0,
        "net_market_amount": 0,
        "filled": 0,
        "vwap": 0,
        "filled_amount": 0,
        "fees": 0,
        "net_proceeds": 0,
        "status": "Started",
        "status_code": 100,
        "routing_option": "WeightedExchange",
        "routing_type": "NetPrice",
        "time_in_force": "GTC",
        "expires": null,
        "dateupdated": "2023-11-08T20:12:19.000Z",
        "date_added": "2022-11-07T20:52:40.000Z",
        "client_order_id": "d317e96a-0c26-4dc1-a4eb-b82b0e2a643c",
        "user_tx_id": "d317e96a-0c26-4dc1-a4eb-b82b0e2a643c",
        "o_action": "Buy",
        "algo_id": 201,
        "algorithm_options": null,
        "destination": ""
    },
    {
        "id": 2008561,
        "side_id": 600,
        "action": "Sell",
        "algorithm_id": 201,
        "algorithm": "Limit",
        "type": "Limit",
        "pair": "btcusd",
        "quantity": 1,
        "price": 38000,
        "amount": 0,
        "net_market_amount": 0,
        "filled": 0,
        "vwap": 0,
        "filled_amount": 0,
        "fees": 0,
        "net_proceeds": 0,
        "status": "Started",
        "status_code": 100,
        "routing_option": "WeightedExchange",
        "routing_type": "NetPrice",
        "time_in_force": "GTC",
        "expires": null,
        "dateupdated": "2023-11-08T20:11:58.000Z",
        "date_added": "2022-11-07T20:52:40.000Z",
        "client_order_id": "e6f9b6f3-5f01-444d-a83d-640dd67573ae",
        "user_tx_id": "e6f9b6f3-5f01-444d-a83d-640dd67573ae",
        "o_action": "Sell",
        "algo_id": 201,
        "algorithm_options": null,
        "destination": ""
    }
]
```

</details>

### Example Requests

{% tabs %}
{% tab title="Shell" %}

```bash
curl -H 'Authorization: Bearer <API_TOKEN>' \
  'https://api.sfox.com/v1/orders'
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const axios = require('axios');

axios({
  method: 'get',
  url: 'https://api.sfox.com/v1/orders',
  headers: {
    'Authorization': 'Bearer <API_KEY>'
  }
}).then(response => {
  console.log(response)
}).catch(err => {
  console.error(err)
});
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

data = requests.get(
  "https://api.sfox.com/v1/orders",
  headers={
    "Authorization": "Bearer <API_KEY>",
  }
)
print(data)
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.sfox.com/rest-api/orders/get-all-open-orders.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
