> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keywordsai.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Search experiment logs

Search experiment logs using filters with the V2 API.

## Authentication

* API key: `Authorization: Bearer <API key>`

## Path Parameters

<ParamField path="experiment_id" type="string" required>
  The ID of the experiment to search logs for.
</ParamField>

## Request Body

<RequestExample>
  ```json Request theme={"system"}
  {
    "filters": {
      "comparison_key": {
        "operator": "in",
        "value": ["b7c84ae535cf66aef2f862eb260a14bd1aa9310220076cf196fec40860ac0d11"]
      }
    }
  }
  ```
</RequestExample>

## Examples

<CodeGroup>
  ```python Python theme={"system"}
  import requests

  experiment_id = "experiment_id_123"
  url = f"https://api.keywordsai.co/api/v2/experiments/{experiment_id}/logs/list"
  headers = {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json"
  }

  data = {
      "filters": {
          "comparison_key": {
              "operator": "in",
              "value": ["b7c84ae535cf66aef2f862eb260a14bd1aa9310220076cf196fec40860ac0d11"]
          }
      }
  }

  response = requests.post(url, headers=headers, json=data)
  print(response.json())
  ```

  ```bash cURL theme={"system"}
  curl -X POST "https://api.keywordsai.co/api/v2/experiments/{experiment_id}/logs/list" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "filters": {
        "comparison_key": {
          "operator": "in",
          "value": ["key_123"]
        }
      }
    }'
  ```
</CodeGroup>

## Response

<ResponseExample>
  ```json 200 OK theme={"system"}
  {
    "count": 1,
    "results": [
      {
        "id": "log_id_123",
        "input": {},
        "output": {},
        "comparison_key": "b7c84ae535cf66aef2f862eb260a14bd1aa9310220076cf196fec40860ac0d11"
      }
    ]
  }
  ```
</ResponseExample>
