TrackSERPs
Log in

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.

Account-level resource: Lookups belong directly to your account rather than a project. API keys restricted to specific 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").

POST /v1/lookups
curl -X POST "https://api.trackserps.com/v1/lookups" \
  -H "Authorization: Bearer ts_live_your_api_key_here" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 9b2e4d18-7a50-4f13-8f30-6b4d2a19c001" \
  -d '{
    "items": [
      {
        "phrase": "emergency plumber chicago",
        "domain": "example-plumbing.com",
        "location_code": 2840,
        "language_code": "en",
        "device": "desktop",
        "engine": "google",
        "url": "https://example-plumbing.com/chicago",
        "match": "exact"
      }
    ],
    "fresh": false
  }'

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):

202 Accepted (Queued for Collection)
{
  "data": [
    {
      "id": "cmwc0f2lk0003rqk7look1up01",
      "phrase": "emergency plumber chicago",
      "phrase_normalised": "emergency plumber chicago",
      "domain": "example-plumbing.com",
      "url": "https://example-plumbing.com/chicago",
      "match": "exact",
      "location_code": 2840,
      "language_code": "en",
      "device": "desktop",
      "engine": "google",
      "fresh": false,
      "status": "running",
      "credits_held": 1,
      "credits_charged": 0,
      "result": null,
      "error": null,
      "created_at": "2026-11-11T08:00:00.000Z",
      "completed_at": null,
      "expires_at": "2026-12-11T08:00:00.000Z"
    }
  ]
}

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 202 response 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.completed webhook or poll GET /v1/lookups/{id} no more than once a minute.
Polling Lookup Results
curl -X GET "https://api.trackserps.com/v1/lookups/cmwc0f2lk0003rqk7look1up01" \
  -H "Authorization: Bearer ts_live_your_api_key_here" \
  -H "Accept: application/json"

# Or list recent completed lookups with cursor pagination
curl -X GET "https://api.trackserps.com/v1/lookups?status=completed&limit=50" \
  -H "Authorization: Bearer ts_live_your_api_key_here" \
  -H "Accept: application/json"
Completed Lookup Object (status: completed)
{
  "id": "cmwc0f2lk0003rqk7look1up01",
  "phrase": "emergency plumber chicago",
  "phrase_normalised": "emergency plumber chicago",
  "domain": "example-plumbing.com",
  "url": "https://example-plumbing.com/chicago",
  "match": "exact",
  "location_code": 2840,
  "language_code": "en",
  "device": "desktop",
  "engine": "google",
  "fresh": false,
  "status": "completed",
  "credits_held": 1,
  "credits_charged": 1,
  "result": {
    "rank": 4,
    "rank_absolute": 6,
    "url": "https://example-plumbing.com/chicago",
    "matched_url_rank": 4,
    "serp_features": ["local_pack", "people_also_ask", "ai_overview"],
    "ai_overview": {
      "present": true,
      "cited": true,
      "cited_url": "https://example-plumbing.com/chicago",
      "references": [
        {
          "domain": "example-plumbing.com",
          "url": "https://example-plumbing.com/chicago",
          "title": "Emergency Plumber in Chicago"
        }
      ]
    },
    "top": [
      {
        "rank": 1,
        "url": "https://top-plumber.example.com/chicago",
        "domain": "top-plumber.example.com",
        "title": "24/7 Emergency Plumber in Chicago"
      }
    ],
    "checked_at": "2026-11-11T08:14:42.000Z",
    "fresh": false,
    "cached": false
  },
  "error": null,
  "created_at": "2026-11-11T08:00:00.000Z",
  "completed_at": "2026-11-11T08:14:43.000Z",
  "expires_at": "2026-12-11T08:00:00.000Z"
}

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):

lookup.completed Webhook Event
{
  "id": "evt_01931b9a2f007890abcd1234",
  "type": "lookup.completed",
  "created_at": "2026-11-11T08:14:43.000Z",
  "account_id": "cmwc0f1xj0001rqk7a2ccnt01",
  "data": {
    "id": "cmwc0f2lk0003rqk7look1up01",
    "phrase": "emergency plumber chicago",
    "phrase_normalised": "emergency plumber chicago",
    "domain": "example-plumbing.com",
    "url": "https://example-plumbing.com/chicago",
    "match": "exact",
    "location_code": 2840,
    "language_code": "en",
    "device": "desktop",
    "engine": "google",
    "fresh": false,
    "status": "completed",
    "credits_held": 1,
    "credits_charged": 1,
    "result": {
      "rank": 4,
      "rank_absolute": 6,
      "url": "https://example-plumbing.com/chicago",
      "matched_url_rank": 4,
      "serp_features": ["local_pack", "people_also_ask"],
      "ai_overview": {
        "present": false,
        "cited": false,
        "cited_url": null,
        "references": []
      },
      "top": [],
      "checked_at": "2026-11-11T08:14:42.000Z",
      "fresh": false,
      "cached": false
    },
    "error": null,
    "created_at": "2026-11-11T08:00:00.000Z",
    "completed_at": "2026-11-11T08:14:43.000Z",
    "expires_at": "2026-12-11T08:00:00.000Z"
  }
}

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 url to 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_charged remains 0.

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):

ModeBehaviourresult.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: trueForces 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: 1 to 100 items per POST /v1/lookups request (422 validation_error above 100).
  • Hourly item cap: At most 500 lookup items per API key per hour. Exceeding this window returns 429 rate_limited with a Retry-After header indicating seconds until the hourly window resets.
  • Idempotency: Pass an Idempotency-Key header on POST /v1/lookups to 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.