# Get Prices in Graphql

<span style="white-space: pre-wrap;">This query returns price history rows for </span>**one instrument**<span style="white-space: pre-wrap;"> (by </span>`<span class="editor-theme-code">user_code</span>`).

[![Screenshot 2025-12-16 at 17.49.19.png](https://docs.finmars.com/uploads/images/gallery/2025-12/scaled-1680-/screenshot-2025-12-16-at-17-49-19.png)](https://docs.finmars.com/uploads/images/gallery/2025-12/screenshot-2025-12-16-at-17-49-19.png)

---

### GraphQL Query

```graphql
query GetPriceHistoryList {
  price_history(
    pagination: {
      limit: 20
      offset: 0
    }
    filters: {
      instrument: {
        user_code: {
          exact: "XS2200244072"
        }
      }
      pricing_policy: {
        user_code:{
          exact: "com.finmars.standard-pricing:standard"
        }
      }
    }
  ) {
    id
    date
    principal_price
    instrument {
      id
      user_code
      name
    }
    pricing_policy {
      id
      user_code
    }
  }
}
```

---

## Filter Highlights

### Filter by Related Object Field

```graphql
filters: {
  instrument: {
    user_code: { exact: "XS2200244072" }
  }
}
```

- `<span class="editor-theme-code">instrument</span>`<span style="white-space: pre-wrap;"> is a related object.</span>
- You can filter it by its fields.
- `<span class="editor-theme-code">exact</span>`<span style="white-space: pre-wrap;"> means strict match.</span>

---

### <span style="white-space: pre-wrap;">Why Use </span>`<span class="editor-theme-code">user_code</span>`

- Stable identifier for business use.
- <span style="white-space: pre-wrap;">No need to know internal </span>`<span class="editor-theme-code">id</span>`.

---

### Notes

- Add a date filter if you want one day only:

```graphql
date: { exact: "2023-12-01" }
```

- Pagination stays the same for list queries.