TrackSERPs
Log in

SERP Tracking API: Endpoints, Credits and Async Checks

Quick answer

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.

AreaMain endpointsCosts credits?
AccountGET /account, GET /account/usageNo
DiscoveryGET /locations, GET/POST /projects, GET/PATCH /projects/{project_id}No
KeywordsGET/POST /projects/{project_id}/keywords, DELETE .../keywords/{keyword_id}No (checks do)
Rankings.../rankings/latest, .../rankings/history, .../keywords/{keyword_id}/serp and /serp/compareNo
RunsPOST /projects/{project_id}/runs, GET .../runs/{run_id}, GET .../runs/latestYes, per check
LookupsPOST /lookups, GET /lookups, GET /lookups/{id}Yes, per item
Competitors.../competitors, .../share-of-voiceNo
Share linksGET/PUT /projects/{project_id}/shareNo
Webhooks/webhooks, /webhooks/{id}, /test, /rotate-secret, /deliveriesNo

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.

ScopeWhat it allows
rankings:readAll GET endpoints except webhook management, including lookups. Always on.
projects:writeCreate and update projects, manage competitors
keywords:writeUpsert and archive keywords
runs:writeStart runs (and dry runs) and create lookups
shares:writeEnable, disable or regenerate a project's public share link
webhooks:writeCreate, 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.

PlanAPI accessKeysRequests per minute (per key)Calls per monthWebhook endpoints
StarterRead only16010,0000
GrowthRead and write3120100,0002
ProRead and write10300500,0005
AgencyRead and write256002,000,00020

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.

  1. Accepted. You get 202 with a run_id, status: "queued" and credits_held. The credits are held now, before any work happens.
  2. 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.
  3. Settled. As results come back, each check is stored and charged. Anything that fails is refunded. The run moves to completed, partial or failed, and webhooks fire.
  4. 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.

ActionCredits
Any GET (rankings, history, SERP snapshots, runs, usage, locations)0
Create project, upsert keywords, archive a keyword0
POST .../runs with no body1 per active keyword per device, for the whole project
POST .../runs with keyword_ids1 per listed keyword per device
POST /lookups1 per item, all held up front
?dry_run=true on a run0, 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

WebhooksPolling
Best forAutomated pipelines, dashboards, alertsOne-off scripts, debugging, a server you cannot expose
LatencySent as soon as the check finishesUp to your poll interval
API calls usedNoneOne per poll, counted against quota
NeedsA public HTTPS URL, a Growth plan or aboveNothing extra
Failure modeMissed delivery, retriedHitting 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-Event and TrackSERPs-Delivery headers. 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 id stays 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 v1 signatures, which the verifier above already handles.
  • GET /webhooks/{id}/deliveries shows 30 days of attempts, and POST /webhooks/{id}/test sends 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.

LimitValueResponse when exceeded
Requests per minute, per key60 / 120 / 300 / 600 by plan429 rate_limited with Retry-After
Monthly API calls, per account10,000 / 100,000 / 500,000 / 2,000,000429 quota_exceeded
Bulk historyCounts as 5 requestsSame as above
Manual runs per project1 every 10 minutes429 run_too_soon with Retry-After
Run requests per key10 per hour429 rate_limited
Lookup items per request100422 validation_error
Lookup items per key500 per hour429 rate_limited
Keywords per upsert, keyword_ids per run500Validation error
Failed auth from one IP20 in a minuteBlocked 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.

SymptomLikely causeFix
401 unauthorizedMissing or mistyped keyCheck the Bearer prefix and the full key
401 key_expired or key_revokedExpiry reached, or a rotation grace period endedIssue or rotate a key
400 key_in_queryKey sent as ?api_key=Move it to the Authorization header
403 forbidden_scopeKey lacks the scopeCreate a key with the needed scope
403 plan_requiredNo plan and no credit balance, or a plan limitSubscribe, or check project and folder limits
404 not_found on a real projectKey restricted to other projectsAdd the project to the key
402 insufficient_creditsBalance below what the run holdsDry run first, then top up or run fewer keywords
422 validation_errorBad domain, unknown field, bad locationRead the fields map; fetch codes from /locations
409 idempotency_mismatchKey reused with a different bodyGenerate a new key per distinct request
429 run_too_soonSecond run within 10 minutesWait 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?
Roughly 10-20 minutes, even for a single keyword, because checks are queued rather than fetched live. If the same phrase, location, language and device was already fetched earlier the same UTC day, the check completes immediately with cached true. Pass fresh true to skip that cache and fetch a new results page.
What does an API call cost in credits?
Only checks cost credits: 1 per keyword per device, held when the run is accepted and settled as each check finishes. Checks that fail are refunded. Every read endpoint costs zero credits, though each request still counts toward your per-minute rate limit and monthly call allowance.
Should I poll or use webhooks?
Use a webhook for anything automated. Subscribe to run.completed for project runs or lookup.completed for one-off lookups, and the event is sent as soon as the check finishes. Polling is fine for scripts and debugging: check a run or lookup about once a minute, not in a tight loop.
Can I try the API without spending credits?
Yes. Keys starting with ts_test_ validate every request and return realistic fake data with test_ IDs. Nothing is saved, no credits are spent and no searches are fetched. Test responses carry the header X-TrackSERPs-Test-Mode set to true, so you can assert on it in CI.
Which plans include API access?
Starter has read-only access with one key. Growth, Pro and Agency can also write: create projects, add keywords, start runs, manage share links and register webhooks. An account without a plan but with a positive credit balance gets Starter limits. Without either, requests return 403 plan_required.
How do I avoid double-charging when a request times out?
Send an Idempotency-Key header with every POST. If the same key arrives again within 24 hours with an identical body, the original response is returned and no second run or charge happens. Reusing a key with a different body returns 409 idempotency_mismatch.
Is there a Python or Node client?
There is an official TypeScript client, @trackserps/sdk, with pagination helpers and a lookup waiter. For Python there is no packaged client; you call the REST endpoints with requests or httpx, as the Python guide shows. Everything in the SDK is a thin wrapper over the endpoints described here.

Sources & references

  1. RFC 9110 section 15.3.3: 202 Accepted(checked 2026-11-11)
  2. Google Search Central: How Google Search works(checked 2026-11-11)
  3. RFC 6585 section 4: 429 Too Many Requests(checked 2026-11-11)
  4. OpenAPI Specification 3.1.0(checked 2026-11-11)