# Querying

The Querying API is responsible for fetching multiple pages of results sequentially. <br></br> The Querying API supports the following operators:
  - `Equals`
  - `NotEquals`
  - `Gt`
  - `Lt`
  - `Gte`
  - `Lte`
  - `Contains`
  - `StartsWith`
  - `EndsWith`

## Retrieve entities using a query string

 - [POST /api/entities/query](https://api-docs.sitecore.com/ch/querying-api/v2.0/querying/entitiesbyqueryv2.md): Lists entities that match the query in a request body. The query filter supports multiple types, each with specific properties:
#### Composite filter
Combines multiple filters using a logical operator (AND, OR).
- Required - type, operator, children
- Example - {"type": "Composite", "operator": "AND", "children": [...]}
#### Not filter
Negates a child filter.
- Required - type, child
- Example - {"type": "Not", "child": {"type": "Definition", "operator": "Equals", "name": "M.Asset"}}
#### Property filter
Filters entities by a property value.
- Required - type, property, operator, value, data_type, and data_type
- Optional - culture (for localized properties)
- Example - {"type": "Property", "property": "Title", "operator": "Contains", "value": "example"}
#### Relation filter
Filters entities by a relation.
- Required - type, relation
- Optional - parent_id or child_id
- Example - {"type": "Relation", "relation": "FinalLifeCycleStatusToAsset", "parent_id": 543}
#### CreatedBy filter
Filters entities by the user who created them.
- Required - type, user_id
- Example - {"type": "CreatedBy", "user_id": 123}

#### ModifiedBy filter
Filters entities by the user who last modified them.
- Required - type, user_id
- Example - {"type": "ModifiedBy", "user_id": 456}

#### SecuredAncestors filter
Filters entities by their secured ancestor.
- Required - type, ancestor_id
- Example - {"type": "SecuredAncestors", "ancestor_id": 789}
#### ID filter
Filters entities by their ID.
- Required - type, operator, value
- Example - {"type": "Id", "operator": "Equals", "value": 12345}

#### Identifier filter
Filters entities by their identifier.
- Required - type, operator, value
- Example - {"type": "Identifier", "operator": "Equals", "value": "my-unique-identifier"}
#### Definition filter
Filters entities by their entity definition.
- Required - type, operator, name
- Example - {"type": "Definition", "operator": "Equals", "name": "M.Asset"}

#### Modules filter
Filters entities by the modules they belong to.
- Required - type, modules
- Example - {"type": "Modules", "modules": ["M.DAM", "M.PCM"]}

#### CreatedOn filter
Filters entities by their creation date.
- Required - type, operator, value (ISO 8601 format)
- Example - {"type": "CreatedOn", "operator": "GreaterThan", "value": "2024-01-01T00:00:00Z"}

#### ModifiedOn filter
Filters entities by their last modification date.
- Required - type, operator, value (ISO 8601 format)
- Example - {"type": "ModifiedOn", "operator": "LessThan", "value": "2024-12-31T23:59:59Z"}

## Retrieve entities using a scroll-based query

 - [POST /api/entities/scroll](https://api-docs.sitecore.com/ch/querying-api/v2.0/querying/entitiesbyscrollv2.md): Lists entities using a scroll-based query for efficient large result set traversal.

## Retrieve entities using a search query

 - [POST /api/entities/searchAfter](https://api-docs.sitecore.com/ch/querying-api/v2.0/querying/entitiesbysearchafterv2.md): Lists entities that match the criteria. This endpoint supports sorted pagination using the search-after property. {% admonition type="info" name="Note" %}For more information, see query operators, filters, and examples.{% /admonition %}

