Setting the file. One moment.
Subchapter 3.5
references/content-delivery/querying.mdMarkdown7 KBView on GitHub
Comprehensive guide to querying entries and assets via the Content Delivery API.
curl "https://cdn.contentful.com/spaces/{space_id}/environments/master/entries?content_type=blogPost" \
-H "Authorization: Bearer {cda_token}"Always specify content_type when querying by field — it’s required for field-based filters and improves performance.
# Page 1
curl "https://cdn.contentful.com/spaces/{space_id}/environments/master/entries?content_type=blogPost&limit=100&skip=0" \
-H "Authorization: Bearer {cda_token}"
# Page 2
curl "...?content_type=blogPost&limit=100&skip=100" \
-H "Authorization: Bearer {cda_token}"| Parameter | Default | Max | Description |
|---|---|---|---|
limit | 100 | 1000 | Items per page |
skip | 0 | — | Items to skip |
Continue until items.length < limit or skip >= total.
# Ascending
...?order=fields.publishDate
# Descending (prefix with -)
...?order=-fields.publishDate
# Multiple fields
...?order=-fields.publishDate,fields.title
# System fields
...?order=sys.createdAt
...?order=-sys.updatedAtOrdering by field requires content_type parameter.
Return only specific fields to reduce payload:
# Select specific fields (sys.id is always included)
...?content_type=blogPost&select=fields.title,fields.slug,sys.id
# Only sys metadata
...?content_type=blogPost&select=sys# Exact match
...?content_type=blogPost&fields.slug=hello-world
# Not equal
...?content_type=blogPost&fields.slug[ne]=hello-world# In list (OR)
...?content_type=blogPost&fields.slug[in]=post-1,post-2,post-3
# Not in list
...?content_type=blogPost&fields.slug[nin]=post-1,post-2# Field exists (has value)
...?content_type=blogPost&fields.author[exists]=true
# Field doesn't exist (is empty)
...?content_type=blogPost&fields.author[exists]=false# Greater than
...?content_type=blogPost&fields.viewCount[gt]=1000
# Greater than or equal
...?content_type=blogPost&fields.viewCount[gte]=1000
# Less than
...?content_type=blogPost&fields.viewCount[lt]=1000
# Less than or equal
...?content_type=blogPost&fields.viewCount[lte]=1000# After date
...?content_type=blogPost&fields.publishDate[gte]=2024-01-01
# Before date
...?content_type=blogPost&fields.publishDate[lte]=2024-12-31
# Date range
...?content_type=blogPost&fields.publishDate[gte]=2024-01-01&fields.publishDate[lte]=2024-12-31
# System date fields (use ISO 8601)
...?sys.createdAt[gte]=2024-01-01T00:00:00Z...?content_type=blogPost&query=contentful+cmsMultiple terms are AND-ed (both must match).
...?content_type=blogPost&fields.title[match]=contentful[match] performs a full-text search on the field value using Contentful’s text search semantics and is not limited to prefix matches.
...?content_type=blogPost&fields.tags[all]=tech,javascript...?content_type=blogPost&fields.tags[in]=tech,design,businessResults sorted by distance from the point:
...?content_type=venue&fields.location[near]=40.7128,-74.0060# lat1,lon1 = bottom-left, lat2,lon2 = top-right
...?content_type=venue&fields.location[within]=40.7,-74.1,40.8,-73.9# Entries where author field links to specific entry
...?content_type=blogPost&fields.author.sys.id=author-id...?links_to_entry=entry-id...?links_to_asset=asset-idMaximum reference depth for queries: 2 levels.
# By entry ID
...?sys.id=entry-id
...?sys.id[in]=id1,id2,id3
# By content type
...?sys.contentType.sys.id=blogPost
# By creation date
...?sys.createdAt[gte]=2024-01-01T00:00:00Z
# By update date
...?sys.updatedAt[gte]=2024-01-01T00:00:00Z
# By revision
...?sys.revision[gte]=2# By MIME type
curl "https://cdn.contentful.com/spaces/{space_id}/environments/master/assets?fields.file.contentType=image/png" \
-H "Authorization: Bearer {cda_token}"
# Images only
...?fields.file.contentType[in]=image/jpeg,image/png,image/gif,image/webp
# By file size (bytes)
...?fields.file.details.size[lt]=1048576
# By image dimensions
...?fields.file.details.image.width[gte]=1920
...?fields.file.details.image.height[gte]=1080
# By title
...?fields.title[match]=herocurl "https://cdn.contentful.com/spaces/{space_id}/environments/master/entries?content_type=blogPost&fields.featured=true&fields.publishDate[gte]=2024-01-01&order=-fields.publishDate&limit=10" \
-H "Authorization: Bearer {cda_token}"curl "https://cdn.contentful.com/spaces/{space_id}/environments/master/entries?content_type=blogPost&fields.author.sys.id=author-id&order=-fields.publishDate" \
-H "Authorization: Bearer {cda_token}"curl "https://cdn.contentful.com/spaces/{space_id}/environments/master/entries?content_type=blogPost&query=contentful&limit=20&skip=0" \
-H "Authorization: Bearer {cda_token}"curl "https://cdn.contentful.com/spaces/{space_id}/environments/master/assets?fields.file.contentType[in]=image/jpeg,image/png&order=-sys.createdAt&limit=20" \
-H "Authorization: Bearer {cda_token}"limit per request: 1000include depth: 10limit: 100content_type for field-based queriesselect to reduce payload sizelimit and skip for pagination[match] for better performancesys field queries for filtering by metadata