Top Items Report
This guide includes instructions for retrieving an API Top Items Report for a specified dimension. The Top Items Report returns top-performing dimensions (like products, pages, or regions) ranked by metric counts. For general information on the Customer Journey Analytics API Report endpoint, see the Reporting API Overview.
data-variant=info
data-slots=text
To retrieve a Top Items Report, use the following endpoint:
GET https://cja.adobe.io/reports/topItems
Example request
data-slots=heading, code
data-repeat=1
data-languages=CURL
Request
curl -X GET "https://cja.adobe.io/reports/topItems?limit=5&page=0&lookupNoneValues=true&dataId=dv_554445545&dimension=pages" \
-H "accept: application/json" \
-H "x-api-key: {API_KEY}" \
-H "x-gw-ims-org-id: {ORG_ID}" \
-H "Authorization: Bearer {ACCESS_TOKEN}"
Example response
data-slots=heading, code
data-repeat=1
data-languages=JSON
Response
{
"totalPages": 1,
"firstPage": true,
"lastPage": true,
"numberOfElements": 3,
"number": 0,
"totalElements": 3,
"columns": {
"dimension": {
"id": "variables/page",
"type": "string"
},
"columnIds": [
"0"
]
},
"rows": [
{
"itemId": "3306266643",
"value": "home",
"data": [
219567
]
},
{
"itemId": "2796092754",
"value": "category 5",
"data": [
90943
]
},
{
"itemId": "1738577623",
"value": "category 2",
"data": [
84192
]
}
],
"summaryData": {
"filteredTotals": [
3080619
],
"totals": [
3080619
]
}
}
Example request details
The example above requests a Top Items Report with the following:
- The top items within the dataview
dv_554445545. - The top metrics associated with the dimension
pages.
Example response details
The example above returns the top items (those with the highest of any metric counts) in descending order:
- The page
homewith a count of219567. - The page
category 5with a count of90943. - The page
category 2with a count of84192.
Request parameters
The following table describes the request parameters for the GET /reports/topItems endpoint:
dataIddv_554445545.dimensionpages.localeen_US.lookupNoneValuesfalselimitpageResponse parameters
The following table describes the response parameters for the GET /reports/topItems endpoint:
totalPagesfirstPagelastPagenumberOfElementsnumber0totalElementscolumnsdimension datadimensionid and typerowsitemId, value and dataitemIdvalueitemId in the reportdatasummaryDataUsage notes and limitations
Consider the following when working with the Reports API:
Rate limiting
The Reports API enforces rate limits to ensure optimal performance:
- Requests per minute: 60 requests per minute per organization
- Concurrent requests: Maximum 6 concurrent requests per organization
Report execution limits
- Data range: Maximum 18 months of data per request
- Dimension items: Maximum 1000 dimension items per request
- Metrics: Maximum 20 metrics per report
- Execution time: Report execution timeout is 300 seconds
Best practices
- Cache report results when possible to reduce API calls
- Use pagination for large result sets
- Implement retry logic with exponential backoff for rate-limited requests
- Use the
topItemsendpoint for quick dimension analysis without metrics - Use appropriate date ranges to avoid large data requests
For more information on CJA Reports APIs, see the CJA API reference.
Post create dataview reports
Use this endpoint to create report requests and return data for an existing data view. This corresponds to creating a visualization in the CJA Analysis Workspace UI.
POST https://cja.adobe.io/reports
Example request
data-slots=heading, code
data-repeat=1
data-languages=CURL
Request
curl -X POST "https://cja.adobe.io/reports" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "x-api-key: {API_KEY}" \
-H "x-gw-ims-org-id: {ORG_ID}" \
-H "Authorization: Bearer {ACCESS_TOKEN}" \
-d '{
"rsid": "dv_example_dataview_id",
"globalFilters": [
{
"type": "dateRange",
"dateRange": "2023-07-01T00:00:00.000/2023-08-01T00:00:00.000",
"dateRangeId": "thisMonth"
}
],
"metricContainer": {
"metrics": [
{
"columnId": "0",
"id": "metrics/pageviews"
},
{
"columnId": "1",
"id": "metrics/visits",
"sort": "desc"
},
{
"columnId": "2",
"id": "metrics/visitors"
}
]
},
"dimension": "variables/page",
"settings": {
"countRepeatInstances": true,
"includeAnnotations": true,
"limit": 10,
"page": 0,
"nonesBehavior": "exclude-nones"
},
"statistics": {
"functions": [
"col-max",
"col-min"
]
}
}'
Example response
data-slots=heading, code
data-repeat=1
data-languages=JSON
Response
{
"totalPages": 877,
"firstPage": true,
"lastPage": false,
"numberOfElements": 10,
"number": 0,
"totalElements": 8768,
"columns": {
"dimension": {
"id": "variables/page",
"type": "string"
},
"columnIds": [
"0",
"1",
"2"
]
},
"rows": [
{
"itemId": "3306266643",
"value": "home",
"data": [
219567,
151478,
151478
]
},
{
"itemId": "2796092754",
"value": "category 5",
"data": [
90943,
71248,
71248
]
},
{
"itemId": "1738577623",
"value": "category 2",
"data": [
84192,
69067,
69067
]
}
],
"summaryData": {
"filteredTotals": [
3080619,
357996,
357996
],
"totals": [
3080619,
424407,
424407
],
"col-max": [
219567,
151478,
151478
],
"col-min": [
1,
1,
1
]
}
}
Request parameters
The following table describes the request parameters for the POST /reports endpoint:
rsidglobalFilterstype, dateRange, and dateRangeIdtypedateRangedateRangeIdthisMonthmetricContainermetrics arraymetricscolumnId, id, and sortcolumnId0idmetricsortasc or descdimensionsettingscountRepeatInstancesincludeAnnotationslimitpagenonesBehavior0 if set to exclude-nonesstatisticsfunctions arrayfunctionscol-max and col-minResponse parameters
The following table describes the response parameters for the POST /reports endpoint:
totalPagesfirstPagelastPagenumberOfElementsnumber0totalElementscolumnsdimension datadimensionid and typeidtypedimension ID data typecolumnIdsrowsitemId, value and dataitemIdvalueitemId in the reportdatasummaryDatafilteredTotalstotalscol-maxcol-min