Use the oevents CLI to export data
How to export Experimentation Events Export data with the Optimizely Experimentation oevents CLI.
oevents wraps the Authentication API and the AWS CLI so you can list and download Experimentation Events Export data with one command. Use it when you want a download script that runs without code. Use the Authentication API directly if you need to integrate the credential exchange into your own pipeline.
The oevents CLI is a Bash script that runs on macOS and most GNU/Linux distributions. For source code and contribution guidelines, see the oevents GitHub repository.
NoteThe
oeventsCLI supports Amazon S3 only. For Google Cloud Storage, use the Authentication API with the Google Cloud CLI (gcloud storage).
Prerequisites
Install the following tools before running oevents:
Note
oeventsdoes not run on Windows. Use the Authentication API directly, or runoeventsthrough Windows Subsystem for Linux 2 (WSL2).
Download the CLI
Download the oevents CLI as a ZIP archive from the GitHub repository.
Install the CLI
From the directory containing oevents, make the script executable:
chmod +x oeventsRun oevents with an explicit path to the script:
./oevents helpTo run oevents from anywhere, copy it to a directory on your PATH:
sudo cp oevents /usr/local/bin/
oevents helpWhen oevents is installed, generate the Personal Access Token it uses to authenticate.
Generate a Personal Access Token
A Personal Access Token (PAT) is the credential oevents uses to call the Authentication API on your behalf. Generate one in Optimizely by following Manage your API tokens.
Store your PAT in the OPTIMIZELY_API_TOKEN environment variable:
export OPTIMIZELY_API_TOKEN=PERSONAL_ACCESS_TOKENAuthenticate
Acquire temporary AWS credentials:
oevents authList and download data
List the available data for a given event type and date:
oevents ls \
--type events \
--date 2025-07-01Download decision data for an experiment within a date range:
oevents load \
--type decisions \
--start 2025-07-01 \
--end 2025-07-05 \
--experiment 12345
NoteDates and times in
oeventscommands are interpreted as UTC.
