> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.casestudies.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.casestudies.dev/_mcp/server.

# Batch semantic search

POST https://whatsapp-backend-knd2.onrender.com/v1/casestudies/batch
Content-Type: application/json

Run multiple semantic queries in a single API call. Ideal for AI agents
that need to research several topics at once. Max 10 queries per batch.


Reference: https://docs.casestudies.dev/api-reference/batch-search

## Authentication

- `X-API-Key` header (required) — Your casestudy.dev API key. Get one at POST /v1/keys.

## Request

### Body (application/json)

This endpoint expects an object.

- `queries` (list of V1CasestudiesBatchPostRequestBodyContentApplicationJsonSchemaQueriesItems, required)

## Response

### 200

Array of results, one per query

- `results` (list of V1CasestudiesBatchPostResponsesContentApplicationJsonSchemaResultsItems, optional)

## Types

### V1CasestudiesBatchPostRequestBodyContentApplicationJsonSchemaQueriesItems

- `query` (string, required)
- `industry` (string, optional, nullable)
- `company` (string, optional, nullable)
- `limit` (integer, optional, default: 5)

### V1CasestudiesBatchPostResponsesContentApplicationJsonSchemaResultsItems

- `data` (list of SemanticResult, optional)
- `query` (string, optional)

### SemanticResult

- `id` (string, optional)
- `title` (string, optional)
- `summary` (string, optional)
- `featured_client` (string, optional)
- `industry` (string, optional)
- `problem` (string, optional)
- `solution` (string, optional)
- `outcomes` (string, optional)
- `source_url` (string, optional)
- `tags` (list of string, optional)
- `similarity` (double, optional) — Cosine similarity score (0-1). Higher = more relevant.

## Examples

**Request**

```json
{
  "queries": [
    {
      "query": "improved onboarding conversion",
      "industry": "fintech",
      "limit": 3
    },
    {
      "query": "reduced customer churn with data",
      "limit": 3
    }
  ]
}
```

**Response**

```json
{
  "results": [
    {
      "data": [
        {
          "id": "string",
          "title": "string",
          "summary": "string",
          "featured_client": "string",
          "industry": "string",
          "problem": "string",
          "solution": "string",
          "outcomes": "string",
          "source_url": "string",
          "tags": [
            "string"
          ],
          "similarity": 1.1
        }
      ],
      "query": "string"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://whatsapp-backend-knd2.onrender.com/v1/casestudies/batch"

payload = { "queries": [
        {
            "query": "improved onboarding conversion",
            "industry": "fintech",
            "limit": 3
        },
        {
            "query": "reduced customer churn with data",
            "limit": 3
        }
    ] }
headers = {
    "X-API-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://whatsapp-backend-knd2.onrender.com/v1/casestudies/batch';
const options = {
  method: 'POST',
  headers: {'X-API-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"queries":[{"query":"improved onboarding conversion","industry":"fintech","limit":3},{"query":"reduced customer churn with data","limit":3}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://whatsapp-backend-knd2.onrender.com/v1/casestudies/batch"

	payload := strings.NewReader("{\n  \"queries\": [\n    {\n      \"query\": \"improved onboarding conversion\",\n      \"industry\": \"fintech\",\n      \"limit\": 3\n    },\n    {\n      \"query\": \"reduced customer churn with data\",\n      \"limit\": 3\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-API-Key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://whatsapp-backend-knd2.onrender.com/v1/casestudies/batch")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"queries\": [\n    {\n      \"query\": \"improved onboarding conversion\",\n      \"industry\": \"fintech\",\n      \"limit\": 3\n    },\n    {\n      \"query\": \"reduced customer churn with data\",\n      \"limit\": 3\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://whatsapp-backend-knd2.onrender.com/v1/casestudies/batch")
  .header("X-API-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"queries\": [\n    {\n      \"query\": \"improved onboarding conversion\",\n      \"industry\": \"fintech\",\n      \"limit\": 3\n    },\n    {\n      \"query\": \"reduced customer churn with data\",\n      \"limit\": 3\n    }\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://whatsapp-backend-knd2.onrender.com/v1/casestudies/batch', [
  'body' => '{
  "queries": [
    {
      "query": "improved onboarding conversion",
      "industry": "fintech",
      "limit": 3
    },
    {
      "query": "reduced customer churn with data",
      "limit": 3
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-Key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://whatsapp-backend-knd2.onrender.com/v1/casestudies/batch");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"queries\": [\n    {\n      \"query\": \"improved onboarding conversion\",\n      \"industry\": \"fintech\",\n      \"limit\": 3\n    },\n    {\n      \"query\": \"reduced customer churn with data\",\n      \"limit\": 3\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-API-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["queries": [
    [
      "query": "improved onboarding conversion",
      "industry": "fintech",
      "limit": 3
    ],
    [
      "query": "reduced customer churn with data",
      "limit": 3
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://whatsapp-backend-knd2.onrender.com/v1/casestudies/batch")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```