curl --request GET \
--url https://api.usertour.io/v2/projects/{projectId}/content/{id}/analytics/questions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.usertour.io/v2/projects/{projectId}/content/{id}/analytics/questions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.usertour.io/v2/projects/{projectId}/content/{id}/analytics/questions', 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.usertour.io/v2/projects/{projectId}/content/{id}/analytics/questions",
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.usertour.io/v2/projects/{projectId}/content/{id}/analytics/questions"
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.usertour.io/v2/projects/{projectId}/content/{id}/analytics/questions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usertour.io/v2/projects/{projectId}/content/{id}/analytics/questions")
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{
"results": [
{
"object": "questionAnalytics",
"question": {
"cvid": "<string>",
"name": "<string>"
},
"totalResponses": 0,
"distribution": [
{
"answer": "<string>",
"count": 0,
"percentage": 123
}
],
"nps": {
"score": 123,
"promoters": {
"count": 0,
"percentage": 123
},
"passives": {
"count": 0,
"percentage": 123
},
"detractors": {
"count": 0,
"percentage": 123
},
"rollingWindowDays": 0,
"byDay": [
{
"date": "<string>",
"score": 123,
"total": 0
}
]
},
"rating": {
"average": 123,
"rollingWindowDays": 0,
"byDay": [
{
"date": "<string>",
"average": 123,
"total": 0
}
]
}
}
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}Get question analytics
Per-question aggregates for survey questions in this content: answer distribution, NPS score with promoter/passive/detractor shares, rating averages — each with a rolling-window daily series (CUMULATIVE over the trailing rollingWindowDays, echoed per series — unlike the content-analytics per-day byDay). Defaults to the last 30 days, UTC.
curl --request GET \
--url https://api.usertour.io/v2/projects/{projectId}/content/{id}/analytics/questions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.usertour.io/v2/projects/{projectId}/content/{id}/analytics/questions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.usertour.io/v2/projects/{projectId}/content/{id}/analytics/questions', 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.usertour.io/v2/projects/{projectId}/content/{id}/analytics/questions",
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.usertour.io/v2/projects/{projectId}/content/{id}/analytics/questions"
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.usertour.io/v2/projects/{projectId}/content/{id}/analytics/questions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usertour.io/v2/projects/{projectId}/content/{id}/analytics/questions")
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{
"results": [
{
"object": "questionAnalytics",
"question": {
"cvid": "<string>",
"name": "<string>"
},
"totalResponses": 0,
"distribution": [
{
"answer": "<string>",
"count": 0,
"percentage": 123
}
],
"nps": {
"score": 123,
"promoters": {
"count": 0,
"percentage": 123
},
"passives": {
"count": 0,
"percentage": 123
},
"detractors": {
"count": 0,
"percentage": 123
},
"rollingWindowDays": 0,
"byDay": [
{
"date": "<string>",
"score": 123,
"total": 0
}
]
},
"rating": {
"average": 123,
"rollingWindowDays": 0,
"byDay": [
{
"date": "<string>",
"average": 123,
"total": 0
}
]
}
}
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"issues": [
{
"rule": "<string>",
"message": "<string>",
"path": "<string>"
}
],
"doc_url": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Environment whose sessions to aggregate (content is project-level; pick the env).
ISO date, inclusive. Default: 30 days ago.
ISO date, inclusive. Default: today.
IANA timezone used for the per-day bucketing. Default: UTC.
Response
Question analytics
One entry per aggregable question (nps / rating / choice). Free-text questions (single/multi-line text) are omitted entirely — no aggregate signal for open text. To read raw answers (including free text), fetch sessions for this content with answers expanded.
Show child attributes
Show child attributes