This web service responds with the number of Page views.
Method | Endpoint |
---|---|
POST |
/analytics/api/v1/traffic/page-views |
Request example
{
"startDate": "2022-11-01",
"endDate": "2023-07-01",
"groupByPeriod": "month",
"filters": {
"pageId": ["ft/home", "ft/search", "ft/reader", "default", "ft/viewer"],
"language": "en-US",
"authenticated": true
}
}
Field | Type | Required? | Description |
---|---|---|---|
startDate |
String | Yes | Inclusive start date of the period. The start date must be in the past year. |
endDate |
String | Yes | Exclusive end date of the period. The end date must be later than the start date. |
groupByPeriod |
String | Yes | Period by which to group the page views. Valid values are "month" and "day". |
filters |
Object | No | Field to specify which events to retrieve. |
pageId |
Array | No | ID of the page(s) to retrieve. |
language |
String | No | Filter on the UI Locale (e.g., en-US or fr-FR ). |
authenticated |
Boolean | No | Field to define users' status. If undefined, the web service returns page views for both authenticated and unauthenticated users. If set to true, the web service returns only page views for authenticated users. |
Response body
The following lines show an example of the JSON response body:
{
"startDate": "2022-11-01",
"endDate": "2023-07-01",
"results": [
{
"page": {"id": "ft/home","type": "homePage"},
"periods": [
{
"periodStartDate": "2023-05-01",
"periodEndDate": "2023-06-01",
"count": 80
},
{
"periodStartDate": "2023-06-01",
"periodEndDate": "2023-07-01",
"count": 65
}
]
},
{
"page": {"id": "ft/reader","type": "readerPage"},
"periods": [
{
"periodStartDate": "2023-05-01",
"periodEndDate": "2023-06-01",
"count": 70
},
{
"periodStartDate": "2023-06-01",
"periodEndDate": "2023-07-01",
"count": 124
}
]
}
]
}
Field Name | Type | Description |
---|---|---|
startDate |
String | Inclusive start date of the total period as defined in the request. |
endDate |
String | Exclusive end date of the total period as defined in the request. |
periodStartDate |
String | Inclusive start date of the period by which results are grouped. |
periodEndDate |
String | Exclusive end date of the period by which results are grouped. |
Return code | Description |
---|---|
200 OK |
Returns data in JSON format. |