Get PostHog chart data
curl --request GET \
--url https://api.snowseo.com/v3/integrations/posthog/chart \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.snowseo.com/v3/integrations/posthog/chart"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.snowseo.com/v3/integrations/posthog/chart', 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.snowseo.com/v3/integrations/posthog/chart",
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.snowseo.com/v3/integrations/posthog/chart"
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.snowseo.com/v3/integrations/posthog/chart")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.snowseo.com/v3/integrations/posthog/chart")
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{
"chartData": [
{
"date": "<string>",
"sessions": 123,
"users": 123,
"pageviews": 123
}
],
"incompleteFrom": "<string>"
}{
"success": true,
"error": "<string>",
"code": "<string>",
"message": "<string>",
"reference": "<string>"
}{
"success": true,
"error": "<string>",
"code": "<string>",
"message": "<string>",
"reference": "<string>"
}PostHog
Analytics (PostHog)
Pull your website visitor data from PostHog - users, pageviews, sessions, sources, and devices.
GET
/
v3
/
integrations
/
posthog
/
chart
Get PostHog chart data
curl --request GET \
--url https://api.snowseo.com/v3/integrations/posthog/chart \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.snowseo.com/v3/integrations/posthog/chart"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.snowseo.com/v3/integrations/posthog/chart', 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.snowseo.com/v3/integrations/posthog/chart",
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.snowseo.com/v3/integrations/posthog/chart"
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.snowseo.com/v3/integrations/posthog/chart")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.snowseo.com/v3/integrations/posthog/chart")
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{
"chartData": [
{
"date": "<string>",
"sessions": 123,
"users": 123,
"pageviews": 123
}
],
"incompleteFrom": "<string>"
}{
"success": true,
"error": "<string>",
"code": "<string>",
"message": "<string>",
"reference": "<string>"
}{
"success": true,
"error": "<string>",
"code": "<string>",
"message": "<string>",
"reference": "<string>"
}Get your website analytics from PostHog. These endpoints power the Traffic dashboard’s Analytics tab when PostHog is your connected provider - users, pageviews, sessions, traffic sources, top pages, and device breakdowns.
These routes require an active plan; without one they return
Call
You need a PostHog integration connected to your team. Connect it from Settings → Integrations → Analytics & Performance. Using Google Analytics 4 instead? See Analytics (Google Analytics 4).
403.
Pass startDate and endDate or days; see Date Windows.
Filters Parameter
Thefilters query parameter accepts URL-encoded JSON: an object keyed by dimension, each with a list of selected values. Dimensions: page, referrer, channel, campaign, deviceCategory, browser, os. Invalid JSON, an unknown dimension, or a value that is not a list returns 400 with code INVALID_FILTERS naming the supported dimensions.
filters={"channel":["Organic Search","Direct"]}
GET /v3/integrations/posthog/filter-values for the available dimension values.
Traffic Chart
GET /v3/integrations/posthog/chart
Get daily users, pageviews, and sessions for the selected date range - used to power the main trend chart. incompleteFrom is today in the PostHog project’s time zone; days from it onward are still being collected.Authorizations
bearerAuthapiKey
Your SnowSEO API key (sk_...).
Query Parameters
Team ID
Days back from today on the team's calendar, converted to startDate/endDate. Ignored when startDate or endDate is set. Defaults to 30.
Required range:
x >= 1Start date (YYYY-MM-DD)
End date (YYYY-MM-DD)
Country filter
Additional PostHog property filters
Was this page helpful?

