curl --request GET \
--url https://api.scrunchai.com/v1/{brand_id}/ai-referrals \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.scrunchai.com/v1/{brand_id}/ai-referrals"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.scrunchai.com/v1/{brand_id}/ai-referrals', 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.scrunchai.com/v1/{brand_id}/ai-referrals",
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.scrunchai.com/v1/{brand_id}/ai-referrals"
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.scrunchai.com/v1/{brand_id}/ai-referrals")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrunchai.com/v1/{brand_id}/ai-referrals")
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{
"meta": {
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"currency_code": "<string>"
},
"data": [
{
"date": "2023-12-25",
"ai_platform": "<string>",
"landing_page": "<string>",
"website": "<string>",
"sessions": 123,
"views": 123,
"engaged_sessions": 123,
"engagement_rate": 123,
"avg_engagement_time_per_session": 123,
"new_users": 123,
"key_events": 123,
"converted_sessions": 123,
"conversion_rate": 123,
"transactions": 123,
"revenue": 123
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Get AI Referrals
Retrieve the visits AI assistants (ChatGPT, Perplexity, Gemini and others) sent to the brand’s websites, with their engagement and conversions. Rows come from the brand’s Google Analytics 4 connection and from the websites sent through the AI Referrals push API. This endpoint isn’t part of the push beta: any key with query scope on the brand can call it.
Freshness
Scrunch copies the brand’s Google Analytics data once a day. Rows run up to yesterday in each website’s time zone, so today isn’t included. A day not loaded yet reads null. Grouped by date and ai_platform only, an assistant with no visits on a loaded day reads 0. Numbers can differ slightly from Scrunch’s AI Referrals page, which reads Google Analytics live.
A start_date before 2015-08-14, when Google Analytics 4 starts, returns 400. Revenue reported in different currencies across the brand’s websites returns 409.
Available Dimensions
| Field | Description |
|---|---|
date | The day, YYYY-MM-DD |
ai_platform | The AI assistant that referred the visits (e.g. OpenAI, Perplexity) |
landing_page | Path of the page the visits landed on |
website | The website the visits went to, without scheme or www |
Metrics
Every row carries sessions, views, engaged_sessions, engagement_rate, avg_engagement_time_per_session, new_users, key_events, converted_sessions, conversion_rate, transactions and revenue. Key events leave out Google Analytics’ automatic events and the ones the brand turned off in Scrunch. A website sent through the push API with traffic only reads null for engaged_sessions, new_users, key_events, converted_sessions and the rates.
curl --request GET \
--url https://api.scrunchai.com/v1/{brand_id}/ai-referrals \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.scrunchai.com/v1/{brand_id}/ai-referrals"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.scrunchai.com/v1/{brand_id}/ai-referrals', 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.scrunchai.com/v1/{brand_id}/ai-referrals",
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.scrunchai.com/v1/{brand_id}/ai-referrals"
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.scrunchai.com/v1/{brand_id}/ai-referrals")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrunchai.com/v1/{brand_id}/ai-referrals")
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{
"meta": {
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"currency_code": "<string>"
},
"data": [
{
"date": "2023-12-25",
"ai_platform": "<string>",
"landing_page": "<string>",
"website": "<string>",
"sessions": 123,
"views": 123,
"engaged_sessions": 123,
"engagement_rate": 123,
"avg_engagement_time_per_session": 123,
"new_users": 123,
"key_events": 123,
"converted_sessions": 123,
"conversion_rate": 123,
"transactions": 123,
"revenue": 123
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Query Parameters
Response
Successful Response