Analytics

Get analytics about a space

The GitBook API is currently in beta phase. If you wish to be one of our testers, please contact our team at support@gitbook.com.

get
Get Space Content Analytics

https://$HOSTNAME/v1/spaces/:spaceID/analytics/content
Fetch pages analytics (views, visitors, sessions durations...) for a space.
Request
Response
Request
Path Parameters
spaceID
required
string
ID of the space
Query Parameters
endAt
optional
string
End date
startAt
optional
string
Start date
Response
200: OK
{
"pages": [
{
"uid": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5",
"uniqueVisitors": 10,
"pageViews": 24,
"timeOnPage": 840
},
...
]
}

get
Get Space Search Analytics

https://$HOSTNAME/v1/spaces/:spaceID/analytics/search
Fetch search analytics (number of searches, queries, hits...) for a space.
Request
Response
Request
Path Parameters
spaceID
required
string
ID of the space
Response
200: OK
{
"searches": 823,
"queries": [
{
"query": "api",
"searches": 126,
"hits": 90"
},
...
]
}