experiments
POST
https://lucidace.com /v1/projects/{project_id}/experiments/designs/did-events Scope experiment:readDifference-in-differences between treated and control regions from stored events: each cell is the region-days of a group and period, treated as independent samples (valid under parallel trends).
Parameters
project_idstringpathrequiredRequest body
application/json
alphanumbercontrolstring[]Control regions; empty = every other region.
geostringrequiredcountry | region | city | property:<key>.intervention_atstringrequiredFirst post-period day.
post_daysintegerrequiredpre_daysintegerrequiredtreatedstring[]requiredvalueobjectrequiredThe metric, summed per region and day.
{
"alpha": 0,
"control": [
"string"
],
"geo": "string",
"intervention_at": "2024-01-01T00:00:00Z",
"post_days": 0,
"pre_days": 0,
"treated": [
"string"
],
"value": {}
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments/designs/did-events" \
-H "Content-Type: application/json" \
-d '{"alpha":0,"control":["string"],"geo":"string","intervention_at":"2024-01-01T00:00:00Z","post_days":0,"pre_days":0,"treated":["string"],"value":{}}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"ci_high": 0,
"ci_low": 0,
"effect": 0,
"p_value": 0,
"se": 0
}Schema
ci_highnumberrequiredci_lownumberrequiredeffectnumberrequiredp_valuenumberrequiredsenumberrequired400
404
503
POST
https://lucidace.com /v1/projects/{project_id}/experiments/designs/geo-lift Scope experiment:readGeo-lift of an intervention on the treated regions, from stored events.
Parameters
project_idstringpathrequiredRequest body
application/json
donorsstring[]Donor pool; empty = every other region (the 50 largest in the pre-period).
geostringrequiredcountry | region | city | property:<key>.intervention_atstringrequiredFirst treated day.
post_daysintegerrequiredpre_daysintegerrequiredtreatedstring[]requiredRegions that got the treatment; their daily values are summed.
valueobjectrequiredThe metric (event, filters,
property to sum, math = unique_persons).{
"donors": [
"string"
],
"geo": "string",
"intervention_at": "2024-01-01T00:00:00Z",
"post_days": 0,
"pre_days": 0,
"treated": [
"string"
],
"value": {}
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments/designs/geo-lift" \
-H "Content-Type: application/json" \
-d '{"donors":["string"],"geo":"string","intervention_at":"2024-01-01T00:00:00Z","post_days":0,"pre_days":0,"treated":["string"],"value":{}}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"actual": [
0
],
"cumulative": 0,
"effect_per_period": 0,
"p_value": 0,
"periods": [
"string"
],
"placebos": 0,
"post_rmspe": 0,
"pre_periods": 0,
"pre_rmspe": 0,
"relative_lift": 0,
"synthetic": [
0
],
"weights": [
{
"region": "string",
"weight": 0
}
]
}Schema
actualnumber[]requiredcumulativenumberrequiredeffect_per_periodnumberrequiredp_valuenumberPlacebo-in-space p-value (rank of the post/pre RMSPE ratio among the donors).
periodsstring[]requiredOne label per period (a day for
geo-lift, the index for synthetic).placebosintegerrequiredpost_rmspenumberrequiredpre_periodsintegerrequiredIndex of the first post-period point.
pre_rmspenumberrequiredrelative_liftnumbersyntheticnumber[]requiredweightsDonorWeight[]requiredDonor weights (non-zero ones first).
Show child parameters
regionstringrequiredweightnumberrequired400
404
503
POST
https://lucidace.com /v1/projects/{project_id}/experiments/designs/switchback/analyze Scope experiment:readTreatment effect of a switchback after dropping washout slices, with cluster-robust errors. Assumes carryover fades within `washout` slices and no interference between units.
Parameters
project_idstringpathrequiredRequest body
application/json
alphanumbercluster_bystringWhat observations are correlated with each other.
observationsObservation[]requiredShow child parameters
sliceintegerrequiredtreatedbooleanrequiredunitstringrequiredvaluenumberrequiredwashoutinteger{
"alpha": 0,
"cluster_by": "unit",
"observations": [
{
"slice": 0,
"treated": true,
"unit": "string",
"value": 0
}
],
"washout": 0
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments/designs/switchback/analyze" \
-H "Content-Type: application/json" \
-d '{"alpha":0,"cluster_by":"unit","observations":[{"slice":0,"treated":true,"unit":"string","value":0}],"washout":0}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"ci_high": 0,
"ci_low": 0,
"dropped_washout": 0,
"effect": 0,
"p_value": 0,
"se": 0,
"used": 0
}Schema
ci_highnumberrequiredci_lownumberrequireddropped_washoutintegerrequiredObservations dropped because they fell inside a washout window.
effectnumberrequiredp_valuenumberrequiredsenumberrequiredusedintegerrequired400
404
POST
https://lucidace.com /v1/projects/{project_id}/experiments/designs/switchback/analyze-events Scope experiment:readTreatment effect of a switchback flag from stored events: the metric per region (or overall) and slice, the arm of each slice recomputed from the flag's design, washout slices dropped.
Parameters
project_idstringpathrequiredRequest body
application/json
alphanumberflag_keystringrequiredThe flag whose
filters.design is the switchback: its key and salt (the flag's salt, or its id when none is set) decide every block's arm.geostringRegion key (
country | region | city | property:<key>) when the design has a geo_key; absent = one switchback for everyone.run_lenintegerrequiredSlices per block (the design's
run_len).saltstringrequiredslice_daysintegerrequiredWhole days per slice (event cells are daily).
slicesintegerrequiredstartstringrequiredStart of slice 0 (the design's
start, truncated to its day).valueobjectrequiredThe metric (event, filters,
property to sum, math = unique_persons), summed per day.washoutinteger{
"alpha": 0,
"flag_key": "string",
"geo": "string",
"run_len": 0,
"salt": "string",
"slice_days": 0,
"slices": 0,
"start": "2024-01-01T00:00:00Z",
"value": {},
"washout": 0
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments/designs/switchback/analyze-events" \
-H "Content-Type: application/json" \
-d '{"alpha":0,"flag_key":"string","geo":"string","run_len":0,"salt":"string","slice_days":0,"slices":0,"start":"2024-01-01T00:00:00Z","value":{},"washout":0}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
400
404
503
POST
https://lucidace.com /v1/projects/{project_id}/experiments/designs/switchback/schedule Scope experiment:readTime-sliced assignment: every unit alternates control/treatment blocks in a randomised order, balanced per unit. Slice length and the clock are the caller's: slice `k` is just an index.
Parameters
project_idstringpathrequiredRequest body
application/json
run_lenintegerrequiredSlices per block (an arm is served for one block before switching).
seedintegerslicesintegerrequiredunitsstring[]requiredUnits or regions that switch.
washoutintegerSlices after a switch flagged
washout (served, dropped in analysis).{
"run_len": 0,
"seed": 0,
"slices": 0,
"units": [
"string"
],
"washout": 0
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments/designs/switchback/schedule" \
-H "Content-Type: application/json" \
-d '{"run_len":0,"seed":0,"slices":0,"units":["string"],"washout":0}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"slots": [
{
"slice": 0,
"treated": true,
"unit": "string",
"washout": true
}
]
}Schema
slotsSlot[]requiredShow child parameters
sliceintegerrequiredtreatedbooleanrequiredunitstringrequiredwashoutbooleanrequiredThe slice follows a switch within the washout window: serve it, but drop it in analysis.
400
404
POST
https://lucidace.com /v1/projects/{project_id}/experiments/designs/synthetic Scope experiment:readSynthetic control on caller-supplied series.
Parameters
project_idstringpathrequiredRequest body
application/json
donorsobjectrequired{region: series}, each as long as treated.pre_periodsintegerrequiredNumber of pre-period points.
treatednumber[]required{
"donors": {},
"pre_periods": 0,
"treated": [
0
]
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/experiments/designs/synthetic" \
-H "Content-Type: application/json" \
-d '{"donors":{},"pre_periods":0,"treated":[0]}'TypeScript
Python
Go
PHP
Ruby
Java
GET
https://lucidace.com /v1/projects/{project_id}/experiments/health Scope experiment:readExperiment health across the project's newest experiments.
Parameters
project_idstringpathrequiredCode samples
cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/experiments/health"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"items": [
{
"experiment_id": "string",
"issues": [
{
"detail": "string",
"kind": "string"
}
],
"name": "string",
"status": "string"
}
],
"scanned": 0
}Schema
itemsExperimentHealth[]requiredExperiments with at least one issue.
Show child parameters
experiment_idstringrequiredissuesExperimentsHealthIssue[]requiredShow child parameters
detailstringrequiredkindstringrequiredstalled | flag_edited | paused_long | zombie | undecided.namestringrequiredstatusstringrequiredscannedintegerrequired404
Updated