Skip to navigation

Get Revenue

Get the revenue, orders and average order value that searches earned, by day, from purchase events. A purchased item counts as direct when its event carries the search’s queryID, and as assisted when the same shopper clicked it after a search in the 24 hours before. Also the shopper funnel: searched, clicked, added to cart and purchased. arms splits the numbers by the index that answered each search, so the copies in a group assignment can be compared.

Authentication

AuthorizationBearer

A search key, issued by Captain. Sent as Authorization: Bearer <key>.

Path parameters

indexstringRequiredformat: "^[a-z0-9][a-z0-9_-]{0,47}$"
index name

Query parameters

start_datestringOptionalformat: "date"

first day, UTC, inclusive (YYYY-MM-DD). Default: 6 days before end_date (a 7-day window)

end_datestringOptionalformat: "date"

last day, UTC, inclusive (YYYY-MM-DD). Default: today. At most 366 days from start_date

start_timestringOptional

an exact start instead of start_date: unix seconds, or ISO 8601 in UTC (2026-10-10T10:00:00Z). start_date and end_date in the reply are then the UTC days the window touches

end_timestringOptional

an exact end (exclusive): unix seconds or ISO 8601 with Z. Default: now; never later than now. Must be after start_time

indexesstringOptional

more indexes to count, comma separated (an experiment’s arms, each a copy of the index); at most 20 in all. The key must be able to read each one

armstringOptional

only this index’s searches and the orders they earned: the path’s index or one in indexes

currencystringOptionalformat: "^[A-Za-z]{3}$"

only purchases in this currency (one that names none counts in any). Default: the currency of the most purchases

served_indexstringOptional

the same as arm: one group copy’s traffic (a search routed by the index’s assignment is logged under the index, and its copy is an arm of this report)

group_byenumOptional

user: one row per shopper and index (RevenueByUser), for a readout that resamples whole shoppers. Left out: totals, days and arms (RevenueByDay)

Allowed values:
by_userbooleanOptionalDefaults to false

true: the same as group_by=user

Response headers

X-Captain-Applied-Seqinteger

the last update seq search had applied when this request started; the answer reflects at least that much (GET …/updates applied_seq). Not on 401 or 403, nor for an index this server does not have

X-Captain-Index-IncarnationstringOptional

the index’s incarnation, an opaque string: it changes only when the index is deleted and created again (whose seqs start again at 1), or restored from a backup (whose seqs continue from the backup’s). Sent with X-Captain-Applied-Seq

Response

report
RevenueByDayobject
OR
RevenueByUserobject

group_by=user