> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/commerce-openapis/data-warehouse/introduction/filtering-parameters.md).

# Filtering Parameters

All endpoints in this API support the following filtering options to customize and refine your queries. Each filter option is designed to provide flexibility and control over the data retrieval process.

#### **1. ID**

The `id` filter allows you to query records based on their unique identifier. The following lookups are available for this filter:

* `gt`: Greater than
* `gte`: Greater than or equal to
* `lt`: Less than
* `lte`: Less than or equal to
* `exact`: Matches the exact ID

***Example Usage:***

* Retrieve records with IDs greater than 100:\
  `?id__gt=100`
* Retrieve records with IDs less than or equal to 50:\
  `?id__lte=50`
* Retrieve records with the exact ID of 123:\
  `?id=123`

#### **2. Modified Date**

The `modified_date` filter allows you to query records based on the timestamp of their last modification. The following lookups are supported:

* `gt`: Modified after the specified date and time
* `gte`: Modified on or after the specified date and time
* `lt`: Modified before the specified date and time
* `lte`: Modified on or before the specified date and time

***Example Usage:***

* Retrieve records modified after January 10, 2025:\
  `?modified_date__gt=2025-01-10`
* Retrieve records modified on or before January 9, 2025:\
  `?modified_date__lte=2025-01-09`

**Note:** Dates and times must be provided in ISO 8601 format: `YYYY-MM-DD`.

#### **3. Sort**

The `sort` parameter is used to order the results of a query based on one or more fields. By default, sorting is in ascending order. Use a hyphen (`-`) before a field to sort in descending order.

***Example Usage:***

* Sort records by `id` in ascending order:\
  `?sort=id`
* Sort records by `modified_date` in descending order:\
  `?sort=-modified_date`

#### **4. Page**

The `page` parameter is used for pagination to retrieve a specific subset of records.

***Example Usage:***

* Retrieve the second page of results: `?page=2`

**Example Query Combining Filters**

Retrieve records with the following criteria:

* IDs greater than 100
* Modified on or after January 10, 2025
* Sorted by `modified_date` in descending order
* Display the first page of results

***Example:***

`?id__gt=100&modified_date__gte=2025-01-10&sort=-modified_date&page=1`


---

# 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://apidocs.akinon.com/commerce-openapis/data-warehouse/introduction/filtering-parameters.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.
