---
title: Retrieving Stories from a Folder
description: Learn how to retrieve stories from specific folders using the starts_with parameter in Storyblok's Content Delivery API.
url: https://www.storyblok.com/docs/api/content-delivery/v2/stories/examples/retrieving-stories-from-a-folder
---

# Retrieving Stories from a Folder

With the `starts_with` parameter, it is possible to retrieve stories located in a specific folder. This can be useful to retrieve stories from, for example, an `articles` or `products` folder. Moreover, it can be used to conveniently fetch all stories for a particular site when several sites are managed in one space.

Appending the query parameter `is_startpage` with the value `false` excludes the story defined as folder root from the response.

-   `starts_with=products/`: All stories in the `products` folder
-   `starts_with=articles/&is_startpage=false`: All stories in the `articles` folder, excluding the story defined as folder root
-   `starts_with=website-a/` All stories from Website A

## Example Request and Response

The following example demonstrates how to receive all stories located in the `posts` folder.

-   cURL
    
    ```shellscript
    curl "https://api.storyblok.com/v2/cdn/stories\
    ?starts_with=posts\
    &version=draft\
    &token=ask9soUkv02QqbZgmZdeDAtt"
    ```
    
-   JS
    
    ```javascript
    // storyblok-js-client@>=7, node@>=18
    import Storyblok from "storyblok-js-client";
    
    const storyblok = new Storyblok({
      accessToken: "ask9soUkv02QqbZgmZdeDAtt",
    });
    
    try {
      const response = await storyblok.get('cdn/stories', {
        "starts_with": "posts",
        "version": "draft"
      })
      console.log({ response })
    } catch (error) {
      console.log(error)
    }
    ```
    
-   PHP
    
    ```php
    $client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');
    
    $client->getStories([
      "starts_with" => "posts",
      "version" => "draft"
    ])->getBody();
    ```
    
-   Java
    
    ```java
    HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/stories?starts_with=posts&version=draft&token=ask9soUkv02QqbZgmZdeDAtt")
      .asString();
    ```
    
-   C#
    
    ```csharp
    var client = new RestClient("https://api.storyblok.com/v2/cdn/stories?starts_with=posts&version=draft&token=ask9soUkv02QqbZgmZdeDAtt");
    var request = new RestRequest(Method.GET);
    
    IRestResponse response = client.Execute(request);
    ```
    
-   Python
    
    ```python
    import requests
    
    url = "https://api.storyblok.com/v2/cdn/stories"
    
    querystring = {"starts_with":"posts","version":"draft","token":"ask9soUkv02QqbZgmZdeDAtt"}
    
    payload = ""
    headers = {}
    
    response = requests.request("GET", url, data=payload, headers=headers, params=querystring)
    
    print(response.text)
    ```
    
-   Ruby
    
    ```ruby
    require 'storyblok'
    client = Storyblok::Client.new(token: 'YOUR_TOKEN')
    
    client.stories({:params => {
      "starts_with" => "posts",
      "version" => "draft"
    }})
    ```
    
-   Swift
    
    ```swift
    // .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-modeling
    let client = StoryblokClient(
        library: Block.self,
        accessToken: "ask9soUkv02QqbZgmZdeDAtt",
        version: .draft,
        region: .eu
    )
    
    let stories: Page<Story<Block>>? = try await client
        .stories { @Sendable (query: inout StoriesQuery<Block>) in
            query.startsWith = "posts"
        }
        .last()
        .values
        .first { @Sendable _ in true }
    
    print(stories!)
    ```
    
-   Kotlin
    
    ```kotlin
    // implementation("com.storyblok:content-api-client:0.7.1")
    val client = StoryblokClient(
        accessToken = "ask9soUkv02QqbZgmZdeDAtt",
        version = Draft,
    )
    
    val stories = client
        .stories {
            startsWith = "posts"
        }
        .flow
        .asItemSnapshotListFlow()
        .first()
    
    println(stories)
    ```

Response

