Skip to main content

Content API

The Content API is available on the adapter as:

$appStoryblok->contentApi

Use it to fetch and hydrate Storyblok content for the configured adapter space.

Main Methods

fetchSingleStory()

Fetches a single story by slug, id or uuid.

$appStoryblok->contentApi->fetchSingleStory("home");

fetchStories()

Fetches stories for a specific story class.

$appStoryblok->contentApi->fetchStories(PageStory::class, "pages/*");

fetchAllStories()

Fetches all stories (optionally filtered by slug pattern).

$appStoryblok->contentApi->fetchAllStories("pages/*");

getSpaceInfo()

Returns metadata for the current Storyblok space.

$appStoryblok->contentApi->getSpaceInfo();

fetchDatasourceEntries()

Fetches datasource entries from the Content API.

$appStoryblok->contentApi->fetchDatasourceEntries("countries");

fetchFoldersInPath()

Fetches folders below a slug prefix.

$appStoryblok->contentApi->fetchFoldersInPath("pages");

fetchFolderTitleMap()

Fetches a map of local folder URL to folder title.

$appStoryblok->contentApi->fetchFolderTitleMap("pages");

Fetches all Storyblok links.

$appStoryblok->contentApi->fetchAllLinks();

fetchSignedAssetUrl()

Fetches signed asset data for private assets.

$appStoryblok->contentApi->fetchSignedAssetUrl("https://a.storyblok.com/f/...");