Skip to main content
POST
/
api
/
analytics
/
timeseries
Python
import requests

url = "https://app.langwatch.ai/api/analytics/timeseries"

payload = {
    "startDate": 123,
    "endDate": 123,
    "series": [
        {
            "key": "<string>",
            "subkey": "<string>",
            "filters": {
                "topics.topics": ["<string>"],
                "topics.subtopics": ["<string>"],
                "metadata.user_id": ["<string>"],
                "metadata.thread_id": ["<string>"],
                "metadata.customer_id": ["<string>"],
                "metadata.labels": ["<string>"],
                "metadata.key": ["<string>"],
                "metadata.value": ["<string>"],
                "metadata.prompt_ids": ["<string>"],
                "traces.origin": ["<string>"],
                "traces.error": ["<string>"],
                "traces.name": ["<string>"],
                "spans.type": ["<string>"],
                "spans.model": ["<string>"],
                "evaluations.evaluator_id": ["<string>"],
                "evaluations.evaluator_id.guardrails_only": ["<string>"],
                "evaluations.evaluator_id.has_passed": ["<string>"],
                "evaluations.evaluator_id.has_score": ["<string>"],
                "evaluations.evaluator_id.has_label": ["<string>"],
                "evaluations.passed": ["<string>"],
                "evaluations.score": ["<string>"],
                "evaluations.state": ["<string>"],
                "evaluations.label": ["<string>"],
                "events.event_type": ["<string>"],
                "events.metrics.key": ["<string>"],
                "events.metrics.value": ["<string>"],
                "events.event_details.key": ["<string>"],
                "annotations.hasAnnotation": ["<string>"]
            },
            "asPercent": True
        }
    ],
    "timeZone": "<string>"
}
headers = {
    "X-Auth-Token": "<api-key>",
    "Content-Type": "application/json"
}

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

print(response.text)
{
  "currentPeriod": [
    {}
  ],
  "previousPeriod": [
    {}
  ]
}

Documentation Index

Fetch the complete documentation index at: https://langwatch.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

X-Auth-Token
string
header
required

Project API key for sending traces and accessing project-scoped resources. Format: sk-lw-... (no underscore). Obtain one by creating a project via the Admin API or the LangWatch UI.

Body

application/json
startDate
required
endDate
required
series
object[]
required
timeZone
string
required
query
string
filters
object
traceIds
string[]
negateFilters
boolean
groupBy
enum<string>
Available options:
topics.topics,
traces.trace_name,
metadata.user_id,
metadata.thread_id,
metadata.customer_id,
metadata.labels,
metadata.model,
metadata.span_type,
sentiment.thumbs_up_down,
events.event_type,
evaluations.evaluation_passed,
evaluations.evaluation_label,
evaluations.evaluation_processing_state,
error.has_error
groupByKey
string
timeScale
Allowed value: "full"

Response

Timeseries analytics data with current and previous periods

currentPeriod
object[]
required
previousPeriod
object[]
required