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

Was this helpful?