---
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://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 `articles` folder.

-   cURL
    
    ```shellscript
    curl "https://api.storyblok.com/v2/cdn/stories\
    ?starts_with=articles%2F\
    &version=draft\
    &token=ask9soUkv02QqbZgmZdeDAtt"
    ```
    
-   JS
    
    ```javascript
    // storyblok-js-client@>=7, node@>=18
    import Storyblok from "storyblok-js-client";
    
    const storyblok = new Storyblok({
      accessToken: "krcV6QGxWORpYLUWt12xKQtt",
    });
    
    try {
      const response = await storyblok.get('cdn/stories', {
        "starts_with": "articles/",
        "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" => "articles/",
      "version" => "draft"
    ])->getBody();
    ```
    
-   Java
    
    ```java
    HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/stories?starts_with=articles%2F&version=draft&token=ask9soUkv02QqbZgmZdeDAtt")
      .asString();
    ```
    
-   C#
    
    ```csharp
    var client = new RestClient("https://api.storyblok.com/v2/cdn/stories?starts_with=articles%2F&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":"articles/","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" => "articles/",
      "version" => "draft"
    }})
    ```
    
-   Swift
    
    ```swift
    let storyblok = URLSession(storyblok: .cdn(accessToken: "ask9soUkv02QqbZgmZdeDAtt"))
    var request = URLRequest(storyblok: storyblok, path: "stories")
    request.url!.append(queryItems: [
        URLQueryItem(name: "starts_with", value: "articles/"),
        URLQueryItem(name: "version", value: "draft")
    ])
    let (data, _) = try await storyblok.data(for: request)
    print(try JSONSerialization.jsonObject(with: data))
    ```
    
-   Kotlin
    
    ```kotlin
    val client = HttpClient {
        install(Storyblok(CDN)) {
            accessToken = "ask9soUkv02QqbZgmZdeDAtt"
        }
    }
    
    val response = client.get("stories") {
        url {
            parameters.append("starts_with", "articles/")
            parameters.append("version", "draft")
        }
    }
    
    println(response.body<JsonElement>())
    ```

Response

```json
{
  "stories": [
    {
      "name": "Product B",
      "created_at": "2024-03-07T15:43:12.008Z",
      "published_at": "2024-03-07T15:59:51.735Z",
      "id": 457608238,
      "uuid": "278b829e-bde6-48e3-9920-f99d3afe35d3",
      "content": {
        "_uid": "2fe813f5-e86a-4f56-a4ea-e9a9bfdc354c",
        "image": {
          "id": null,
          "alt": null,
          "name": "",
          "focus": null,
          "title": null,
          "source": null,
          "filename": "",
          "copyright": null,
          "fieldtype": "asset",
          "meta_data": {}
        },
        "price": "1799.99",
        "component": "product"
      },
      "slug": "product-b",
      "full_slug": "products/product-b",
      "sort_by_date": null,
      "position": 0,
      "tag_list": ["Product Tag"],
      "is_startpage": false,
      "parent_id": 457608232,
      "meta_data": null,
      "group_id": "bb986ccd-3ad7-448b-9662-27ff49aa7bff",
      "first_published_at": "2024-03-07T15:42:52.308Z",
      "release_id": null,
      "lang": "default",
      "path": null,
      "alternates": [],
      "default_full_slug": null,
      "translated_slugs": null
    },
    {
      "name": "Product A",
      "created_at": "2024-03-07T15:42:27.967Z",
      "published_at": "2024-03-07T15:59:58.325Z",
      "id": 457608234,
      "uuid": "43a86f66-0b12-4653-9ed9-6dbceb85cb60",
      "content": {
        "_uid": "2fe813f5-e86a-4f56-a4ea-e9a9bfdc354c",
        "image": {
          "id": null,
          "alt": null,
          "name": "",
          "focus": null,
          "title": null,
          "source": null,
          "filename": "",
          "copyright": null,
          "fieldtype": "asset",
          "meta_data": {}
        },
        "price": "239.99",
        "component": "product"
      },
      "slug": "product-a",
      "full_slug": "products/product-a",
      "sort_by_date": null,
      "position": 0,
      "tag_list": ["Product Tag"],
      "is_startpage": false,
      "parent_id": 457608232,
      "meta_data": null,
      "group_id": "7eb7a5f8-8d0b-4c4c-9404-262f7d09f910",
      "first_published_at": "2024-03-07T15:42:52.308Z",
      "release_id": null,
      "lang": "default",
      "path": null,
      "alternates": [],
      "default_full_slug": null,
      "translated_slugs": null
    }
  ],
  "cv": 1711039689,
  "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)
