Export data
Opik gives you several ways to export the data you’ve logged — pick the one that fits your workflow.
SDK
The Python and TypeScript SDKs let you search and export traces, spans, and threads programmatically.
Traces
Python
TypeScript
Spans
Threads
Filtering with OQL
All search methods accept a filter_string / filterString using the Opik Query Language (OQL):
- String values must be wrapped in double quotes
- Multiple conditions can be combined with
AND(OR is not supported) - DateTime fields require ISO 8601 format (e.g.,
"2024-01-01T00:00:00Z") - Use dot notation for nested fields:
metadata.model,feedback_scores.accuracy
Common filter examples:
The full list of supported columns per entity type is documented below.
REST API
Use the /traces and /spans endpoints to export data. Both endpoints are paginated.
The REST API filter parameter has limited flexibility as it was designed for use with the Opik UI.
For complex queries, use the SDK instead.
UI
Select the traces or spans you want to export in the Opik dashboard and click Export CSV in the Actions dropdown.

The UI exports up to 100 traces or spans at a time. For larger exports use the SDK or CLI.
Command-line tools
The opik export and opik import commands let you export traces, spans, datasets, prompts, and experiments to local JSON or CSV files, and import them back — useful for migrations, backups, and cross-environment syncs.
Export
TYPE is one of: all, dataset, project, experiment, prompt
Import
Imports are automatically resumable — if interrupted, re-run the same command and it picks up where it left off using a local migration_manifest.db.
Migrating between environments
See the CLI help (opik export --help / opik import --help) for all options and troubleshooting.