Website statistics
API DocumentationEndpoint
GET
https://dev.usermetric.io/api/statistics/{website_id}
Parameters
| Parameters | Details | Description |
|---|---|---|
start_date
|
Required
String
|
Start date in Y-m-d format. |
end_date
|
Required
String
|
End date in Y-m-d format. |
type
|
Optional
String
|
Allowed values: overview, realtime, paths, landing_paths, referrers, referrer_paths, screen_resolutions, utms_source, utms_medium_campaign, operating_systems, device_types, continents, countries, cities, browser_names, browser_languages, browser_timezones, themes, goals, hours, weekdays, outbound_clicks, outbound_clicks_paths |
country_code
|
Optional
String
|
Available when: type = cities |
referrer_host
|
Optional
String
|
Available when: type = referrer_paths |
utm_source
|
Optional
String
|
Available when: type = utms_medium_campaign |
host
|
Optional
String
|
Available when: type = outbound_clicks_paths |
Example
curl --request GET \
--url 'https://dev.usermetric.io/api/statistics/{website_id}?start_date=2020-01-01&end_date=2021-01-01' \
--header 'Authorization: Bearer {api_key}' \
Response example
{
"data": [
{
"path": "/dashboard",
"pageviews": 500,
"bounces": 10
},
{
"path": "/websites",
"pageviews": 250,
"bounces": 0
},
{
"path": "/",
"pageviews": 200,
"bounces": 36
},
{
"path": "/register",
"pageviews": 100,
"bounces": 25
},
{
"path": "/login",
"pageviews": 50,
"bounces": 10
}
]
}