---
title: Retrieving Stories with Resolved Relations
description: Learn how to resolve referenced stories using the resolve_relations parameter in Storyblok's Content Delivery API.
url: https://storyblok.com/docs/api/content-delivery/v2/stories/examples/retrieving-stories-with-resolved-relations
---

# Retrieving Stories with Resolved Relations

Resolve referenced stories using the `resolve_relations` parameter. The resolved stories are found in the `rels` array of the response.

## Example Request and Response

The following example demonstrates how to resolve the relations of the `categories` and `author` fields.

-   cURL
    
    ```shellscript
    curl "https://api.storyblok.com/v2/cdn/stories\
    ?resolve_relations=article.categories%2Carticle.author\
    &token=krcV6QGxWORpYLUWt12xKQtt"
    ```
    
-   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', {
        "resolve_relations": "article.categories,article.author"
      })
      console.log({ response })
    } catch (error) {
      console.log(error)
    }
    ```
    
-   PHP
    
    ```php
    $client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');
    
    $client->getStories([
      "resolve_relations" => "article.categories,article.author"
    ])->getBody();
    ```
    
-   Java
    
    ```java
    HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/stories?resolve_relations=article.categories%2Carticle.author&token=krcV6QGxWORpYLUWt12xKQtt")
      .asString();
    ```
    
-   C#
    
    ```csharp
    var client = new RestClient("https://api.storyblok.com/v2/cdn/stories?resolve_relations=article.categories%2Carticle.author&token=krcV6QGxWORpYLUWt12xKQtt");
    var request = new RestRequest(Method.GET);
    
    IRestResponse response = client.Execute(request);
    ```
    
-   Python
    
    ```python
    import requests
    
    url = "https://api.storyblok.com/v2/cdn/stories"
    
    querystring = {"resolve_relations":"article.categories,article.author","token":"krcV6QGxWORpYLUWt12xKQtt"}
    
    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 => {
      "resolve_relations" => "article.categories,article.author"
    }})
    ```
    
-   Swift
    
    ```swift
    let storyblok = URLSession(storyblok: .cdn(accessToken: "krcV6QGxWORpYLUWt12xKQtt"))
    var request = URLRequest(storyblok: storyblok, path: "stories")
    request.url!.append(queryItems: [
        URLQueryItem(name: "resolve_relations", value: "article.categories,article.author")
    ])
    let (data, _) = try await storyblok.data(for: request)
    print(try JSONSerialization.jsonObject(with: data))
    ```
    
-   Kotlin
    
    ```kotlin
    val client = HttpClient {
        install(Storyblok(CDN)) {
            accessToken = "krcV6QGxWORpYLUWt12xKQtt"
        }
    }
    
    val response = client.get("stories") {
        url {
            parameters.append("resolve_relations", "article.categories,article.author")
        }
    }
    
    println(response.body<JsonElement>())
    ```

Response

```json
{
  "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-21T16:47:55.644Z",
      "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": ["Editor's Choice"],
      "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-21T16:48:09.206Z",
      "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": ["Editor's Choice", "Featured"],
      "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
    }
  ],
  "rels": [
    {
      "name": "Sarah Saturn",
      "created_at": "2024-02-16T14:34:46.888Z",
      "published_at": "2024-02-16T14:34:49.802Z",
      "id": 445020772,
      "uuid": "e7307a9e-a3c5-47ad-8f6c-a1a36fe528e2",
      "content": {
  "bio": "We like to say Sarah is, "One with marketing." She is a guru when it comes to copy-editing, page ideation, and design. Best of all, she always executes flawlessly. In her free time, she likes to read about space, update Wiki space articles and work on her mini diorama of the Apollo Lunar Module.",
        "_uid": "e83f15e0-27e3-436c-97b9-1ea163804c8d",
        "component": "author"
      },
      "slug": "sarah-saturn",
      "full_slug": "authors/sarah-saturn",
      "sort_by_date": null,
      "position": 0,
      "tag_list": [],
      "is_startpage": false,
      "parent_id": 445020177,
      "meta_data": null,
      "group_id": "caa63bbb-87cc-4f53-bde8-5efb74ef8b97",
      "first_published_at": "2024-02-16T14:34:49.802Z",
      "release_id": null,
      "lang": "default",
      "path": null,
      "alternates": [],
      "default_full_slug": null,
      "translated_slugs": null
    },
    {
      "name": "Jimmy Moons",
      "created_at": "2024-02-16T14:35:02.379Z",
      "published_at": "2024-02-16T14:35:04.658Z",
      "id": 445021953,
      "uuid": "51eed33d-855f-415c-ac0d-4404e03b89e1",
      "content": {
        "bio": "Jimmy is a front-end engineer who loves crafting beautiful and fast websites. His favorite technologies include Nuxt, Astro, Tailwind, and Storyblok. As a kid, Jimmy wanted to be the first man on Mars, but he discovered his love for developing. Thus, starting his journey toward his true passion.",
        "_uid": "98811439-d739-4886-a99f-fd2c9ebcf293",
        "component": "author"
      },
      "slug": "jimmy-moons",
      "full_slug": "authors/jimmy-moons",
      "sort_by_date": null,
      "position": -10,
      "tag_list": [],
      "is_startpage": false,
      "parent_id": 445020177,
      "meta_data": null,
      "group_id": "367ab023-f911-4810-b3d3-3fb0d6847ce1",
      "first_published_at": "2024-02-16T14:35:04.658Z",
      "release_id": null,
      "lang": "default",
      "path": null,
      "alternates": [],
      "default_full_slug": null,
      "translated_slugs": null
    },
    {
      "name": "Category A",
      "created_at": "2024-02-16T14:21:28.387Z",
      "published_at": "2024-02-16T14:21:44.231Z",
      "id": 444996626,
      "uuid": "45d968b6-5790-4fbb-aa41-5781b8edde51",
      "content": {
        "_uid": "1a218a01-69b0-4482-a948-23324c1c06e2",
        "title": "Category B",
        "component": "category"
      },
      "slug": "category-a",
      "full_slug": "categories/category-a",
      "sort_by_date": null,
      "position": 0,
      "tag_list": [],
      "is_startpage": false,
      "parent_id": 444996621,
      "meta_data": null,
      "group_id": "d036028d-1d26-415f-9021-5a03359005b4",
      "first_published_at": "2024-02-16T14:21:35.503Z",
      "release_id": null,
      "lang": "default",
      "path": null,
      "alternates": [],
      "default_full_slug": null,
      "translated_slugs": null
    },
    {
      "name": "Category B",
      "created_at": "2024-02-16T14:21:41.703Z",
      "published_at": "2024-02-16T14:21:47.299Z",
      "id": 444996629,
      "uuid": "d8e48716-0ecf-4059-b568-343bf54e4128",
      "content": {
        "_uid": "1a218a01-69b0-4482-a948-23324c1c06e2",
        "title": "Category A",
        "component": "category"
      },
      "slug": "category-b",
      "full_slug": "categories/category-b",
      "sort_by_date": null,
      "position": 0,
      "tag_list": [],
      "is_startpage": false,
      "parent_id": 444996621,
      "meta_data": null,
      "group_id": "933aae5e-458a-4ffc-973e-e9314b6a0688",
      "first_published_at": "2024-02-16T14:21:35.503Z",
      "release_id": null,
      "lang": "default",
      "path": null,
      "alternates": [],
      "default_full_slug": null,
      "translated_slugs": null
    },
    {
      "name": "Category C",
      "created_at": "2024-02-16T14:21:55.856Z",
      "published_at": "2024-02-16T14:21:57.785Z",
      "id": 444996710,
      "uuid": "a6af7728-eadf-4428-8cf5-343304857374",
      "content": {
        "_uid": "e114cd77-363d-4368-96fc-e0be712234aa",
        "title": "Category C",
        "component": "category"
      },
      "slug": "category-c",
      "full_slug": "categories/category-c",
      "sort_by_date": null,
      "position": -10,
      "tag_list": [],
      "is_startpage": false,
      "parent_id": 444996621,
      "meta_data": null,
      "group_id": "d7d49882-9e79-42d7-9208-ad0285fce790",
      "first_published_at": "2024-02-16T14:21:57.785Z",
      "release_id": null,
      "lang": "default",
      "path": null,
      "alternates": [],
      "default_full_slug": null,
      "translated_slugs": null
    }
  ],
  "links": []
}
```

## Pagination

-   [Previous: Retrieving Stories in a Particular Language](/docs/api/content-delivery/v2/stories/examples/retrieving-stories-in-a-particular-language)
-   [Next: Sorting by Fields Associated with a Story Type](/docs/api/content-delivery/v2/stories/examples/sorting-by-fields-associated-with-a-story-type)
