Example requests
The three scenarios on this page are real jobs, and each is given in curl, Python and JavaScript. All of them read the key from an environment variable:
export ZEO_RADAR_API_KEY="sk-zr-9f2c4d7a1b6e8035c2af41d9e70b5c83"export ZEO_BRAND_ID="8f14a0c2-5b7e-4a91-9d33-6c2e10b4f7a5"Scenario 1: pulling weekly visibility
Section titled “Scenario 1: pulling weekly visibility”The goal is to take the last 90 days of measurements by date and put them into your weekly report.
curl
curl -sG "https://api.zeoradar.com/v1/reports/visibility" \ -H "Authorization: Bearer $ZEO_RADAR_API_KEY" \ --data-urlencode "brand_id=$ZEO_BRAND_ID" \ --data-urlencode "group_by=date" \ --data-urlencode "period=last_90d" \ --data-urlencode "timezone=Europe/Istanbul" \ --data-urlencode "sort=date" \ | jq -r '.data[] | [.date, .visibility, .share_of_voice, .avg_position] | @tsv'Python
import os, json, urllib.parse, urllib.request
BASE = "https://api.zeoradar.com/v1"HEAD = {"Authorization": "Bearer " + os.environ["ZEO_RADAR_API_KEY"]}
query = urllib.parse.urlencode({ "brand_id": os.environ["ZEO_BRAND_ID"], "group_by": "date", "period": "last_90d", "timezone": "Europe/Istanbul", "sort": "date",})request = urllib.request.Request(BASE + "/reports/visibility?" + query, headers=HEAD)with urllib.request.urlopen(request, timeout=60) as response: payload = json.load(response)
print("date visibility sov avg pos")for row in payload["data"]: print("%s %9.1f%% %8.1f%% %9s" % ( row["date"], row["visibility"] * 100, row["share_of_voice"] * 100, "-" if row["avg_position"] is None else "%.2f" % row["avg_position"], ))JavaScript
const BASE = "https://api.zeoradar.com/v1";const head = { Authorization: "Bearer " + process.env.ZEO_RADAR_API_KEY };
const query = new URLSearchParams({ brand_id: process.env.ZEO_BRAND_ID, group_by: "date", period: "last_90d", timezone: "Europe/Istanbul", sort: "date"});
const response = await fetch(BASE + "/reports/visibility?" + query, { headers: head });const payload = await response.json();
for (const row of payload.data) { console.log( row.date, (row.visibility * 100).toFixed(1) + "%", (row.share_of_voice * 100).toFixed(1) + "%", row.avg_position === null ? "-" : row.avg_position.toFixed(2) );}Scenario 2: finding prompts that dropped
Section titled “Scenario 2: finding prompts that dropped”The goal is to list the prompts whose visibility fell between two measurements. The method is to
pull the same report with group_by=prompt for two different dates and take the difference.
curl
BASE="https://api.zeoradar.com/v1/reports/visibility"AUTH="Authorization: Bearer $ZEO_RADAR_API_KEY"
curl -sG "$BASE" -H "$AUTH" \ --data-urlencode "brand_id=$ZEO_BRAND_ID" \ --data-urlencode "group_by=prompt" \ --data-urlencode "date_from=2026-08-17" --data-urlencode "date_to=2026-08-17" \ --data-urlencode "limit=200" > previous.json
curl -sG "$BASE" -H "$AUTH" \ --data-urlencode "brand_id=$ZEO_BRAND_ID" \ --data-urlencode "group_by=prompt" \ --data-urlencode "date_from=2026-08-24" --data-urlencode "date_to=2026-08-24" \ --data-urlencode "limit=200" > current.json
jq -s ' (.[0].data | map({key: .prompt_id, value: .visibility}) | from_entries) as $before | .[1].data | map(select($before[.prompt_id] != null and .visibility < $before[.prompt_id])) | map({prompt: .prompt_text, before: $before[.prompt_id], after: .visibility}) | sort_by(.after - .before)' previous.json current.jsonPython
import os, json, urllib.parse, urllib.request
BASE = "https://api.zeoradar.com/v1"HEAD = {"Authorization": "Bearer " + os.environ["ZEO_RADAR_API_KEY"]}
def prompts_on(day): """Visibility per prompt in that day's measurement.""" query = urllib.parse.urlencode({ "brand_id": os.environ["ZEO_BRAND_ID"], "group_by": "prompt", "date_from": day, "date_to": day, "limit": 200, }) request = urllib.request.Request(BASE + "/reports/visibility?" + query, headers=HEAD) with urllib.request.urlopen(request, timeout=60) as response: payload = json.load(response) return {row["prompt_id"]: row for row in payload["data"]}
before = prompts_on("2026-08-17")after = prompts_on("2026-08-24")
dropped = []for prompt_id, row in after.items(): if prompt_id in before and row["visibility"] < before[prompt_id]["visibility"]: dropped.append(( row["visibility"] - before[prompt_id]["visibility"], row["prompt_text"], before[prompt_id]["visibility"], row["visibility"], ))
for delta, text, was, now in sorted(dropped): print("%+6.1f points %4.1f%% -> %4.1f%% %s" % ( delta * 100, was * 100, now * 100, text[:70]))JavaScript
const BASE = "https://api.zeoradar.com/v1";const head = { Authorization: "Bearer " + process.env.ZEO_RADAR_API_KEY };
async function promptsOn(day) { const query = new URLSearchParams({ brand_id: process.env.ZEO_BRAND_ID, group_by: "prompt", date_from: day, date_to: day, limit: "200" }); const response = await fetch(BASE + "/reports/visibility?" + query, { headers: head }); const payload = await response.json(); return new Map(payload.data.map(row => [row.prompt_id, row]));}
const before = await promptsOn("2026-08-17");const after = await promptsOn("2026-08-24");
const dropped = [];for (const [promptId, row] of after) { const was = before.get(promptId); if (was && row.visibility < was.visibility) { dropped.push({ delta: row.visibility - was.visibility, prompt: row.prompt_text, before: was.visibility, after: row.visibility }); }}
dropped.sort((a, b) => a.delta - b.delta);console.table(dropped);Scenario 3: exporting cited domains
Section titled “Scenario 3: exporting cited domains”The goal is to get every domain cited in the last 30 days as CSV. The list is long, so cursor pagination is mandatory.
curl
BASE="https://api.zeoradar.com/v1/reports/sources"AUTH="Authorization: Bearer $ZEO_RADAR_API_KEY"CURSOR=""
echo "domain,category,citations,answers,is_owned" > sources.csv
while : ; do RESPONSE=$(curl -sG "$BASE" -H "$AUTH" \ --data-urlencode "brand_id=$ZEO_BRAND_ID" \ --data-urlencode "group_by=domain" \ --data-urlencode "period=last_30d" \ --data-urlencode "sort=-citations" \ --data-urlencode "limit=200" \ ${CURSOR:+--data-urlencode "cursor=$CURSOR"})
echo "$RESPONSE" | jq -r '.data[] | [.domain, .category, .citations, .answers, .is_owned] | @csv' \ >> sources.csv
CURSOR=$(echo "$RESPONSE" | jq -r '.meta.next_cursor // empty') [ -z "$CURSOR" ] && breakdone
wc -l sources.csvPython
import csv, os, json, urllib.parse, urllib.request
BASE = "https://api.zeoradar.com/v1"HEAD = {"Authorization": "Bearer " + os.environ["ZEO_RADAR_API_KEY"]}
cursor, rows = None, []while True: params = { "brand_id": os.environ["ZEO_BRAND_ID"], "group_by": "domain", "period": "last_30d", "sort": "-citations", "limit": 200, } if cursor: params["cursor"] = cursor request = urllib.request.Request( BASE + "/reports/sources?" + urllib.parse.urlencode(params), headers=HEAD) with urllib.request.urlopen(request, timeout=60) as response: payload = json.load(response)
rows.extend(payload["data"]) cursor = payload["meta"]["next_cursor"] if not cursor: break
with open("sources.csv", "w", newline="", encoding="utf-8") as handle: writer = csv.writer(handle) writer.writerow(["domain", "category", "citations", "answers", "is_owned"]) for row in rows: writer.writerow([row["domain"], row["category"], row["citations"], row["answers"], row["is_owned"]])
print("%d domains written" % len(rows))JavaScript
import { writeFileSync } from "node:fs";
const BASE = "https://api.zeoradar.com/v1";const head = { Authorization: "Bearer " + process.env.ZEO_RADAR_API_KEY };
let cursor = null;const rows = [];
do { const query = new URLSearchParams({ brand_id: process.env.ZEO_BRAND_ID, group_by: "domain", period: "last_30d", sort: "-citations", limit: "200" }); if (cursor) query.set("cursor", cursor);
const response = await fetch(BASE + "/reports/sources?" + query, { headers: head }); const payload = await response.json();
rows.push(...payload.data); cursor = payload.meta.next_cursor;} while (cursor);
const csv = ["domain,category,citations,answers,is_owned"] .concat(rows.map(r => [r.domain, r.category, r.citations, r.answers, r.is_owned].join(","))) .join("\n");
writeFileSync("sources.csv", csv, "utf8");console.log(rows.length + " domains written");Shared notes
Section titled “Shared notes”- The loop condition is always
meta.next_cursor. Getting back fewer records thanlimitdoes not mean this was the last page. - Catch the
429response. The examples above leave out backoff to stay readable; in production use the loop on the rate limits page. - Ratios are between 0 and 1. Multiply by 100 to show a percentage, and do not round twice.
- Pin your dates. If a report shifts by a day, the reason is usually a missing
timezone.
feedback.question
feedback.thanks