Retrieve Multiple Stories
Returns an array of all stories (as story objects) contained in a Storyblok space. The API response can be filtered using the query parameters, including specific filter queries.
https://api.storyblok.com/v2/cdn/stories
This endpoint is paginated by default, including a maximum of 100 stories in the response. Learn more under Pagination.
An empty array rather than a 404
error is returned if no stories are found with the filters applied.
Query Parameters
-
token
required stringA preview or public access token configured in a space.
-
cv
numberUsed to access a particular cached version of a published story by providing a Unix timestamp. Further information is found under Cache Invalidation.
-
version
stringDefault:
published
. Possible values:draft
,published
-
starts_with
stringFilter by
full_slug
. Used to retrieve all stories in a specific folder. Example:starts_with=blog/posts
-
search_term
stringPerforms a full-text search by passing a search query. When the
sort_by
parameter is not included with the request, the search results are ordered based on the following:- By relevance of the
full_slug
. - By relevance of the
name
. - By the
position
in ascending order. The position is the numeric representation of the story's position in its folder.
- By relevance of the
-
sort_by
stringSort stories in ascending or descending order by a specific property. Possible properties are all default story properties and any custom fields defined in the schema of the story type.
Default story properties can be used like this:
sort_by=created_at:desc
sort_by=slug:asc
Custom fields can be used like this:
sort_by=content.meta_description:asc
sort_by=content.event_title:desc
By default, all custom fields are sorted as strings. To sort custom fields with numeric values, it needs to be specified whether they should be treated as float or integer. Examples:
sort_by=content.price:asc:float
sort_by=content.event_number:asc:int
Different sorts can be chained using commas like this:
sort_by=name:desc,slug:asc
There is also a possibility to sort values keeping the null (or empty) ones first or last:
sort_by=path:desc:nulls_first
orsort_by=path:desc:nulls_last
.nulls_last
is the default behavior. -
per_page
numberDefault:
25
. Max:100
. Learn more under Pagination. -
page
numberDefault:
1
. Learn more under Pagination. -
by_slugs
stringRetrieve stories by comma-separated
full_slug
. It is possible to specify wildcards by using*
. Examples:by_slugs=posts/my-third-post,posts/my-second-post
by_slugs=posts/*
-
excluding_slugs
stringExclude stories by specifying comma-separated values of
full_slug
. It is possible to specify wildcards by using*
. Examples:excluding_slugs=posts/my-third-post,posts/my-second-post
excluding_slugs=posts*
-
published_at_gt
stringRetrieve stories published after the specified date (Format:
yyyy-MM-dd HH:mm
) -
published_at_lt
stringRetrieve stories published before the specified date (Format:
yyyy-MM-dd HH:mm
) -
first_published_at_gt
stringRetrieve stories first published after the specified date (Format:
yyyy-MM-dd HH:mm
) -
first_published_at_lt
stringRetrieve stories first published before the specified date (Format:
yyyy-MM-dd HH:mm
) -
in_workflow_stages
numberRetrieve stories that are in a particular workflow stage by providing a comma-separated list of workflow stage IDs. Workflow stage IDs can be retrieved via the Management API. Example:
in_workflow_stages=325604,325605
-
content_type
stringRetrieve stories of a specific content type. Example:
content_type=page
-
level
numberRetrieve stories located in the specified folder level. Examples:
level=1
retrieves stories from the root folderlevel=2
retrieves stories from top-level folderslevel=3
retrieves stories from second-level foldersOnly the immediate child stories are included in the response. Stories defined as root for the folder are excluded.
-
resolve_relations
stringUsed to resolve relations to other stories established via a multi-option or single-option field. Resolved relations are included in the
rels
property of the response. A maximum of50
stories can be resolved. If this limit is exceeded, the story UUIDs are included in therel_uuids
property of the response and can be used for further API requests (this is handled automatically when using one of Storyblok's official frontend SDKs). Entries can be resolved two levels deep.To resolve the stories selected in one field, provide the technical name of the immediate parent component of the field, followed by a
.
and the field name. To resolve the stories selected in multiple fields, provide a comma-separated list.Example:
resolve_relations=page.author,page.categories
Further information can be found in this tutorial.
-
excluding_ids
stringExclude specific stories by providing their IDs as a comma-separated string. Example:
excluding_ids=335015953,335015954
-
by_uuids
stringRetrieve specific stories by providing their UUIDs as a comma-separated string. Example:
by_uuids=a78b2116-c26d-4d23-9cbe-fec477847b0e,9683820e-fc17-429e-ba23-eb41f26c0776
-
by_uuids_ordered
stringRetrieve specific stories by providing their UUIDs as a comma-separated string. The order of the stories in the response matches the order in which the UUIDs are listed. Example:
by_uuids_ordered=a78b2116-c26d-4d23-9cbe-fec477847b0e,9683820e-fc17-429e-ba23-eb41f26c0776
-
with_tag
stringFilter by specific tag(s). Multiple tags can be provided as a comma-separated string (treated like an OR operator). Examples:
with_tag=featured
with_tag=featured,editors_choice
-
is_startpage
booleanFilter by stories defined as root for the folder.
is_startpage=1
returns only root stories;is_startpage=0
excludes root stories from the result. -
resolve_links
enumUsed to resolve internal links of link fields used in a story. Resolved links are included in the
links
property of the response. Possible values arestory
,url
, andlink
. Entries can be resolved two levels deep usingresolve_links_level
. Learn more in this developer guide.Possible values Description link Provides access to additional information such as a linked story's path, parent_id, is_folder, published, is_startpage, position, alternates, real_path, and more. url If only the path of a linked story is required, this value provides the minimum amount of information in the response. story Resolves and returns the complete story object of a linked story. -
resolve_links_level
numberDefault:
1
. Possible values:1
,2
Used to resolve up to two levels of links. For example, if a story has a link field that references another story, the links in this story will also be resolved ifresolve_links_level
is set to2
. -
from_release
stringUsed to access a story version associated with a specific release by providing the release ID
-
fallback_lang
stringUsed to define a custom fallback language to handle untranslated fields. As standard, the default language defined in the Storyblok is used. Please note that the language code needs to be specified with underscores, even if it is defined with hyphens. E.g.,
es_co
instead ofes-co
. -
language
stringUsed to obtain translated versions of one or more stories. Accepts any language code that is configured in the Storyblok space. Used in the context of field-level translation.
-
filter_query
string or objectFilter by (a) specific field(s) of your story type. Filtering by default story properties is not supported. The filter_query parameter accepts an
attribute
and anoperation
key in string format. Separate the values by a comma to filter by multiple values. When using the Javascript SDK, the filter_query param is an object.-
is
stringMatches a value type (
empty
,not_empty
,empty_array
,not_empty_array
,true
,false
,null
,not_null
) -
in
stringMatches all with the exact specified value
-
not_in
stringMatches all without the exact specified value
-
like
stringMatches all with the specified value (wildcard allowed)
-
not_like
stringMatches all without the specified value (wildcard allowed)
-
any_in_array
stringMatches if any of the specified values is contained in the field value (array)
-
all_in_array
stringMatches if all specified values are contained in the field value (array)
-
gt_date
stringGreater than date (Format:
YYYY-mm-dd HH:MM
) -
lt_date
stringLower than date (Format: (Format:
YYYY-mm-dd HH:MM
)) -
gt_int
stringGreater than integer value
-
lt_int
stringLower than integer value
-
gt_float
stringGreater than float value
-
lt_float
stringLower than float value
-
-
excluding_fields
stringExclude specific fields defined in the schema of a story type by providing the field names as a comma-separated string. Example:
excluding_fields=body,meta_description
-
resolve_assets
numberUsed to resolve asset metadata, including custom metadata. The resolved metadata is included in the
assets
property of the response. This parameter is only available in the Business plan and above. Please refer to our Pricing for further information.
Response Properties
-
stories
The Story Object[]An array of story objects
-
name
stringThe complete name provided for the story
-
created_at
stringCreation date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
published_at
stringLatest publishing date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
id
numberThe numeric ID
-
uuid
stringGenerated UUID string
-
content
objectAn object containing the field data associated with the specific story type's specific content structure. Also includes a
component
property with the story type's technical name. -
slug
stringThe slug specific for the story
-
full_slug
stringThe full slug of the story, combining the parent folder(s) and the designated story slug
-
sort_by_date
stringDate defined in the story's entry configuration (Format:
YYYY-mm-dd
) -
position
numberNumeric representation of the story's position in the folder
-
tag_list
string[]Array of tag names
-
is_startpage
booleantrue
if the story is defined as root for the folder -
parent_id
numberID of the parent folder
-
meta_data
objectObject to store non-editable data that is exclusively maintained with the Management API
-
group_id
stringGroup ID (UUID string), shared between stories defined as alternates
-
first_published_at
stringFirst publishing date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
release_id
numberID of the current release (can be requested with the
from_release
API parameter) -
lang
stringLanguage code of the current language (can be requested with the
language
API parameter) -
path
stringValue of the real path defined in the story's entry configuration (usually, this value is only required for Storyblok's Visual Editor)
-
alternates
object[]An array containing objects that provide basic data of the stories defined as alternates of the current story
-
id
numberThe numeric ID
-
name
stringThe complete name provided for the story
-
slug
stringThe slug specific for the story
-
published
booleantrue
if a story has been published at least once (even if it is currently in draft) -
full_slug
stringThe full slug of the story, combining the parent folder(s) and the designated story slug
-
is_folder
booleantrue
if the instance constitutes a folder
-
-
default_full_slug
stringContains the complete slug of the default language (if the app Translatable Slugs is installed)
-
translated_slugs
object[]Array of translated slug objects (if the app Translatable Slugs is installed)
-
path
stringValue of the translated slug
-
name
stringThe complete name provided for the story
-
lang
stringLanguage code of the current language (can be requested with the
language
API parameter) -
published
booleantrue
if a story has been published at least once (even if it is currently in draft)
-
-
-
cv
numberUsed to access a particular cached version of a published story by providing a Unix timestamp. Further information is found under Cache Invalidation.
-
rels
The Story ObjectArray of resolved stories (if the
resolve_relations
parameter is in use)-
name
stringThe complete name provided for the story
-
created_at
stringCreation date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
published_at
stringLatest publishing date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
id
numberThe numeric ID
-
uuid
stringGenerated UUID string
-
content
objectAn object containing the field data associated with the specific story type's specific content structure. Also includes a
component
property with the story type's technical name. -
slug
stringThe slug specific for the story
-
full_slug
stringThe full slug of the story, combining the parent folder(s) and the designated story slug
-
sort_by_date
stringDate defined in the story's entry configuration (Format:
YYYY-mm-dd
) -
position
numberNumeric representation of the story's position in the folder
-
tag_list
string[]Array of tag names
-
is_startpage
booleantrue
if the story is defined as root for the folder -
parent_id
numberID of the parent folder
-
meta_data
objectObject to store non-editable data that is exclusively maintained with the Management API
-
group_id
stringGroup ID (UUID string), shared between stories defined as alternates
-
first_published_at
stringFirst publishing date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
release_id
numberID of the current release (can be requested with the
from_release
API parameter) -
lang
stringLanguage code of the current language (can be requested with the
language
API parameter) -
path
stringValue of the real path defined in the story's entry configuration (usually, this value is only required for Storyblok's Visual Editor)
-
alternates
object[]An array containing objects that provide basic data of the stories defined as alternates of the current story
-
id
numberThe numeric ID
-
name
stringThe complete name provided for the story
-
slug
stringThe slug specific for the story
-
published
booleantrue
if a story has been published at least once (even if it is currently in draft) -
full_slug
stringThe full slug of the story, combining the parent folder(s) and the designated story slug
-
is_folder
booleantrue
if the instance constitutes a folder
-
-
default_full_slug
stringContains the complete slug of the default language (if the app Translatable Slugs is installed)
-
translated_slugs
object[]Array of translated slug objects (if the app Translatable Slugs is installed)
-
path
stringValue of the translated slug
-
name
stringThe complete name provided for the story
-
lang
stringLanguage code of the current language (can be requested with the
language
API parameter) -
published
booleantrue
if a story has been published at least once (even if it is currently in draft)
-
-
-
links
The Link Object[] or The Story Object[]An array of resolved links (dependent on the value of the
resolve_links
parameter).-
id
numberThe numeric ID
-
uuid
stringGenerated UUID string
-
slug
stringThe full slug of the story or folder
-
path
Value of the real path defined in the story's entry configuration
-
real_path
stringEither the full slug of the story or folder with a leading
/
, or, if existent, the value of the real path defined in the story's entry configuration with a leading/
-
name
The complete name of the story or folder
-
published
true
if a story has been published at least once (even if it is currently in draft) -
parent_id
numberID of the parent folder
-
is_folder
booleantrue
if the instance constitutes a folder -
is_startpage
booleantrue
if the story is defined as root for the folder -
position
numberNumeric representation of the story's position in the folder
-
published_at
stringLatest publishing date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
); only included ifinclude_dates=1
is specified -
created_at
stringCreation date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
); only included ifinclude_dates=1
is specified -
updated_at
stringLatest update date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
); only included ifinclude_dates=1
is specified -
alternates
objectAn array containing objects that provide basic data of the different language versions of a story using Storyblok's Field Level Translation. Important: not to be confused with actual story alternates.
-
path
Translated slug of the story (if the app Translatable Slugs is installed; otherwise, it matches the slug of the parent object)
-
name
Translated name of the story (if the app Translatable Slugs is installed)
-
lang
Language code of this story variant
-
published
true
if a story has been published at least once (even if it is currently in draft) -
translated_slug
Translated slug of the story (if the app Translatable Slugs is installed; otherwise, it matches the slug of the parent object)
-
-
name
stringThe complete name provided for the story
-
created_at
stringCreation date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
published_at
stringLatest publishing date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
id
numberThe numeric ID
-
uuid
stringGenerated UUID string
-
content
objectAn object containing the field data associated with the specific story type's specific content structure. Also includes a
component
property with the story type's technical name. -
slug
stringThe slug specific for the story
-
full_slug
stringThe full slug of the story, combining the parent folder(s) and the designated story slug
-
sort_by_date
stringDate defined in the story's entry configuration (Format:
YYYY-mm-dd
) -
position
numberNumeric representation of the story's position in the folder
-
tag_list
string[]Array of tag names
-
is_startpage
booleantrue
if the story is defined as root for the folder -
parent_id
numberID of the parent folder
-
meta_data
objectObject to store non-editable data that is exclusively maintained with the Management API
-
group_id
stringGroup ID (UUID string), shared between stories defined as alternates
-
first_published_at
stringFirst publishing date (Format:
yyyy-MM-dd'T'HH:mm:ssZ
) -
release_id
numberID of the current release (can be requested with the
from_release
API parameter) -
lang
stringLanguage code of the current language (can be requested with the
language
API parameter) -
path
stringValue of the real path defined in the story's entry configuration (usually, this value is only required for Storyblok's Visual Editor)
-
alternates
object[]An array containing objects that provide basic data of the stories defined as alternates of the current story
-
id
numberThe numeric ID
-
name
stringThe complete name provided for the story
-
slug
stringThe slug specific for the story
-
published
booleantrue
if a story has been published at least once (even if it is currently in draft) -
full_slug
stringThe full slug of the story, combining the parent folder(s) and the designated story slug
-
is_folder
booleantrue
if the instance constitutes a folder
-
-
default_full_slug
stringContains the complete slug of the default language (if the app Translatable Slugs is installed)
-
translated_slugs
object[]Array of translated slug objects (if the app Translatable Slugs is installed)
-
path
stringValue of the translated slug
-
name
stringThe complete name provided for the story
-
lang
stringLanguage code of the current language (can be requested with the
language
API parameter) -
published
booleantrue
if a story has been published at least once (even if it is currently in draft)
-
-
-
rel_uuids
stringAn array of all UUIDS of resolvable stories. Only provided if the
resolve_relations
parameter is in use and the limit of resolvable relations is exceeded. -
link_uuids
stringAn array of all UUIDS of linked stories. Only provided if the
resolve_links
parameter is in use and the limit of resolvable links is exceeded.
curl "https://api.storyblok.com/v2/cdn/stories?starts_with=articles&version=published&token=ask9soUkv02QqbZgmZdeDAtt" \
-X GET \
-H "Accept: application/json" \
-H "Content-Type: application/json"
// Using the Universal JavaScript Client:
// https://github.com/storyblok/storyblok-js-client
Storyblok.get('cdn/stories', {
"starts_with": "articles",
"version": "published"
})
.then(response => {
console.log(response)
}).catch(error => {
console.log(error)
})
$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');
$client->getStories([
"starts_with" => "articles",
"version" => "published"
])->getBody();
require 'storyblok'
client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')
client.stories({:params => {
"starts_with" => "articles",
"version" => "published"
}})
HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/stories?starts_with=articles&version=published&token=ask9soUkv02QqbZgmZdeDAtt")
.asString();
var client = new RestClient("https://api.storyblok.com/v2/cdn/stories?starts_with=articles&version=published&token=ask9soUkv02QqbZgmZdeDAtt");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
This is swift code
import requests
url = "https://api.storyblok.com/v2/cdn/stories"
querystring = {"starts_with":"articles","version":"published","token":"ask9soUkv02QqbZgmZdeDAtt"}
payload = ""
headers = {}
response = requests.request("GET", url, data=payload, headers=headers, params=querystring)
print(response.text)
{
"stories": [
{
"name": "Mars Unveiled: Exploring the Mysteries and Marvels of the Red Frontier",
"created_at": "2024-02-16T14:30:19.768Z",
"published_at": "2024-03-13T17:20:40.220Z",
"id": 445002665,
"uuid": "a2c57c06-2c5c-4819-acb7-0d9c047d16e9",
"content": {
"_uid": "6bdf037c-f713-415c-a26a-8a9cfc926c85",
"image": {
"id": 14114865,
"alt": "",
"name": "",
"focus": "",
"title": "",
"source": "",
"filename": "https://a.storyblok.com/f/276232/3500x2000/cd4947ece2/mars.jpg",
"copyright": "",
"fieldtype": "asset",
"meta_data": {},
"is_private": "",
"is_external_url": false
},
"author": "e7307a9e-a3c5-47ad-8f6c-a1a36fe528e2",
"topics": ["space-exploration", "solar-system"],
"content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
"headline": "Mars Unveiled: Exploring the Mysteries and Marvels of the Red Frontier",
"component": "article",
"scheduled": "2024-02-29 17:00",
"categories": [
"45d968b6-5790-4fbb-aa41-5781b8edde51",
"a6af7728-eadf-4428-8cf5-343304857374",
"d8e48716-0ecf-4059-b568-343bf54e4128"
],
"highlighted": false
},
"slug": "mars-unveiled-exploring-mysteries-marvels-red-frontier",
"full_slug": "articles/mars-unveiled-exploring-mysteries-marvels-red-frontier",
"sort_by_date": null,
"position": 0,
"tag_list": [],
"is_startpage": false,
"parent_id": 444991588,
"meta_data": null,
"group_id": "2e0c427d-63ed-420e-830f-bf1889da0792",
"first_published_at": "2024-02-16T14:30:11.990Z",
"release_id": null,
"lang": "default",
"path": null,
"alternates": [],
"default_full_slug": null,
"translated_slugs": null
},
{
"name": "Earth's Symphony: Navigating the Wonders and Challenges of Our Blue Oasis",
"created_at": "2024-02-16T14:22:09.108Z",
"published_at": "2024-03-13T17:20:40.506Z",
"id": 444996765,
"uuid": "660452d2-1a68-4493-b5b6-2f03b6fa722b",
"content": {
"_uid": "6bdf037c-f713-415c-a26a-8a9cfc926c85",
"image": {
"id": 14114772,
"alt": "",
"name": "",
"focus": "",
"title": "",
"source": "",
"filename": "https://a.storyblok.com/f/276232/2560x1946/ee938cf736/earth.jpg",
"copyright": "",
"fieldtype": "asset",
"meta_data": {},
"is_private": "",
"is_external_url": false
},
"author": "51eed33d-855f-415c-ac0d-4404e03b89e1",
"topics": ["solar-system"],
"content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
"headline": "Earth's Symphony: Navigating the Wonders and Challenges of Our Blue Oasis",
"component": "article",
"scheduled": "2023-10-01 15:00",
"categories": ["45d968b6-5790-4fbb-aa41-5781b8edde51", "d8e48716-0ecf-4059-b568-343bf54e4128"],
"highlighted": false
},
"slug": "earths-symphony-navigating-wonders-challenges-blue-oasis",
"full_slug": "articles/earths-symphony-navigating-wonders-challenges-blue-oasis",
"sort_by_date": null,
"position": 0,
"tag_list": [],
"is_startpage": false,
"parent_id": 444991588,
"meta_data": null,
"group_id": "8d99d18d-5c97-42cd-a646-51e0c553f26a",
"first_published_at": "2024-02-16T14:30:11.990Z",
"release_id": null,
"lang": "default",
"path": null,
"alternates": [],
"default_full_slug": null,
"translated_slugs": null
}
],
"cv": 1710350440,
"rels": [],
"links": []
}