Skip to content

Filter Queries with Nestable Blocks and Fields

It is possible to use filter queries with nestable blocks and fields that return objects. The following syntax applies:

stories/?filter_query[field.property][operation]=value

  • filter_query[body.0.name][in]=This is a nested blok

    Returns all stories which meet the following criteria:
    a top-level blocks field named body


    the first nested block in this field (represented by the 0) has a name field with the value “This is a nested block”

  • filter_query[seo.description][is]=not_empty

    Returns all stories configured with an seo field (using the SEO App) with the property description that is not empty

The following example demonstrates how to use the filter_query parameter with nestable blocks.

curl "https://api.storyblok.com/v2/cdn/stories?filter_query%5Bbody.0.name%5D%5Bin%5D=This+is+a+nested+blok&token=ask9soUkv02QqbZgmZdeDAtt"
Response
{
"stories": [
{
"name": "Nestable bloks",
"created_at": "2024-03-07T18:22:10.389Z",
"published_at": "2024-03-07T18:32:44.919Z",
"id": 457784924,
"uuid": "387914f2-0d36-4172-93c6-0f5535be2d27",
"content": {
"seo": {
"_uid": "d3797349-49c9-4155-8d31-acdd15d47b05",
"title": "SEO title",
"plugin": "seo_metatags",
"og_image": "",
"og_title": "",
"description": "Just a test",
"twitter_image": "",
"twitter_title": "",
"og_description": "",
"twitter_description": ""
},
"_uid": "a925a690-464c-4a88-b99f-35234e4bf49c",
"body": [
{
"_uid": "73997a89-085a-44df-87d5-4f1b4f053b24",
"name": "This is a nested blok",
"component": "feature"
}
],
"component": "page"
},
"slug": "nested-fields",
"full_slug": "nested-fields",
"sort_by_date": null,
"position": -40,
"tag_list": [],
"is_startpage": false,
"parent_id": null,
"meta_data": null,
"group_id": "bb4c871c-fac7-47c0-8dc9-2bd58024647f",
"first_published_at": "2024-03-07T18:23:14.717Z",
"release_id": null,
"lang": "default",
"path": null,
"alternates": [],
"default_full_slug": null,
"translated_slugs": null
}
],
"cv": 1709836364,
"rels": [],
"links": []
}