Get page views
Returns per-path and site-wide content view event counts, split by human and AI traffic.
Authenticate with an admin API key.
Use this endpoint to export page view analytics. Results include both site-wide totals and per-page breakdowns, split by human and AI traffic.
Paginate through results using offset-based pagination. Increment offset by limit while hasMore is true.
Filtering
Section titled “Filtering”Filter view data by date range using dateFrom and dateTo parameters.
Rate limits
Section titled “Rate limits”This endpoint allows 100 requests per organization per hour. All analytics endpoints share this limit.
Related topics
/v1/analytics/{projectId}/viewsGet page views
5 parameters
- projectIdstringpathrequired
- dateFromstringquery
- dateTostringquery
- limitintegerquery
- offsetintegerquery
curl --request GET \
--url https://api.mintlify.com/v1/analytics/{projectId}/views \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mintlify.com/v1/analytics/{projectId}/views"
headers = {
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: "GET", headers: {"Authorization": "Bearer <token>"}};
fetch("https://api.mintlify.com/v1/analytics/{projectId}/views", options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mintlify.com/v1/analytics/{projectId}/views",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mintlify.com/v1/analytics/{projectId}/views"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mintlify.com/v1/analytics/{projectId}/views")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mintlify.com/v1/analytics/{projectId}/views")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"totals": {
"human": 123,
"ai": 123,
"total": 123
},
"views": [
{
"path": "<string>",
"human": 123,
"ai": 123,
"total": 123
}
],
"hasMore": true
}{
"error": "<string>",
"details": [
{
"message": "<string>"
}
]
}{
"error": "<string>",
"details": [
{
"message": "<string>"
}
]
}Authorizations
Section titled “Authorizations”AuthorizationstringrequiredThe Authorization header expects a Bearer token. Use an admin API key. This is a server-side secret key. Generate one on the API keys page in your dashboard.
Path Parameters
Section titled “Path Parameters”projectIdstringrequiredQuery Parameters
Section titled “Query Parameters”dateFrom?stringExample: 2024-01-01
dateTo?stringExample: 2024-01-01
limit?integerRequired range: 1 <= x <= 250
offset?integerRequired range: 0 <= x
Response
Section titled “Response”200 — Site-wide and per-path content view event counts
totalsobjectrequiredShow child attributes
humannumberrequiredSite-wide content view events from human traffic.
ainumberrequiredSite-wide content view events from AI bot traffic.
totalnumberrequiredSite-wide content view events.
viewsobject[]requiredPer-page view counts.
Show child attributes
pathstringrequiredThe documentation page path.
humannumberrequiredContent view events on this path from human traffic.
ainumberrequiredContent view events on this path from AI bot traffic.
totalnumberrequiredTotal content view events on this path.
hasMorebooleanrequiredWhether additional results are available beyond this page.