Overview
Report endpoints (/v1/reports/*) use a specialized array-based response format to optimize performance and reduce payload size. This guide explains how to interpret these responses.
Other endpoints like
/v1/org/* and /v1/prompts/* use standard JSON object
structures that are documented in the OpenAPI reference.Report Response Structure
All report endpoints return data in this optimized format:Interpreting Report Data
Array Position Mapping
The key to understanding report responses is that array positions correspond exactly to your request parameters:Dimensions Array
Values map to the order of dimensions in your request:dimensions[0]→ First dimension requested (hostname)dimensions[1]→ Second dimension requested (path)dimensions[2]→ Third dimension requested (date)
Metrics Array
Values map to the order of metrics in your request:metrics[0]→ First metric requested (count)metrics[1]→ Second metric requested (share_of_voice)
Example Mapping
For the first result object above:- Hostname:
dimensions[0]= “example.com” - Path:
dimensions[1]= “/some/path” - Date:
dimensions[2]= “2023-10-01” - Count:
metrics[0]= 10 - Share of Voice:
metrics[1]= 0.05
Info Object
Theinfo object provides metadata about your query:
| Field | Description |
|---|---|
query | Your exact request parameters echoed back |
total_rows | Total number of results available (useful for pagination) |
Working with Report Responses
Processing Data
Example of converting the array format to a more traditional object structure:Best Practices
- Always use the
info.queryobject to understand the structure of your response data - Process responses programmatically using the mapping examples above rather than hardcoding array positions
- Handle pagination using the
total_rowsfield to determine if more data is available - Monitor rate limit headers to avoid hitting API limits
- Validate your request parameters match the expected dimensions and metrics for your use case