Analytics API
The Analytics API provides comprehensive search analytics data for your Marqo implementation. Access metrics, trends, and insights about search behavior through a RESTful interface.
Base URL
https://ecom.marqo-ep.ai/api/v1/analytics
Authentication
Include your API key in the Authorization header of every request using the Bearer scheme:
Authorization: Bearer {api_key}
Common Parameters
Customer ID
| Parameter | Type | Description |
|---|---|---|
customerId | String (required) | Your pixel account identifier |
Time Range Parameters
You must specify either days or both start and end:
| Parameter | Type | Description |
|---|---|---|
days | Integer | Number of days to look back (minimum: 1) |
start | ISO 8601 datetime | Start of the time range (UTC) |
end | ISO 8601 datetime | End of the time range (UTC) |
Examples:
Using days:
?days=7
Using date range:
?start=2025-01-01T00:00:00Z&end=2025-01-31T23:59:59Z
Important: When providing
startandend,endmust be later thanstart. Timestamps are truncated to the hour (minutes and seconds are ignored), so 2025-12-05T10:59Z is treated as 2025-12-05T10:00:00Z.
Context Type
| Parameter | Type | Description |
|---|---|---|
context | String (enum) | The section context for analytics data |
Valid values:
searches- Analytics for search queriescollections- Analytics for collection views
The recommendation and agentic endpoints take the same context parameter with their own value sets.
Term Filter
| Parameter | Type | Description |
|---|---|---|
term | String (optional) | Filter analytics for a specific search term or collection name |
Label
| Parameter | Type | Description |
|---|---|---|
label | String (optional) | Scope analytics to a single label (namespace). Append label=<label> to any analytics request. |
Labels let you segment analytics into namespaces that are tracked alongside your global metrics. Two kinds of labels are available:
- A/B experiments —
pixel_experiment:<experiment_id>, where<experiment_id>is the experiment you specified in the Pixel. - Traffic source —
user_source:<traffic_source>, where<traffic_source>is one of the traffic source tags sent with your events (for example,user_source:web_prod).
Each label is its own namespace, so a labeled request returns metrics for only that namespace. The same events are still aggregated into your global (unlabeled) metrics, so requests without a label parameter continue to report combined totals across all sources.
Use the Labels endpoint to discover which labels are currently available for your account.
Example:
?label=user_source:web_prod
Metrics Reference
When using the Time Series endpoint, you must specify one of the following metrics:
| Metric | Value | Description |
|---|---|---|
| Total Queries | totalQueries | Total number of search queries or collection views |
| Click-Through Rate | clickThroughRate | Percentage of queries that resulted in clicks |
| Add to Cart Rate | addToCartRate | Percentage of queries that resulted in add-to-cart actions |
| Conversion Rate | conversionRate | Percentage of queries that resulted in purchases |
| Average Order Value | averageOrderValue | Average monetary value of purchases |
| Total Revenue | totalRevenue | Total revenue generated |
| Total Clicks | totalClicks | Total number of clicks on results |
| Total Add to Carts | totalAddToCarts | Total number of add-to-cart actions |
| Total Purchases | totalPurchases | Total number of completed purchases |
| Sessions Count | sessionsCount | Total number of unique sessions |
The agentic time series endpoint counts conversations rather than queries, so it accepts totalConversations in place of totalQueries.
Endpoints
Get Available Accounts
Retrieves all pixel IDs associated with your account.
GET /accounts
Example Request:
curl "https://ecom.marqo-ep.ai/api/v1/analytics/accounts" \
-H "Authorization: Bearer {api_key}"
Response:
{
"customerIds": [
{
"customerId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"label": "label"
},
{
"customerId": "f6e5d4c3-b2a1-4f5e-6d7c-8b9a0e1f2a3b",
"label": "label"
}
]
}
Error Responses:
404: No pixel ids found for your account
Labels
Returns the list of labels (namespaces) available for your account. Use any returned label as the value of the label query parameter on the other analytics endpoints to scope results to that namespace.
GET /labels
Query Parameters:
customerId(required)
Example Request:
curl "https://ecom.marqo-ep.ai/api/v1/analytics/labels?customerId=a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d" \
-H "Authorization: Bearer {api_key}"
Response:
{
"labels": [
"pixel_experiment:summer_ranking_test",
"pixel_experiment:pdp_layout_v2",
"user_source:web_prod",
"user_source:app_prod",
"user_source:web_mobile_prod"
]
}
Response Fields:
labels: Array of available labels. Each label is one of:pixel_experiment:<experiment_id>— an A/B experiment you specified in the Pixel.user_source:<traffic_source>— a traffic source derived from the traffic source tags sent with your events.
Applying a label:
Append label=<label> to any analytics request to scope it to that namespace. For example, to get the overview for web_prod traffic only:
curl "https://ecom.marqo-ep.ai/api/v1/analytics/overview?customerId=a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d&days=3&context=searches&label=user_source:web_prod" \
-H "Authorization: Bearer {api_key}"
Labels are populated from data sent through the Event Tracking API. Traffic source labels only appear once events carrying the corresponding traffic source tags have been ingested.
Overview Analytics
Provides high-level analytics overview for the specified time period. Optionally filter by a specific search term or collection.
GET /overview
Query Parameters:
customerId(required)context(required):searchesorcollectionsdaysORstart+end(required): Time rangeterm(optional): Filter analytics for a specific search term or collection namelabel(optional): Scope to a single namespace. See Label and the Labels endpoint
Example Request (All Terms):
curl "https://ecom.marqo-ep.ai/api/v1/analytics/overview?customerId=a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d&days=3&context=searches" \
-H "Authorization: Bearer {api_key}"
Example Request (Specific Term):
curl "https://ecom.marqo-ep.ai/api/v1/analytics/overview?customerId=a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d&days=3&context=searches&term=technology" \
-H "Authorization: Bearer {api_key}"
Response:
{
"totalQueries": 116375,
"clickThroughRate": 0.241,
"addToCartRate": 0.0,
"conversionRate": 0.149,
"averageOrderValue": 0.064,
"totalRevenue": 1114,
"sessionsCount": 32011
}
Response Fields:
totalQueries: Total number of queries in the time periodclickThroughRate: Decimal representation of CTR (0.241 = 24.1%)addToCartRate: Decimal representation of ATC rateconversionRate: Decimal representation of conversion rateaverageOrderValue: Average order value in currency unitstotalRevenue: Total revenue generatedsessionsCount: Number of unique user sessions
Search Terms Analytics
Returns analytics data for search terms within the specified period, sorted by total queries in descending order.
GET /terms
Query Parameters:
customerId(required)context(required):searchesorcollectionsdaysORstart+end(required): Time rangelimit(optional): Number of terms to return (1-1000, default: 100)label(optional): Scope to a single namespace. See Label and the Labels endpoint
Example Request:
curl "https://ecom.marqo-ep.ai/api/v1/analytics/terms?customerId=a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d&days=3&context=searches&limit=5" \
-H "Authorization: Bearer {api_key}"
Response:
{
"terms": [
{
"term": "logo",
"totalQueries": 1241,
"totalRevenue": 7,
"clickThroughRate": 0.242,
"addToCartRate": 0.0,
"conversionRate": 0.211
},
{
"term": "text",
"totalQueries": 1150,
"totalRevenue": 7,
"clickThroughRate": 0.286,
"addToCartRate": 0.0,
"conversionRate": 0.215
}
]
}
Response Fields (per term):
term: The search term or collection nametotalQueries: Number of times this term was queriedtotalRevenue: Revenue generated from this termclickThroughRate: CTR for this specific termaddToCartRate: ATC rate for this termconversionRate: Conversion rate for this term
Funnel Analytics
Provides funnel conversion analytics showing the progression from queries to purchases. Optionally filter by a specific search term or collection.
GET /funnel
Query Parameters:
customerId(required)context(required):searchesorcollectionsdaysORstart+end(required): Time rangeterm(optional): Filter analytics for a specific search term or collection namelabel(optional): Scope to a single namespace. See Label and the Labels endpoint
Example Request (All Terms):
curl "https://ecom.marqo-ep.ai/api/v1/analytics/funnel?customerId=a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d&days=3&context=searches" \
-H "Authorization: Bearer {api_key}"
Example Request (Specific Term):
curl "https://ecom.marqo-ep.ai/api/v1/analytics/funnel?customerId=a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d&days=3&context=searches&term=technology" \
-H "Authorization: Bearer {api_key}"
Response:
{
"totalQueries": 116375,
"totalClicks": 28096,
"totalAddToCarts": 21037,
"totalPurchases": 17296
}
Response Fields:
totalQueries: Total queries at the top of the funneltotalClicks: Number of result clickstotalAddToCarts: Number of add-to-cart actionstotalPurchases: Number of completed purchases at the bottom of the funnel
Time Series Analytics
Returns time-series data for a specific metric over the specified period. Optionally filter by a specific search term or collection.
GET /time-series
Query Parameters:
customerId(required)context(required):searchesorcollectionsdaysORstart+end(required): Time rangemetric(required): One of the metrics listed in the Metrics Reference sectionterm(optional): Filter analytics for a specific search term or collection namelabel(optional): Scope to a single namespace. See Label and the Labels endpoint
Example Request (All Terms):
curl "https://ecom.marqo-ep.ai/api/v1/analytics/time-series?customerId=a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d&days=3&context=searches&metric=addToCartRate" \
-H "Authorization: Bearer {api_key}"
Example Request (Specific Term):
curl "https://ecom.marqo-ep.ai/api/v1/analytics/time-series?customerId=a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d&days=3&context=searches&metric=addToCartRate&term=technology" \
-H "Authorization: Bearer {api_key}"
Response:
{
"datapoints": [
{ "timestamp": "2025-11-25T00:00:00Z", "value": 0.0 },
{ "timestamp": "2025-11-25T01:00:00Z", "value": 0.0 },
{ "timestamp": "2025-11-25T02:00:00Z", "value": 0.0 },
{ "timestamp": "2025-11-25T03:00:00Z", "value": 0.0 }
]
}
Response Format:
- Returns a JSON object with an array of datapoints
- Each datapoint contains a
timestamp(ISO 8601 datetime) andvaluefor that time interval - Time series data is provided in UTC timezone
- Granularity automatically adjusts based on the time period:
- Hourly: For time periods up to 100 hours
- Daily: For time periods between 100 hours and 100 days
- Weekly: For time periods between 100 days and 100 weeks
- Monthly: For time periods between 100 weeks and 100 months
- Yearly: For time periods greater than 100 months
Recommendation Analytics
Reports on the recommendation endpoints instead of on searches and collections. There are four routes, mirroring the standard ones:
GET /overview/recommendations
GET /terms/recommendations
GET /funnel/recommendations
GET /time-series/recommendations
Each takes the same customerId, time range and label parameters as its standard counterpart, plus a context parameter that selects which shelf to report on. The type-style searches and collections values do not apply here.
Query Parameters:
customerId(required)context(required):for-you,complementaryorsimilardaysORstart+end(required): Time rangemetric(required on/time-series/recommendations): One of the metrics listed in the Metrics Referencelimit(optional,/terms/recommendationsonly): Number of terms to returnlabel(optional): Scope to a single namespace. See Label
Example Request:
curl "https://ecom.marqo-ep.ai/api/v1/analytics/overview/recommendations?customerId=a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d&days=3&context=similar" \
-H "Authorization: Bearer {api_key}"
Each route returns the same response shape as the standard endpoint it mirrors: /overview/recommendations matches Overview Analytics, /funnel/recommendations matches Funnel Analytics, /time-series/recommendations matches Time Series Analytics, and /terms/recommendations matches Search Terms Analytics with each term being a seed product id rather than a search term.
The for-you shelf has no seed-product breakdown, so /terms/recommendations is not available for context=for-you.
Agentic Analytics
Reports on conversational agent sessions. Agentic analytics are conversation-shaped rather than query-shaped: they count conversations and messages where the standard endpoints count queries.
GET /agentic/overview
GET /agentic/funnel
GET /agentic/time-series
Query Parameters:
customerId(required)context(required):chatis the only accepted valuedaysORstart+end(required): Time rangemetric(required on/agentic/time-series): One of the metrics listed in the Metrics Reference, wheretotalConversationsreplacestotalQueries
Example Request:
curl "https://ecom.marqo-ep.ai/api/v1/analytics/agentic/overview?customerId=a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d&days=3&context=chat" \
-H "Authorization: Bearer {api_key}"
/agentic/overview and /agentic/funnel mirror Overview Analytics and Funnel Analytics, reporting conversation counts and per-conversation message statistics alongside the shared click, add-to-cart, conversion and revenue figures. /agentic/time-series mirrors Time Series Analytics.
There is no agentic equivalent of the terms endpoint.
Agentic conversation rates are ratios of events to conversations, not to queries. A single conversation can produce several clicks, so these rates can exceed 1.0.
Error Responses
Errors use the same envelope as every other Ecom API endpoint: a JSON body with a single error key.
{
"error": "Error message describing what went wrong"
}
Read the message from error, not from detail. The analytics service reports its own failures under a detail key, but requests to https://ecom.marqo-ep.ai are served through the Ecom API gateway, which copies that text into error before returning it. A client parsing detail reads undefined.
| Status Code | Description | Produced by |
|---|---|---|
| 200 | Success | — |
| 400 | Invalid parameters or validation error | Analytics service |
| 401 | The API key is missing, empty, unknown, or revoked | Gateway |
| 403 | The API key does not have access to the requested account | Analytics service |
| 404 | Resource not found | Analytics service |
| 500 | Unexpected failure | Analytics service |
| 502 | The analytics service could not be reached. Safe to retry | Gateway |
Status codes raised by the analytics service are relayed unchanged. Codes raised by the gateway are returned before the request reaches the analytics service, so a 401 means the key was rejected at the edge and no analytics query ran.
See Responses and Errors for the error envelope, authentication failures and status codes shared across the whole Ecom API.
Common Validation Errors
- Cannot use
dayswithstartorend: You must use eitherdaysOR thestart/endcombination, not both - Must use
startandendtogether: If you providestart, you must also provideend, and vice versa - Missing time range: You must provide either
daysor bothstartandend - End must be greater than start: When using
startandend, the end timestamp must be after the start timestamp - Invalid timestamp format: Timestamps must be in ISO 8601 format (e.g.,
2025-01-01T00:00:00Z)
Data Freshness
The API performs background file synchronization every 15 minutes to ensure data freshness. Analytics data may have a delay of up to 15 minutes from real-time events.
Best Practices
URL Encoding
Always URL-encode search terms in query parameters. For example, "lower third" becomes "lower%20third".
Example:
curl "https://ecom.marqo-ep.ai/api/v1/analytics/overview?customerId=...&term=lower%20third" \
-H "Authorization: Bearer {api_key}"
Time Ranges
- Use
daysfor recent data - Use
start/endfor specific historical periods
Limit Parameter
Start with smaller limits (e.g., 50) and increase as needed for the /terms endpoint.
Error Handling
Implement retry logic for 5xx errors with exponential backoff.
Rate Metrics
When analyzing rates (CTR, conversion rate), remember they are decimal values (0.241 = 24.1%).
Time Series Granularity
Time series data granularity automatically adjusts based on the selected time period:
- Hourly (≤100 hours): Ideal for short-term analysis and real-time monitoring
- Daily (100 hours - 100 days): Best for weekly and monthly trend analysis
- Weekly (100 days - 100 weeks): Suitable for quarterly and annual comparisons
- Monthly (100 weeks - 100 months): Best for multi-year trend analysis
- Yearly (>100 months): For long-term historical patterns
All time series data is provided in UTC timezone.
CORS Configuration
The API allows cross-origin requests from any origin, with any request header and any method. Every analytics endpoint is GET, so a request that uses another method returns 404 rather than failing a CORS check.
Calling analytics from a browser means shipping an API key to the browser. Prefer calling these endpoints from your server.