---
title: Search
description: Retrieve stories by meaning through a natural-language query.
url: https://www.storyblok.com/docs/api/content-delivery/v2/strata/search
---

# Search

Retrieve stories by meaning through a natural-language query.

GET

```html
https://api.storyblok.com/v2/cdn/strata/search
```

## Query parameters

-   `q` (string)
    
    The search term. Write it as a natural-language question or phrase.
    
-   `version` (string)
    
    The content version to retrieve: `draft` or `published`. Default is `published`. Retrieving `draft` requires a preview access token.
    
-   `limit` (integer)
    
    The maximum number of results to return. Default is `25`. Maximum is `100`, or `50` when `starts_with` or `content_type` is set.
    
-   `starts_with` (string)
    
    Filter by the story’s `full_slug` to return items starting with the given value. Matches only the default-language slug, so language prefixes (for example, `de/`) and translated slugs return no results.
    
-   `content_type` (string)
    
    Retrieve stories of a specific content type block. For example, `content_type=page`.
    
-   `token` (required) (string)
    
    A preview or public [access token](https://www.storyblok.com/docs/concepts/access-tokens) configured in a space.
    

## Response properties

-   `results` (StrataSearchResults)
    
    An array of search result objects, ranked by `score` with the best match first. A story can appear more than once if it has multiple matching passages.
    
    Show child properties
    
    -   `excerpt` (string)
        
        The passage of story content that matches the search term.
        
    -   `score` (number)
        
        How closely the result matches the search term. A higher value means a closer match.
        
    -   `story` (object)
        
        The story that contains the matching passage.
        
        Show child properties
        
        -   `id` (integer)
            
            Numeric ID of the story.
            
        -   `slug` (string)
            
            Full slug of the story.
            
        -   `name` (string)
            
            Name of the story.
            
        
    

## Examples

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

## Pagination

-   [Previous: Retrieve Multiple Tags](/docs/api/content-delivery/v2/tags/retrieve-multiple-tags)
-   [Next: Retrieve Multiple Taxonomies](/docs/api/content-delivery/v2/taxonomies/retrieve-multiple-taxonomies)
