Skip to main content
POST
/
api
/
v2
/
experiments
/
{experiment_id}
/
logs
/
list
{
  "filters": {
    "comparison_key": {
      "operator": "in",
      "value": ["b7c84ae535cf66aef2f862eb260a14bd1aa9310220076cf196fec40860ac0d11"]
    }
  }
}
{
  "count": 1,
  "results": [
    {
      "id": "log_id_123",
      "input": {},
      "output": {},
      "comparison_key": "b7c84ae535cf66aef2f862eb260a14bd1aa9310220076cf196fec40860ac0d11"
    }
  ]
}
Search experiment logs using filters with the V2 API.

Authentication

  • API key: Authorization: Bearer <API key>

Path Parameters

experiment_id
string
required
The ID of the experiment to search logs for.

Request Body

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

Examples

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())

Response

{
  "count": 1,
  "results": [
    {
      "id": "log_id_123",
      "input": {},
      "output": {},
      "comparison_key": "b7c84ae535cf66aef2f862eb260a14bd1aa9310220076cf196fec40860ac0d11"
    }
  ]
}