Analytics
Get page views
Returns per-path and site-wide content view event counts, split by human and AI traffic.
GET
/
v1
/
analytics
/
{projectId}
/
views
Get page views
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_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
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>"
}
]
}Usage
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. Incrementoffset by limit while hasMore is true.
Filtering
Filter view data by date range usingdateFrom and dateTo parameters.
Rate limits
This endpoint allows 100 requests per organization per hour. All analytics endpoints share this limit.Authorizations
The Authorization header expects a Bearer token. Use an admin API key (prefixed with mint_). This is a server-side secret key. Generate one on the API keys page in your dashboard.
Path Parameters
Query Parameters
Date in ISO 8601 or YYYY-MM-DD format
Example:
"2024-01-01"
Date in ISO 8601 or YYYY-MM-DD format. dateTo is an exclusive upper limit. Results include dates before, but not on, the specified date.
Example:
"2024-01-01"
Max results per page (1-250, default 50). Increment offset by limit while hasMore is true to paginate.
Required range:
1 <= x <= 250Number of rows to skip. Use offset = (page - 1) * limit for page-based access.
Required range:
x >= 0Was this page helpful?
⌘I
Get page views
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_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
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>"
}
]
}