Rank Lookups
Check where any domain (and optional target URL) ranks on Google or Bing for a search phrase on demand—without creating a project or adding recurring tracked keywords.
What Rank Lookups Are For
Rank lookups (POST /v1/lookups) are designed for ad-hoc checks: prospecting audits, pre-sales snapshots, content briefs, or spot-checking competitor domains across locations and devices. Each lookup returns the target domain's best organic rank, optional URL match rank, detected SERP features, and the top 10 organic results.
projectIds can still create and read lookups provided they carry the required scopes (runs:write to create, rankings:read to fetch).Creating Lookups
Send between 1 and 100 items in a single POST /v1/lookups call. Every item specifies phrase, domain, and location_code (validated against GET /v1/locations, or GET /v1/locations?engine=bing for Bing; unknown or unsupported codes return 422 unsupported_location). Optional fields let you customize engine ("google" default or "bing", accepted per item or at the top level), language_code (defaults to "en"), device ("desktop" default or "mobile"), and a specific url + match mode ("exact", "prefix", or "domain").
The endpoint returns HTTP 202 Accepted with a data array in the same order as your request items. If a SERP is queued for asynchronous collection, its initial status is running (or queued when joining an already in-flight task):
If today's SERP is already in the daily cache (and fresh is not set), the lookup resolves synchronously in the same HTTP call and returns status: "completed" with result populated immediately.
Retrieving Results: Webhooks or Polling
Lookups run in a queue:
- Instant (same-day cache hit): Completes immediately inside the
202response when the exact(phrase, location_code, language_code, device, engine)SERP was already fetched earlier in the current UTC day. - Asynchronous queue (roughly 10–20 minutes): Results normally arrive in roughly 10–20 minutes, or instantly when the same SERP was already fetched today; use the
lookup.completedwebhook or pollGET /v1/lookups/{id}no more than once a minute.
When subscribed to lookup.completed, your webhook endpoint receives a signed delivery both when a lookup succeeds (status: "completed") and if upstream collection fails (status: "failed" with error populated):
Cost & Atomic Credit Holds
- 1 credit per item: Every lookup item costs 1 credit, regardless of whether it hits today's shared cache or dispatches a new SERP fetch, and regardless of whether you also pass an optional
urlto match. - All-or-nothing upfront hold: Credits for the entire batch are held atomically before any work starts. If your account cannot cover all items in the request, the API returns
402 insufficient_credits, creates zero lookups, and holds zero credits. - Automatic refund on failure: If an upstream SERP check fails or times out, the held credit is automatically released back to its original credit bucket and
credits_chargedremains0.
Fresh vs. Cached Semantics
By default (fresh: false), TrackSERPs deduplicates SERP fetches per UTC calendar day across all customers for the tuple (phrase_normalised, location_code, language_code, device, engine):
| Mode | Behaviour | result.cached |
|---|---|---|
fresh: false (default) | Reuses today's UTC SERP if already fetched (resolving immediately), or shares an in-flight task. Still costs 1 credit per item. | true when served from an existing fetch; false when your lookup initiated the day's first fetch. |
fresh: true | Forces a brand-new SERP fetch isolated to that lookup. Never reads from or overwrites the shared daily cache—the only way to pull a newer SERP on the same UTC day. | Always false. |
Limits & Rate Controls
- Batch size:
1to100items perPOST /v1/lookupsrequest (422 validation_errorabove 100). - Hourly item cap: At most 500 lookup items per API key per hour. Exceeding this window returns
429 rate_limitedwith aRetry-Afterheader indicating seconds until the hourly window resets. - Idempotency: Pass an
Idempotency-Keyheader onPOST /v1/lookupsto safely retry network timeouts over 24 hours without double-holding credits. See Idempotency.
30-Day Retention (Not Stored in Project History)
Lookups are ephemeral: every lookup carries an expires_at timestamp set to 30 days after creation, after which daily housekeeping permanently deletes the lookup record (credit ledger entries are retained for billing history).
Lookup results never write into project rank history, KPIs, email digests, or rank alerts. If you want ongoing longitudinal rank tracking, charts, and automated alerts, add keywords to a project via POST /v1/projects/:id/keywords instead.
Test Mode (ts_test_ Keys)
Calling POST /v1/lookups, GET /v1/lookups, or GET /v1/lookups/:id with a ts_test_ key runs full schema and location_code validation, then returns synthetic completed lookups with test_lookup_ IDs and realistic top-10 SERP payloads. Nothing is persisted and zero credits are held or charged (credits_held and credits_charged are 0). Because nothing is stored, GET /v1/lookups always returns an empty list, while GET /v1/lookups/:id re-creates the synthetic lookup for an ID returned by POST /v1/lookups with a test key and returns 404 for any other ID.