Skip to main content

OData Querying

This framework implements OData V4 query syntax, allowing you to filter, sort, paginate, and shape your API responses using standardized query parameters.

Supported Query Options

OptionDescriptionExample
$selectChoose which fields to return$select=id,name,email
$filterFilter results based on conditions$filter=age gt 18
$orderbySort results$orderby=name asc
$expandInclude related entities$expand=orders
$topLimit number of results$top=10
$skipSkip a number of results$skip=20
$countInclude total count in response$count=true

Quick Examples

Select Specific Fields

GET /users?$select=id,name,email

Returns only the specified fields. Learn more →

Filter Results

GET /users?$filter=age gt 18 and status eq 'active'

Returns users older than 18 with active status. Learn more →

Sort Results

GET /products?$orderby=price desc,name asc

Sorts by price descending, then by name ascending. Learn more →

GET /orders?$expand=customer,items

Returns orders with customer and items data included. Learn more →

Pagination

GET /products?$top=20&$skip=40&$count=true

Returns 20 products starting from the 41st, with total count. Learn more →

Combining Query Options

Query options can be combined to create powerful queries:

GET /products?$select=id,name,price&$filter=price gt 50 and inStock eq true&$orderby=price asc&$top=10&$expand=category($select=name)

This query:

  1. Selects only id, name, and price fields
  2. Filters products with price > 50 that are in stock
  3. Sorts by price ascending
  4. Limits to 10 results
  5. Includes category name

Detailed Documentation