Get tent analytics
curl --request GET \
--url https://api.tented.ai/v1/analytics/tent \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tented.ai/v1/analytics/tent"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tented.ai/v1/analytics/tent', 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.tented.ai/v1/analytics/tent",
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.tented.ai/v1/analytics/tent"
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.tented.ai/v1/analytics/tent")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tented.ai/v1/analytics/tent")
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{
"tent_id": "<string>",
"visits": 123,
"pageviews": 123,
"date_range": {
"start_date": "<string>",
"end_date": "<string>",
"days": 123
},
"sample_interval": 123,
"daily_pageviews": [
{
"date": "<string>",
"pageviews": 123
}
],
"by_country": [
{
"country": "<string>",
"views": 123
}
],
"by_device": [
{
"device": "<string>",
"views": 123
}
],
"by_browser": [
{
"browser": "<string>",
"views": 123
}
],
"by_os": [
{
"os": "<string>",
"views": 123
}
],
"by_referrer": [
{
"referrer": "<string>",
"views": 123
}
],
"by_path": [
{
"path": "<string>",
"views": 123
}
],
"recent_pageviews": [
{
"timestamp": "2023-11-07T05:31:56Z",
"country": "<string>",
"device": "<string>",
"browser": "<string>",
"os": "<string>",
"referrer": "<string>"
}
]
}{
"error": "<string>",
"error_code": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"limit": 123,
"current": 123
}{
"error": "<string>",
"error_code": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"limit": 123,
"current": 123
}{
"error": "<string>",
"error_code": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"limit": 123,
"current": 123
}Analytics
Get tent analytics
Traffic analytics for a single published tent over the last 1–7 days. Note: this endpoint uses camelCase query parameters.
GET
/
v1
/
analytics
/
tent
Get tent analytics
curl --request GET \
--url https://api.tented.ai/v1/analytics/tent \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tented.ai/v1/analytics/tent"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tented.ai/v1/analytics/tent', 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.tented.ai/v1/analytics/tent",
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.tented.ai/v1/analytics/tent"
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.tented.ai/v1/analytics/tent")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tented.ai/v1/analytics/tent")
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{
"tent_id": "<string>",
"visits": 123,
"pageviews": 123,
"date_range": {
"start_date": "<string>",
"end_date": "<string>",
"days": 123
},
"sample_interval": 123,
"daily_pageviews": [
{
"date": "<string>",
"pageviews": 123
}
],
"by_country": [
{
"country": "<string>",
"views": 123
}
],
"by_device": [
{
"device": "<string>",
"views": 123
}
],
"by_browser": [
{
"browser": "<string>",
"views": 123
}
],
"by_os": [
{
"os": "<string>",
"views": 123
}
],
"by_referrer": [
{
"referrer": "<string>",
"views": 123
}
],
"by_path": [
{
"path": "<string>",
"views": 123
}
],
"recent_pageviews": [
{
"timestamp": "2023-11-07T05:31:56Z",
"country": "<string>",
"device": "<string>",
"browser": "<string>",
"os": "<string>",
"referrer": "<string>"
}
]
}{
"error": "<string>",
"error_code": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"limit": 123,
"current": 123
}{
"error": "<string>",
"error_code": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"limit": 123,
"current": 123
}{
"error": "<string>",
"error_code": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"limit": 123,
"current": 123
}Authorizations
Query Parameters
Response
Analytics for the tent.
Resolution of the counts. 1 means every count is exact. A value N greater than 1 means Cloudflare served a 1-in-N sample and every count in the response is extrapolated by N. This is rare and only happens when the analytics backend could not obtain full-resolution data after retrying.