> For the complete documentation index, see [llms.txt](https://docs.openalgo.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.openalgo.in/api-documentation/v1/data-api/depth.md).

# Depth

## Endpoint URL

This API Function get Market Depth from the Broker

```http
Local Host   :  POST http://127.0.0.1:5000/api/v1/depth
Ngrok Domain :  POST https://<your-ngrok-domain>.ngrok-free.app/api/v1/depth
Custom Domain:  POST https://<your-custom-domain>/api/v1/depth
```

## Sample API Request

```json
{
    "apikey": "<your_app_apikey>",
    "symbol": "NIFTY31JUL25FUT",
    "exchange": "NFO"
}

```

###

## Sample API Response

```json
{
  "data": {
    "asks": [
      {
        "price": 25741.1,
        "quantity": 3675
      },
      {
        "price": 25744.9,
        "quantity": 150
      },
      {
        "price": 25745,
        "quantity": 600
      },
      {
        "price": 25745.1,
        "quantity": 75
      },
      {
        "price": 25745.2,
        "quantity": 150
      }
    ],
    "bids": [
      {
        "price": 25741,
        "quantity": 150
      },
      {
        "price": 25740,
        "quantity": 375
      },
      {
        "price": 25739.9,
        "quantity": 600
      },
      {
        "price": 25739.8,
        "quantity": 150
      },
      {
        "price": 25739.7,
        "quantity": 75
      }
    ],
    "high": 25772.3,
    "low": 25635,
    "ltp": 25741.1,
    "ltq": 1050,
    "oi": 15056100,
    "open": 25695,
    "prev_close": 25615,
    "totalbuyqty": 789825,
    "totalsellqty": 386175,
    "volume": 3561150
  },
  "status": "success"
}
```

## Request Body

| Parameters | Description    | Mandatory/Optional | Default Value |
| ---------- | -------------- | ------------------ | ------------- |
| apikey     | App API key    | Mandatory          | -             |
| symbol     | Trading symbol | Mandatory          | -             |
| exchange   | Exchange code  | Mandatory          | -             |

## Response Fields

| Field        | Type   | Description                  |
| ------------ | ------ | ---------------------------- |
| asks         | array  | List of 5 best ask prices    |
| bids         | array  | List of 5 best bid prices    |
| totalbuyqty  | number | Total buy quantity           |
| totalsellqty | number | Total sell quantity          |
| high         | number | Day's high price             |
| low          | number | Day's low price              |
| ltp          | number | Last traded price            |
| ltq          | number | Last traded quantity         |
| open         | number | Opening price                |
| prev\_close  | number | Previous day's closing price |
| volume       | number | Total traded volume          |
| oi           | number | Open interest                |


---

# 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.openalgo.in/api-documentation/v1/data-api/depth.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.
