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
Examples Use Cases
Section titled “Examples Use Cases”filter_query[body.0.headline][in]=Hello Earth!Returns all stories which meet the following criteria:
a top-level blocks field namedbodythe first nested block in this field (represented by the
0) has aheadlinefield with the value “Hello Earth!”filter_query[seo.description][is]=not_emptyReturns all stories configured with an
seofield (using the SEO App) with the propertydescriptionthat is not empty
Example Request and Response
Section titled “Example Request and Response”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.headline%5D%5Bin%5D=Hello+Earth%21\&token=ask9soUkv02QqbZgmZdeDAtt"// storyblok-js-client@>=7, node@>=18import Storyblok from "storyblok-js-client";
const storyblok = new Storyblok({ accessToken: "ask9soUkv02QqbZgmZdeDAtt",});
try { const response = await storyblok.get('cdn/stories', { "filter_query[body.0.headline][in]": "Hello Earth!" }) console.log({ response })} catch (error) { console.log(error)}$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');
$client->getStories([ "filter_query[body.0.headline][in]" => "Hello Earth!"])->getBody();HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/stories?filter_query%5Bbody.0.headline%5D%5Bin%5D=Hello+Earth%21&token=ask9soUkv02QqbZgmZdeDAtt") .asString();var client = new RestClient("https://api.storyblok.com/v2/cdn/stories?filter_query%5Bbody.0.headline%5D%5Bin%5D=Hello+Earth%21&token=ask9soUkv02QqbZgmZdeDAtt");var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);import requests
url = "https://api.storyblok.com/v2/cdn/stories"
querystring = {"filter_query[body.0.headline][in]":"Hello Earth!","token":"ask9soUkv02QqbZgmZdeDAtt"}
payload = ""headers = {}
response = requests.request("GET", url, data=payload, headers=headers, params=querystring)
print(response.text)require 'storyblok'client = Storyblok::Client.new(token: 'YOUR_TOKEN')
client.stories({:params => { "filter_query[body.0.headline][in]" => "Hello Earth!"}})// .package(url: "https://github.com/storyblok/storyblok-swift.git", from: "1.1.0")// Requires a `Block` content model — see https://www.storyblok.com/docs/quickstarts/apple-platforms/content-modelinglet client = StoryblokClient( library: Block.self, accessToken: "ask9soUkv02QqbZgmZdeDAtt", version: .published, region: .eu)
let stories: Page<Story<Block>>? = try await client .stories { @Sendable (query: inout StoriesQuery<Block>) in query.parameter("filter_query[body.0.headline][in]", "Hello Earth!") } .last() .values .first { @Sendable _ in true }
print(stories!)// implementation("com.storyblok:content-api-client:0.7.1")val client = StoryblokClient( accessToken = "ask9soUkv02QqbZgmZdeDAtt", version = Published,)
val stories = client .stories { parameter("filter_query[body.0.headline][in]", "Hello Earth!") } .flow .asItemSnapshotListFlow() .first()
println(stories){ "stories": [ { "name": "Home", "created_at": "2018-04-24T11:57:29.231Z", "published_at": "2026-10-12T09:47:00.856Z", "updated_at": "2026-10-12T09:47:00.865Z", "id": 107347, "uuid": "273bba42-834b-4a87-b190-eafe3eabb4d4", "content": { "_uid": "5c524540-192a-4110-ab1d-b8721f278811", "body": [ { "_uid": "58acbf26-93f9-4faf-8f92-962eeb006029", "headline": "Hello Earth!", "component": "teaser" }, { "_uid": "95ed695c-007a-438a-a9ff-5890138c1b60", "posts": [ "bfea4895-8a19-4e82-ae1c-1c591dce3094" ], "component": "featured_posts" }, { "_uid": "f3530c4a-abe0-4416-9488-e5f79445c9fb", "columns": [ { "_uid": "2e738815-9e15-41c9-a7df-330d5157cc1f", "name": "Feature 1", "component": "feature" }, { "_uid": "02ddfbcc-6f6a-4be8-a901-153a622e6e83", "name": "Feature 2", "component": "feature" }, { "_uid": "802a531e-70ae-4ac0-8f34-fdba3b008031", "name": "Feature 3", "component": "feature" } ], "component": "grid" } ], "component": "page" }, "slug": "home", "full_slug": "home", "sort_by_date": null, "position": 40, "tag_list": [], "is_startpage": false, "parent_id": 0, "meta_data": null, "group_id": "d080c075-3a6b-4e29-b0dc-e6500714203e", "first_published_at": "2019-03-09T14:11:05.000Z", "release_id": null, "lang": "default", "path": null, "alternates": [], "default_full_slug": null, "translated_slugs": null } ], "cv": 1791799432, "rels": [], "links": []}Was this page helpful?
This site uses reCAPTCHA and Google's Privacy Policy (opens in a new window).Terms of Service (opens in a new window) apply.
- Need help?Contact support (opens in a new window)
- Something isn’t right?Check system status (opens in a new window)
Get in touch with the Storyblok community