```json
{
  "stories": [
    {
      "name": "My third post",
      "created_at": "2018-04-24T11:57:29.302Z",
      "published_at": "2026-10-08T12:44:25.188Z",
      "updated_at": "2026-10-08T12:44:25.201Z",
      "id": 107350,
      "uuid": "ac0d2ed0-e323-43ca-ae59-5cd7d38683cb",
      "content": {
        "_uid": "98cccd01-f807-4494-996d-c6b0de2045a5",
        "image": "//a.storyblok.com/f/44162/1500x500/68b522b06d/1500x500.jpeg",
        "title": "My second",
        "author": "c47be9f0-47c3-4315-a95a-550f0c560eb5",
        "topics": "Design",
        "content": "Lorem ipsum dolor sit amet, *consectetur* adipisicing elit, sed do eiusmod\ntempor incididunt ut **labore et dolore magna aliqua**. Ut enim ad minim veniam,\nquis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo\nconsequat. ***Duis aute irure dolor*** in reprehenderit in voluptate velit esse\ncillum dolore eu fugiat nulla pariatur. ~~Excepteur sint occaecat~~ cupidatat non\nproident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\n## H2\n\nLorem ipsum dolor sit amet, *consectetur* adipisicing elit, sed do eiusmod\ntempor incididunt ut **labore et dolore magna aliqua**. Ut enim ad minim veniam,\nquis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo\nconsequat. \n\n---\n\n***Duis aute irure dolor*** in reprehenderit in voluptate velit esse\ncillum dolore eu fugiat nulla pariatur. ~~Excepteur sint occaecat~~ cupidatat non\nproident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\n### H3\n\nunordered list:\n\n* item-1\n  * sub-item-1\n  * sub-item-2\n- item-2\n  - sub-item-3\n  - sub-item-4\n+ item-3\n  + sub-item-5\n  + sub-item-6\n\n\nordered list:\n\n1. item-1\n   1. sub-item-1\n   2. sub-item-2\n2. item-2\n   1. sub-item-3\n   2. sub-item-4\n3. item-3\n\n#### Header4\n\nTable Header-1 | Table Header-2 | Table Header-3\n:--- | :---: | ---:\nTable Data-1 | Table Data-2 | Table Data-3\nTD-4 | Td-5 | TD-6\nTable Data-7 | Table Data-8 | Table Data-9\n\n##### Header5\n\nYou may also want some images right in here like ![GitHub Logo](https://cloud.githubusercontent.com/assets/5456665/13322882/e74f6626-dc00-11e5-921d-f6d024a01eaa.png \"GitHub\") - you can do that but I would recommend you to use the component \"image\" and simply split your text.\n\n###### Header6\n\nLet us do some links - this for example: https://github.com/MinhasKamal/github-markdown-syntax is **NOT** a link but this is [GitHub](https://github.com/MinhasKamal/github-markdown-syntax)",
        "schedule": "2026-10-16 10:59",
        "component": "post",
        "categories": [
          "9aa72a2f-04ae-48df-b71f-25f53044dc97"
        ],
        "description": "Description of the second",
        "_editable": "<!--#storyblok#{\"name\": \"post\", \"space\": \"44203\", \"uid\": \"98cccd01-f807-4494-996d-c6b0de2045a5\", \"id\": \"107350\"}}-->"
      },
      "slug": "my-third-post",
      "full_slug": "posts/my-third-post",
      "sort_by_date": null,
      "position": -20,
      "tag_list": [],
      "is_startpage": false,
      "parent_id": 107348,
      "meta_data": null,
      "group_id": "d5ea8520-1296-40b7-8360-894461fdc5b6",
      "first_published_at": "2018-08-07T03:40:13.000Z",
      "release_id": null,
      "lang": "default",
      "path": null,
      "alternates": [],
      "default_full_slug": null,
      "translated_slugs": null
    },
    {
      "name": "My second post",
      "created_at": "2018-04-24T11:57:29.283Z",
      "published_at": "2026-10-08T12:40:20.406Z",
      "updated_at": "2026-10-08T12:40:20.419Z",
      "id": 107349,
      "uuid": "a91440ee-fd57-4ee3-83cf-d49d217ae919",
      "content": {
        "_uid": "98cccd01-f807-4494-996d-c6b0de2045a5",
        "image": "//a.storyblok.com/f/44162/1500x500/68b522b06d/1500x500.jpeg",
        "title": "My second title",
        "author": "22f4fb1b-50b3-4bf2-816e-7d589e307421",
        "topics": "Tech",
        "content": "Lorem ipsum dolor sit amet, *consectetur* adipisicing elit, sed do eiusmod\ntempor incididunt ut **labore et dolore magna aliqua**. Ut enim ad minim veniam,\nquis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo\nconsequat. ***Duis aute irure dolor*** in reprehenderit in voluptate velit esse\ncillum dolore eu fugiat nulla pariatur. ~~Excepteur sint occaecat~~ cupidatat non\nproident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\n## H2\n\nLorem ipsum dolor sit amet, *consectetur* adipisicing elit, sed do eiusmod\ntempor incididunt ut **labore et dolore magna aliqua**. Ut enim ad minim veniam,\nquis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo\nconsequat. \n\n---\n\n***Duis aute irure dolor*** in reprehenderit in voluptate velit esse\ncillum dolore eu fugiat nulla pariatur. ~~Excepteur sint occaecat~~ cupidatat non\nproident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\n### H3\n\nunordered list:\n\n* item-1\n  * sub-item-1\n  * sub-item-2\n- item-2\n  - sub-item-3\n  - sub-item-4\n+ item-3\n  + sub-item-5\n  + sub-item-6\n\n\nordered list:\n\n1. item-1\n   1. sub-item-1\n   2. sub-item-2\n2. item-2\n   1. sub-item-3\n   2. sub-item-4\n3. item-3\n\n#### Header4\n\nTable Header-1 | Table Header-2 | Table Header-3\n:--- | :---: | ---:\nTable Data-1 | Table Data-2 | Table Data-3\nTD-4 | Td-5 | TD-6\nTable Data-7 | Table Data-8 | Table Data-9\n\n##### Header5\n\nYou may also want some images right in here like ![GitHub Logo](https://cloud.githubusercontent.com/assets/5456665/13322882/e74f6626-dc00-11e5-921d-f6d024a01eaa.png \"GitHub\") - you can do that but I would recommend you to use the component \"image\" and simply split your text.\n\n###### Header6\n\nLet us do some links - this for example: https://github.com/MinhasKamal/github-markdown-syntax is **NOT** a link but this is [GitHub](https://github.com/MinhasKamal/github-markdown-syntax)",
        "schedule": "2026-10-13 22:00",
        "component": "post",
        "categories": [
          "5db2e929-6d3d-4564-982e-fa8513b0e5de"
        ],
        "description": "Description of the second",
        "_editable": "<!--#storyblok#{\"name\": \"post\", \"space\": \"44203\", \"uid\": \"98cccd01-f807-4494-996d-c6b0de2045a5\", \"id\": \"107349\"}}-->"
      },
      "slug": "my-second-post",
      "full_slug": "posts/my-second-post",
      "sort_by_date": null,
      "position": -10,
      "tag_list": [],
      "is_startpage": false,
      "parent_id": 107348,
      "meta_data": null,
      "group_id": "854c3d1f-5d7f-4785-92ee-620a7c6ca7ee",
      "first_published_at": "2018-07-26T12:38:17.000Z",
      "release_id": null,
      "lang": "default",
      "path": null,
      "alternates": [],
      "default_full_slug": null,
      "translated_slugs": null
    },
    {
      "name": "My first Post",
      "created_at": "2018-04-24T11:57:29.321Z",
      "published_at": "2026-10-12T10:03:52.422Z",
      "updated_at": "2026-10-13T08:59:51.886Z",
      "id": 107351,
      "uuid": "bfea4895-8a19-4e82-ae1c-1c591dce3094",
      "content": {
        "_uid": "2caef8f8-9c37-46b4-af19-8744ec5e1053",
        "image": "//a.storyblok.com/f/44162/1500x500/68b522b06d/1500x500.jpeg",
        "title": "This is my first post title",
        "author": "c47be9f0-47c3-4315-a95a-550f0c560eb5",
        "topics": "Finance",
        "content": "Lorem ipsum dolor sit amet, *consectetur* adipisicing elit, sed do eiusmod\ntempor incididunt ut **labore et dolore magna aliqua**. Ut enim ad minim veniam,\nquis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo\nconsequat. ***Duis aute irure dolor*** in reprehenderit in voluptate velit esse\ncillum dolore eu fugiat nulla pariatur. ~~Excepteur sint occaecat~~ cupidatat non\nproident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\n## H2\n\nLorem ipsum dolor sit amet, *consectetur* adipisicing elit, sed do eiusmod\ntempor incididunt ut **labore et dolore magna aliqua**. Ut enim ad minim veniam,\nquis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo\nconsequat. \n\n---\n\n***Duis aute irure dolor*** in reprehenderit in voluptate velit esse\ncillum dolore eu fugiat nulla pariatur. ~~Excepteur sint occaecat~~ cupidatat non\nproident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\n### H3\n\nunordered list:\n\n* item-1\n  * sub-item-1\n  * sub-item-2\n- item-2\n  - sub-item-3\n  - sub-item-4\n+ item-3\n  + sub-item-5\n  + sub-item-6\n\n\nordered list:\n\n1. item-1\n   1. sub-item-1\n   2. sub-item-2\n2. item-2\n   1. sub-item-3\n   2. sub-item-4\n3. item-3\n\n#### Header4\n\nTable Header-1 | Table Header-2 | Table Header-3\n:--- | :---: | ---:\nTable Data-1 | Table Data-2 | Table Data-3\nTD-4 | Td-5 | TD-6\nTable Data-7 | Table Data-8 | Table Data-9\n\n##### Header5\n\nYou may also want some images right in here like ![GitHub Logo](https://cloud.githubusercontent.com/assets/5456665/13322882/e74f6626-dc00-11e5-921d-f6d024a01eaa.png \"GitHub\") - you can do that but I would recommend you to use the component \"image\" and simply split your text.\n\n###### Header6\n\nLet us do some links -\n this for example: https://github.com/MinhasKamal/github-markdown-syntax is **NOT** a link but this:\n is [GitHub](https://github.com/MinhasKamal/github-markdown-syntax)",
        "schedule": "2026-10-12 09:00",
        "component": "post",
        "categories": [
          "9aa72a2f-04ae-48df-b71f-25f53044dc97",
          "84550816-245d-4fe6-8ae8-b633d4a328f4"
        ],
        "description": "Description of the first",
        "highlighted": true,
        "_editable": "<!--#storyblok#{\"name\": \"post\", \"space\": \"44203\", \"uid\": \"2caef8f8-9c37-46b4-af19-8744ec5e1053\", \"id\": \"107351\"}}-->"
      },
      "slug": "my-first-post",
      "full_slug": "posts/my-first-post",
      "sort_by_date": null,
      "position": 0,
      "tag_list": [],
      "is_startpage": false,
      "parent_id": 107348,
      "meta_data": null,
      "group_id": "6900d2ec-034a-420a-a1c5-9dca2039a81d",
      "first_published_at": "2018-07-26T12:38:22.000Z",
      "release_id": null,
      "lang": "default",
      "path": null,
      "alternates": [],
      "default_full_slug": null,
      "translated_slugs": null
    }
  ],
  "cv": 1792059567,
  "rels": [],
  "links": []
}
```

## Pagination

-   [Previous: Retrieving Localized Stories by UUID](/docs/api/content-delivery/v2/stories/examples/retrieving-localized-stories-by-uuid)
-   [Next: Retrieving Stories in a Particular Language](/docs/api/content-delivery/v2/stories/examples/retrieving-stories-in-a-particular-language)
