SERP Tracking API: Endpoints, Credits and Async Checks
The TrackSERPs API is a REST API with an OpenAPI 3.1 spec for creating projects, adding keywords, starting checks and reading top-100 Google or Bing rankings. Checks are asynchronous: a new one is queued and takes roughly 10-20 minutes, costs 1 credit per keyword per device, and finishes with a webhook. Every read is free of credits.
Key facts
- HTTP status 202 Accepted means a request was accepted for processing but the processing has not been completed.Source: rfc-editor.org
- Google says the relevance of its results can depend on the searcher's location, language and device (desktop or phone).Source: developers.google.com
- HTTP 429 Too Many Requests means too many requests in a set time window, and the response may carry a Retry-After header.Source: rfc-editor.org
- The OpenAPI Specification is a language-agnostic interface description for HTTP APIs, so people and tools can understand a service without its source code.Source: spec.openapis.org
What the TrackSERPs API is, and what it is not
It is a rank tracking API, not a raw SERP API. You create a project (a domain, a location, a device set and a schedule), add keywords, and TrackSERPs checks them. Then you read positions, history, SERP snapshots and AI Overview citations back, as many times as you like.
A live SERP endpoint suits a tool where a user types a query and watches a spinner. A tracking API suits dashboards, client reports, alerts, spreadsheets and agent workflows. TrackSERPs is the second kind: every check is queued, and starting one returns 202 Accepted, the HTTP status for work accepted but not yet finished. That is why a new check takes about 10 to 20 minutes.
The base URL is https://api.trackserps.com/v1, authentication is a bearer token, field names are snake_case and enum values are lowercase. The full contract is an OpenAPI 3.1 file you can download as YAML (/openapi.yaml) or JSON (/openapi.json); the REST API quickstart and the reference pages under /docs/api mirror it.
| Area | Main endpoints | Costs credits? |
|---|---|---|
| Account | GET /account, GET /account/usage | No |
| Discovery | GET /locations, GET/POST /projects, GET/PATCH /projects/{project_id} | No |
| Keywords | GET/POST /projects/{project_id}/keywords, DELETE .../keywords/{keyword_id} | No (checks do) |
| Rankings | .../rankings/latest, .../rankings/history, .../keywords/{keyword_id}/serp and /serp/compare | No |
| Runs | POST /projects/{project_id}/runs, GET .../runs/{run_id}, GET .../runs/latest | Yes, per check |
| Lookups | POST /lookups, GET /lookups, GET /lookups/{id} | Yes, per item |
| Competitors | .../competitors, .../share-of-voice | No |
| Share links | GET/PUT /projects/{project_id}/share | No |
| Webhooks | /webhooks, /webhooks/{id}, /test, /rotate-secret, /deliveries | No |
Projects track a keyword over time on a schedule, keep history, and feed alerts and reports. Lookups answer a one-off question ("where does this domain rank for this phrase?"), never appear in project history, and are deleted after 30 days. If you will ask twice, use a project.
Authentication, scopes and test keys
Create a key in the app under Settings, API and send it as Authorization: Bearer <key>. TrackSERPs stores only a SHA-256 hash plus the public prefix, so the secret is shown once. A key in a query string is rejected with 400 key_in_query, which keeps secrets out of server logs.
curl -H "Authorization: Bearer ts_test_demo1234_exampleexampleexampleexample1234" \
https://api.trackserps.com/v1/account
Scopes
Every key has rankings:read. The write scopes are opt-in per key, and they only work on plans with write access.
| Scope | What it allows |
|---|---|
rankings:read | All GET endpoints except webhook management, including lookups. Always on. |
projects:write | Create and update projects, manage competitors |
keywords:write | Upsert and archive keywords |
runs:write | Start runs (and dry runs) and create lookups |
shares:write | Enable, disable or regenerate a project's public share link |
webhooks:write | Create, update, test, rotate and delete webhook endpoints, and read deliveries |
Restrictions worth using
- Project restriction. Bind a key to specific project IDs. A call for any other project returns
404 not_found, not 403, so an attacker cannot confirm that an ID exists. A restricted key cannot create projects. - IP allowlist. Single IPs or CIDR ranges. Other addresses get
403 ip_not_allowed. - Expiry and rotation. Keys can expire (
401 key_expired). Rotating a key lets you choose an overlap of 0 hours, 1 hour, 24 hours or 7 days, so you can redeploy without downtime.
Test mode
A ts_test_ key runs the whole request pipeline with fake data. Reads return a demo project, writes are validated and answered with realistic success bodies and test_ IDs, and nothing is stored, charged or sent for a real search. Use it in CI and while building, then run one live check before you trust a pipeline: test mode cannot show you real timings or real SERPs.
What each plan allows
API access is a plan feature. These numbers come straight from the plan definitions.
| Plan | API access | Keys | Requests per minute (per key) | Calls per month | Webhook endpoints |
|---|---|---|---|---|---|
| Starter | Read only | 1 | 60 | 10,000 | 0 |
| Growth | Read and write | 3 | 120 | 100,000 | 2 |
| Pro | Read and write | 10 | 300 | 500,000 | 5 |
| Agency | Read and write | 25 | 600 | 2,000,000 | 20 |
Starter can pull rankings into a script or sheet but cannot create projects, add keywords, start runs or register webhooks.
How an async check works
Every fresh check follows the same path, whether it starts from a schedule, a dashboard button or POST /projects/{project_id}/runs.
- Accepted. You get
202with arun_id,status: "queued"andcredits_held. The credits are held now, before any work happens. - Queued. TrackSERPs queues one search per keyword and device. This is the slow part: normally 10 to 20 minutes, regardless of how few keywords you sent.
- Settled. As results come back, each check is stored and charged. Anything that fails is refunded. The run moves to
completed,partialorfailed, and webhooks fire. - Readable. Latest rankings, history and SERP snapshots now reflect the run.
Run status is one of queued, running, completed, partial, failed or paused_no_credits. partial means some checks finished and some failed (the failed ones were refunded). paused_no_credits means the account ran dry before the run could be funded.
The same-day cache
Fetched results pages are cached for the UTC day across all accounts. If today's results for the same phrase, location, language and device already exist, your check completes immediately and the response says cached: true on lookups. It still costs 1 credit, because the credit pays for the check, not for the provider call. Pass "fresh": true to skip the cache and always fetch a new page, which brings back the 10 to 20 minute wait. Use fresh only when you need results newer than earlier today.
Timing is a design input
Never start a check in a request handler and wait for the answer: start it, store the run_id, return. Show users "queued, usually 10-20 minutes", not a spinner that implies seconds. Where you can, rely on the schedule instead of triggering runs by hand, because scheduled runs need no API calls from you.
What each call costs
Credits are spent only when a check runs. The unit is simple: 1 credit per keyword, per device. A keyword tracked on desktop and mobile is 2 credits per run.
| Action | Credits |
|---|---|
| Any GET (rankings, history, SERP snapshots, runs, usage, locations) | 0 |
| Create project, upsert keywords, archive a keyword | 0 |
POST .../runs with no body | 1 per active keyword per device, for the whole project |
POST .../runs with keyword_ids | 1 per listed keyword per device |
POST /lookups | 1 per item, all held up front |
?dry_run=true on a run | 0, and returns what would be held |
For lookups, if your balance cannot cover every item, nothing is created and you get 402 insufficient_credits. A lookup stuck for more than 60 minutes is marked failed and refunded.
A keyword can override the project's devices; credits count on the keyword's own device list, falling back to the project's.
The monthly estimate for a project is the credits per run times the number of runs per month: 52/12 for weekly, 365/12 for daily. Forty keywords on desktop and mobile is 80 credits a run, about 347 a month weekly or about 2,434 daily. The create and upsert responses return estimated_monthly_credits so you can show a customer the number before they commit. GET /account/usage reports monthly_remaining, monthly_allowance and topup_remaining.
A full integration, step by step
The scenario: you build internal tooling for a small agency and want to onboard a client, acmeplumbing.com, track 40 keywords on desktop and mobile in the United States, and write the results to your own database when checks finish. The code uses Node 20 and fetch, and only calls endpoints in the OpenAPI spec. Swap in a ts_live_ key for real work.
1. A small client
const BASE = "https://api.trackserps.com/v1";
const KEY = process.env.TRACKSERPS_API_KEY; // ts_test_... while developing
async function api(method, path, body, headers = {}) {
const res = await fetch(BASE + path, {
method,
headers: {
Authorization: `Bearer ${KEY}`,
"Content-Type": "application/json",
...(method === "POST" ? { "Idempotency-Key": crypto.randomUUID() } : {}),
...headers,
},
body: body ? JSON.stringify(body) : undefined,
});
if (res.status === 429) {
const wait = Number(res.headers.get("Retry-After") ?? 30);
await new Promise((r) => setTimeout(r, wait * 1000));
return api(method, path, body, headers);
}
const data = res.status === 204 ? null : await res.json();
if (!res.ok) throw new Error(`${res.status} ${data?.error?.code}: ${data?.error?.message} (${data?.error?.request_id})`);
return data;
}
The helper makes a fresh Idempotency-Key per call. If your job runner retries a whole step, derive the key from your own job ID instead, so the retry reuses it.
2. Find the location code
const { locations } = await api("GET", "/locations?q=United%20States&limit=5");
// -> [{ code: 2840, name: "United States", type: "Country", country_iso: "US" }, ...]
Locations are numeric codes from this endpoint. 2840 is the United States; a city code works the same way and pins the check to that city.
3. Create the project and add keywords
const project = await api("POST", "/projects", {
name: "Acme Plumbing",
domain: "acmeplumbing.com",
folder_name: "Acme Plumbing",
location_code: 2840,
language_code: "en",
devices: ["desktop", "mobile"],
schedule: "weekly",
schedule_day: 1,
schedule_hour: 6,
});
await api("POST", `/projects/${project.id}/keywords`, {
keywords: [
{ phrase: "emergency plumber", tags: ["core"],
tracked_urls: [{ url: "acmeplumbing.com/emergency", match: "prefix" }] },
{ phrase: "drain cleaning near me", tags: ["core"] },
// up to 500 per request
],
});
Exactly one of folder_id and folder_name is required; a name reuses a folder with that exact name or creates it. The upsert matches on the normalised phrase, so sending the same list twice does not duplicate anything, and existing keywords get their tags and tracked URLs merged. Creating a project does not start a run. The weekly schedule will, or you can trigger one.
4. Trigger the first run, safely
const dry = await api("POST", `/projects/${project.id}/runs?dry_run=true`);
if (!dry.allowed) throw new Error(`Cannot run: ${dry.reason}`);
const run = await api("POST", `/projects/${project.id}/runs`, { fresh: false });
console.log(run.run_id, run.status, run.credits_held); // run_..., "queued", 80
Eighty credits held for 40 keywords on two devices. Do not poll in a loop; use a webhook.
5. Receive the result
Register the endpoint once (needs webhooks:write). The signing secret is returned only at creation.
const { webhook, secret } = await api("POST", "/webhooks", {
url: "https://tools.example.com/hooks/trackserps",
description: "Sync rankings into agency DB",
events: ["run.completed", "run.failed", "rankings.updated"],
});
// store `secret` (whsec_...) in your secrets manager now
The receiver below verifies the signature before it trusts anything, and answers fast.
import http from "node:http";
import crypto from "node:crypto";
function verify(raw, header, secret, toleranceSec = 300) {
let t = null;
const sigs = [];
for (const part of header.split(",")) {
const [k, v] = part.trim().split("=");
if (k === "t") t = Number(v);
if (k === "v1") sigs.push(v);
}
if (!Number.isFinite(t) || Math.abs(Date.now() / 1000 - t) > toleranceSec) return false;
const expected = crypto.createHmac("sha256", secret).update(`${t}.${raw}`).digest();
return sigs.some((s) => {
const b = Buffer.from(s, "hex");
return b.length === expected.length && crypto.timingSafeEqual(b, expected);
});
}
http.createServer((req, res) => {
const chunks = [];
req.on("data", (c) => chunks.push(c));
req.on("end", async () => {
const raw = Buffer.concat(chunks).toString("utf8");
if (!verify(raw, req.headers["trackserps-signature"] ?? "", process.env.WHSEC)) {
res.writeHead(400).end();
return;
}
res.writeHead(200).end("ok"); // answer first, work after
const event = JSON.parse(raw);
if (event.type === "run.completed") await syncProject(event.data.project_id);
});
}).listen(3000);
6. Read the results
async function syncProject(projectId) {
let cursor = null;
do {
const qs = new URLSearchParams({ limit: "200", ...(cursor ? { cursor } : {}) });
const page = await api("GET", `/projects/${projectId}/rankings/latest?${qs}`);
for (const r of page.rankings) {
// r.keyword_id, r.phrase, r.device, r.date, r.rank (null = outside top 100),
// r.rank_absolute, r.ranking_url, r.serp_features, r.ai_overview, r.change_7d, r.change_30d
await saveRanking(projectId, r);
}
cursor = page.next_cursor;
} while (cursor);
}
That is the loop: onboard, run, get told, read. Everything after step 4 costs zero credits.
Reading rankings: latest, history and SERP snapshots
Latest rankings. GET /projects/{project_id}/rankings/latest returns one row per keyword and device with rank (organic position 1 to 100, or null when the domain is outside the top 100), rank_absolute (position counting ads and SERP features), ranking_url, serp_features, an ai_overview object (present, cited, cited_url), and change_7d and change_30d where positive means improvement. A keyword never checked has date: null. Filter with device, tag, and include=competitors to attach competitor ranks.
History. GET .../keywords/{keyword_id}/rankings/history gives one keyword's series plus a delta of start_rank, end_rank and rank_change. GET .../rankings/history is the bulk version, grouped by keyword, 50 keywords a page by default and 200 at most, capped at 400 days, with an aggregate summary of improved, declined and unchanged keywords. Send Accept: application/x-ndjson to get one keyword per line, which suits streaming into a warehouse. Because it is heavy it counts as 5 requests against your rate limit and monthly quota.
SERP snapshots. GET .../keywords/{keyword_id}/serp returns the stored top-100 organic results for a date, with an is_you flag on your rows and AI Overview references. .../serp/compare?from=&to= compares two dates and labels each result up, down, same, new or dropped. Both are free and need only rankings:read.
Pagination
List endpoints use opaque cursors. Pass limit (default 50, maximum 500) and the cursor from the previous response's next_cursor; a null next_cursor is the last page. Never construct or parse a cursor, and keep limit and filters the same across pages.
Webhooks or polling
| Webhooks | Polling | |
|---|---|---|
| Best for | Automated pipelines, dashboards, alerts | One-off scripts, debugging, a server you cannot expose |
| Latency | Sent as soon as the check finishes | Up to your poll interval |
| API calls used | None | One per poll, counted against quota |
| Needs | A public HTTPS URL, a Growth plan or above | Nothing extra |
| Failure mode | Missed delivery, retried | Hitting the rate limit |
Seven event types exist: run.completed, run.failed, rankings.updated (a run settled and at least one rank changed), credits.low (balance under 20% of the monthly allowance), credits.exhausted, alert.triggered and lookup.completed (fires for failed lookups too).
How delivery behaves, as implemented:
- Endpoints must be public HTTPS. Loopback, link-local and private addresses are refused.
- Each request carries
TrackSERPs-Signature(t=<unix seconds>,v1=<hex hmac>),TrackSERPs-EventandTrackSERPs-Deliveryheaders. The signed string is the timestamp, a dot, then the raw body. - A delivery times out after 10 seconds. Non-success responses are retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours, so up to 8 attempts in total.
- After 20 consecutive failures the endpoint is disabled and the account owner is emailed (admins, if there is no owner).
- The event
idstays the same across retries and redeliveries. Store it and ignore repeats, because delivery is at least once. - Rotating a secret keeps the old one valid for 24 hours; during that window each request carries two
v1signatures, which the verifier above already handles. GET /webhooks/{id}/deliveriesshows 30 days of attempts, andPOST /webhooks/{id}/testsends a test event.
If you only need one-off lookups, poll no more than once a minute or subscribe to lookup.completed. The webhooks integration guide goes deeper on signatures and retries.
Rate limits and quotas
Limits are enforced per API key with a token bucket. The bucket holds your plan's per-minute allowance and refills continuously, so you can burst and then must slow down. Every authenticated response includes X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset.
| Limit | Value | Response when exceeded |
|---|---|---|
| Requests per minute, per key | 60 / 120 / 300 / 600 by plan | 429 rate_limited with Retry-After |
| Monthly API calls, per account | 10,000 / 100,000 / 500,000 / 2,000,000 | 429 quota_exceeded |
| Bulk history | Counts as 5 requests | Same as above |
| Manual runs per project | 1 every 10 minutes | 429 run_too_soon with Retry-After |
| Run requests per key | 10 per hour | 429 rate_limited |
| Lookup items per request | 100 | 422 validation_error |
| Lookup items per key | 500 per hour | 429 rate_limited |
Keywords per upsert, keyword_ids per run | 500 | Validation error |
| Failed auth from one IP | 20 in a minute | Blocked for 5 minutes |
HTTP defines 429 as "too many requests in a window", with an optional Retry-After, and TrackSERPs sends that header. Honour it instead of retrying on a fixed timer. The client in the walkthrough does.
Two details trip people up. Reads are free of credits but not of limits, so a dashboard that calls the API on every page view burns monthly calls; cache. And the run cooldown applies to targeted runs: refreshing two keywords still starts the project's 10-minute clock.
Errors and troubleshooting
All errors share one envelope: error.code, error.message and error.request_id. Validation failures add a fields map. Quote the request ID (also in X-Request-Id) to support.
| Symptom | Likely cause | Fix |
|---|---|---|
401 unauthorized | Missing or mistyped key | Check the Bearer prefix and the full key |
401 key_expired or key_revoked | Expiry reached, or a rotation grace period ended | Issue or rotate a key |
400 key_in_query | Key sent as ?api_key= | Move it to the Authorization header |
403 forbidden_scope | Key lacks the scope | Create a key with the needed scope |
403 plan_required | No plan and no credit balance, or a plan limit | Subscribe, or check project and folder limits |
404 not_found on a real project | Key restricted to other projects | Add the project to the key |
402 insufficient_credits | Balance below what the run holds | Dry run first, then top up or run fewer keywords |
422 validation_error | Bad domain, unknown field, bad location | Read the fields map; fetch codes from /locations |
409 idempotency_mismatch | Key reused with a different body | Generate a new key per distinct request |
429 run_too_soon | Second run within 10 minutes | Wait for Retry-After; webhooks show the first run settling |
When not to use the raw API
- You want a table in a spreadsheet. The API works with Apps Script or Power Query, but the TrackSERPs app already exports CSV. The Google Sheets page says plainly what exists and what does not: there is no Sheets add-on.
- You want no-code automation. Use the n8n node. There is no native Zapier app.
- You are in TypeScript. Use the Node SDK. It handles pagination, idempotency keys and lookup waiting. In Python, see the Python guide.
- You want an AI assistant to query rankings. The MCP server exposes the same data as tools.
- You need sub-second results. TrackSERPs is the wrong tool. Checks run on a queue and take minutes by design.
To go from here to a working pipeline, create a test key, run the walkthrough against it, then follow the REST API quickstart. Compare the plan limits above with the pricing plans before you leave test mode. For the front end, see the rank tracking dashboard guide.
Frequently asked questions
How long does a fresh check take through the API?
What does an API call cost in credits?
Should I poll or use webhooks?
Can I try the API without spending credits?
Which plans include API access?
How do I avoid double-charging when a request times out?
Is there a Python or Node client?
Sources & references
- RFC 9110 section 15.3.3: 202 Accepted(checked 2026-11-11)
- Google Search Central: How Google Search works(checked 2026-11-11)
- RFC 6585 section 4: 429 Too Many Requests(checked 2026-11-11)
- OpenAPI Specification 3.1.0(checked 2026-11-11)