---
title: Retrieve a Single Datasource
description: Retrieve a single datasource by ID using Storyblok's Content Delivery API to access key-value pairs for options and settings.
url: https://storyblok.com/docs/api/content-delivery/v2/datasources/retrieve-a-single-datasource
---

# Retrieve a Single Datasource

Returns a single [datasource object](/docs/api/content-delivery/v2/datasources/the-datasource-object).

GET

```html
https://api.storyblok.com/v2/cdn/datasources/:id
```

## Path parameters

-   `:id` (number)
    
    The datasource ID
    

## Query parameters

-   `token` (required) (string)
    
    A preview or public [access token](/docs/concepts/access-tokens)
    

## Response properties

-   `datasource`
    
    A single [datasource object](/docs/api/content-delivery/v2/datasources/the-datasource-object)
    
-   `cv` (number)
    
    Cached version Unix timestamp (see [Cache Invalidation](/docs/api/content-delivery/v2/getting-started/cache-invalidation))
    

## Examples

-   cURL
    
    ```shellscript
    curl "https://api.storyblok.com/v2/cdn/datasources/product-labels\
    ?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/datasources/product-labels', {})
      console.log({ response })
    } catch (error) {
      console.log(error)
    }
    ```
    
-   PHP
    
    ```php
    $client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');
    
    $client->get('datasources/product-labels')->getBody();
    ```
    
-   Java
    
    ```java
    HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/datasources/product-labels?token=ask9soUkv02QqbZgmZdeDAtt")
      .asString();
    ```
    
-   C#
    
    ```csharp
    var client = new RestClient("https://api.storyblok.com/v2/cdn/datasources/product-labels?token=ask9soUkv02QqbZgmZdeDAtt");
    var request = new RestRequest(Method.GET);
    
    IRestResponse response = client.Execute(request);
    ```
    
-   Python
    
    ```python
    import requests
    
    url = "https://api.storyblok.com/v2/cdn/datasources/product-labels"
    
    querystring = {"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.get('datasources/product-labels')
    ```
    
-   Swift
    
    ```swift
    let storyblok = URLSession(storyblok: .cdn(accessToken: "ask9soUkv02QqbZgmZdeDAtt"))
    let request = URLRequest(storyblok: storyblok, path: "datasources/product-labels")
    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("datasources/product-labels")
    
    println(response.body<JsonElement>())
    ```

Response

```json
{
  "datasource": {
    "id": 313699,
    "name": "Background Color Options",
    "slug": "background-color-options",
    "dimensions": []
  },
  "cv": 1710350440
}
```

## Pagination

-   [Previous: The Space Object](/docs/api/content-delivery/v2/spaces/the-space-object)
-   [Next: Retrieve Multiple Datasources](/docs/api/content-delivery/v2/datasources/retrieve-multiple-datasources)
