Reporting API
The /reports
endpoint is the primary endpoint for reporting requests. In order to provide maximum flexibility,
many configuration options are available for requests.
Overview#
While the Adobe Analytics UI can help an analyst or digital marketer answer key questions, the Analytics API can
automate those answers by reporting to executive dashboards, custom reporting platforms, or tight Experience Cloud integrations.
Because the /reports
endpoint uses the same API as the Analytics UI, you can configure it for many options.
Authentication and authorization#
Before you can use Analytics APIs, you need to obtain authentication and receive authorization. For more information, see the Get Started guide.
/reports Endpoint description#
The /reports
endpoint description is shown in our Swagger UI. Use the Swagger UI to see endpoint summaries,
available methods, parameters, example values, models, and status codes, and to try out the API.
Best practises#
Please follow these guidelines when using Analytics APIs
- Make multiple, smaller requests instead of a large, single request.
- Request data once and cache it.
- Do not poll for new data faster than a 30 minute interval.
- Pull historical data and increment it regularly instead of requesting the entire data set.
Discouraged practises
- Requesting as much data as possible in a single request.
- Requesting one year of data at day granularity everyday - just request the new day and merge it.
- Driving a web page with a site performance widget by making an API request every time the web page is called.
- Requesting a full year of day-level data every day to get a 12-months window.
Time series reports#
The Reports API includes the Time Series reports. These simple reports include information about the performance of a metric (or metrics) over a period of time.
The following request example includes both a JSON message request body and a curl
request for the Page Views metric.
Copied to your clipboard1{2 "rsid":"adbedocrsid",3 "globalFilters":[4 {5 "type":"dateRange",6 "dateRange":"2017-12-31T00:00:00.000/2018-01-06T23:59:59.999"7 }8 ],9 "metricContainer":{10 "metrics":[11 {12 "columnId":"0",13 "id":"metrics/pageviews",14 "filters":[15 "0"16 ]17 }18 ],19 "metricFilters":[20 {21 "id":"0",22 "type":"dateRange",23 "dateRange":"2017-12-31T00:00:00.000/2018-01-06T23:59:59.999"24 }25 ]26 },27 "dimension":"variables/daterangeday",28 "settings":{29 "dimensionSort":"asc"30 }31}
Copied to your clipboard1curl -X POST \2 https://analytics.adobe.io/api/{COMPANYID}/reports \3 -H 'Accept: application/json' \4 -H 'Authorization: Bearer {ACCESSTOKEN}' \5 -H 'Content-Type: application/json' \6 -H 'x-api-key: {APIKEY}' \7 -H 'x-proxy-global-company-id: {COMPANYID}' \8 -d '{REQUESTJSON}'
Copied to your clipboard1{2 "totalPages":1,3 "firstPage":true,4 "lastPage":false,5 "numberOfElements":7,6 "number":0,7 "totalElements":7,8 "columns":{9 "dimension":{10 "id":"variables/daterangeday",11 "type":"time"12 },13 "columnIds":[14 "0"15 ]16 },17 "rows":[18 {19 "itemId":"1171131",20 "value":"Dec 31, 2017",21 "data":[22 794.023 ]24 },25 {26 "itemId":"1180001",27 "value":"Jan 1, 2018",28 "data":[29 16558.030 ]31 },32 {33 "itemId":"1180002",34 "value":"Jan 2, 2018",35 "data":[36 17381.037 ]38 },39 {40 "itemId":"1180003",41 "value":"Jan 3, 2018",42 "data":[43 17384.044 ]45 },46 {47 "itemId":"1180004",48 "value":"Jan 4, 2018",49 "data":[50 17442.051 ]52 },53 {54 "itemId":"1180005",55 "value":"Jan 5, 2018",56 "data":[57 17417.058 ]59 },60 {61 "itemId":"1180006",62 "value":"Jan 6, 2018",63 "data":[64 17334.065 ]66 }67 ],68 "summaryData":{69 "totals":[70 104310.071 ]72 }73}
The JSON message requests
- Page Views metric for the report suite
adbedocrsid
(line 12 and 2). - Time period From Dec. 31, 2017 00:00:00.000 - Jan. 06, 2018 23:59:59.999, using the report suite timezone
variables/daterangeday granularity
(line 26). With seven days specified in this time period, you can expect seven numbers in the response. - Sort response by ascending date, i.e. oldest to newest (line 28).
The JSON response includes
- The
rows
section contains each report record. In the above example, you can see three rows, each with avalue
(lines 19-29). - The
value
property contains the dimension value. Because the request includes a total of page views by day, the value of each row will contain a date identifier for the day (e.g. line 25). For time series data, this identifier changes based on granularity. For example, if you requestvariables/daterangemonth
instead, each value will contain a month/year identifier. - You can also easily modify this example to get metrics for visits. Simply change the id property in the metrics section to metrics/visits (line 15).