REST API

Read your keyword rankings, ranking history, trend analysis and competitors as JSON, for your own dashboards, client reports or spreadsheets.

Overview

Base URL:

https://seotool.premiercodeinc.com/api/v1
  • The API is read-only. Every endpoint is a GET. Reading data never starts a rank check or uses your check quota.
  • API access is included with the Pro plan and higher (and during the free trial).
  • A key can only read the websites in its own account.
  • Data updates when your scheduled checks run (daily, weekly or monthly, set per website).

Authentication

Create a key on your Account page under API keys. The full key is shown once, when you create it. We store only a one-way hash, so we can't show it again. If you lose a key, revoke it and create a new one.

Send the key in the Authorization header on every request:

curl https://seotool.premiercodeinc.com/api/v1/domains \
  -H "Authorization: Bearer seo_your_api_key"

Keys start with seo_. Treat them like passwords: keep them on your server, never in browser code or a public repository. Revoking a key takes effect immediately.

Rate limits

Each key may make 60 requests per minute. Short bursts are fine. Over the limit, the API answers 429 with a Retry-After header giving the seconds to wait.

Errors

Errors use standard HTTP status codes and a JSON body:

{
  "error": {
    "code": "not_found",
    "message": "You aren't tracking that domain."
  }
}
StatusCodeMeaning
400invalid_parameterA query parameter is out of range or malformed.
401unauthorizedMissing, malformed, invalid or revoked key.
402subscription_requiredThe account has no active subscription or trial.
403plan_upgrade_requiredThe account's plan doesn't include API access.
404not_foundThe domain or keyword isn't in your account, or the endpoint doesn't exist.
405method_not_allowedOnly GET is supported.
409ambiguous_domainYou track the domain more than once. Pick one with site_id.
429rate_limitedToo many requests. Wait for Retry-After seconds.

Conventions

  • Domains go in the path as a bare host, e.g. example.com. Case and a leading www. are ignored.
  • Multiple sites for one domain. If you track a domain more than once (for example in two locations), add ?site_id=. The 409 response lists the matching sites and their ids.
  • Positions are Google organic positions from 1 to 100. null means the site wasn't found in the top 100 at that check.
  • Change is positive when a keyword moved up (e.g. from 8 to 5 is +3).
  • Timestamps are RFC 3339 in UTC. Date parameters accept 2026-01-31 or a full RFC 3339 timestamp.
  • History lists are newest first.

GET /domains

Every website in your account.

curl https://seotool.premiercodeinc.com/api/v1/domains -H "Authorization: Bearer $KEY"
{
  "domains": [
    {
      "id": 42,
      "name": "Example Plumbing",
      "domain": "example.com",
      "location": "Dallas,Texas,United States",
      "device": "desktop",
      "google_domain": "google.com",
      "gl": "us",
      "hl": "en",
      "provider": "serper",
      "cadence": "daily",
      "keyword_count": 35,
      "last_run_at": "2026-11-07T06:00:12Z",
      "next_run_at": "2026-11-08T06:00:12Z",
      "check_running": false,
      "created_at": "2026-06-02T15:21:40Z"
    }
  ]
}

GET /domains/{domain}

The site's details, a ranking summary, and every keyword's current position, stats and most recent checks.

ParameterDefaultDescription
history10Recent checks to include per keyword, 0 to 100.
site_idPicks one site when you track the domain more than once.
curl "https://seotool.premiercodeinc.com/api/v1/domains/example.com?history=3" -H "Authorization: Bearer $KEY"
{
  "site": { "id": 42, "domain": "example.com", "...": "same fields as /domains" },
  "summary": {
    "keywords": 35,
    "top3": 6,
    "top10": 14,
    "top20": 21,
    "top100": 31,
    "not_found": 3,
    "unchecked": 1,
    "average_position": 14.2,
    "visibility": 23.5
  },
  "keywords": [
    {
      "id": 901,
      "phrase": "emergency plumber dallas",
      "position": 4,
      "url": "https://example.com/emergency",
      "previous_position": 6,
      "change": 2,
      "best_position": 3,
      "worst_position": 11,
      "average_position": 5.8,
      "checks": 120,
      "checks_ranked": 120,
      "checks_on_page1": 117,
      "first_checked_at": "2026-07-10T06:00:03Z",
      "last_checked_at": "2026-11-07T06:00:09Z",
      "history": [
        { "position": 4, "url": "https://example.com/emergency", "checked_at": "2026-11-07T06:00:09Z" },
        { "position": 6, "url": "https://example.com/emergency", "checked_at": "2026-11-06T06:00:11Z" },
        { "position": 5, "url": "https://example.com/emergency", "checked_at": "2026-11-05T06:00:08Z" }
      ]
    }
  ]
}

visibility is a 0–100 score: the average of 1/position across your keywords, so 100 means every keyword is at #1. average_position counts only checks where the keyword ranked.

GET /domains/{domain}/keywords/{id}

One keyword's full history, its stats, the times its ranking page changed, and the sites in the top 10 at its latest check. Keyword ids come from /domains/{domain}.

ParameterDefaultDescription
limit100Checks to return, 1 to 1000.
sinceOnly checks on or after this date/time.
untilOnly checks on or before this date/time.
site_idAs above.
{
  "site": { "id": 42, "domain": "example.com", "...": "..." },
  "keyword": { "id": 901, "phrase": "emergency plumber dallas", "created_at": "2026-07-10T05:58:00Z" },
  "stats": { "position": 4, "change": 2, "best_position": 3, "...": "same fields as above" },
  "history": [
    { "position": 4, "url": "https://example.com/emergency", "checked_at": "2026-11-07T06:00:09Z" }
  ],
  "url_changes": [
    { "from": "https://example.com/", "to": "https://example.com/emergency", "position": 7, "checked_at": "2026-08-14T06:00:02Z" }
  ],
  "latest_competitors": [
    { "position": 1, "domain": "rival-plumbing.com", "url": "https://rival-plumbing.com/dallas" },
    { "position": 2, "domain": "yelp.com", "url": "https://www.yelp.com/search?..." }
  ]
}

url_changes lists the checks where Google ranked a different page of yours than before. It's often a sign of two pages competing for the same keyword, or of a site change. latest_competitors excludes your own site.

The site-wide trend analysis from the website page. Each keyword's recent median position is compared with an earlier baseline, so a single noisy check doesn't count as a move. The period lengths depend on the site's check cadence and are returned as recent_days and baseline_days.

{
  "site": { "...": "..." },
  "has_trends": true,
  "recent_days": 7,
  "baseline_days": 21,
  "counts": { "total": 35, "up": 8, "down": 5, "flat": 17, "lost": 1, "not_ranking": 3, "no_data": 1 },
  "page1": { "now": 14, "change": 2 },
  "top3": { "now": 6, "change": -1 },
  "visibility": {
    "score": 23.5,
    "change": 1.8,
    "keywords": 34,
    "series": [ { "date": "2026-11-06", "score": 22.9 }, { "date": "2026-11-07", "score": 23.5 } ]
  },
  "gainers": [ { "keyword_id": 901, "phrase": "emergency plumber dallas", "from": "#9", "to": "#4" } ],
  "decliners": [ { "keyword_id": 917, "phrase": "water heater repair", "from": "#6", "to": "#14" } ],
  "more_gainers": 3,
  "more_decliners": 0,
  "findings": [
    { "title": "3 decliners share a page", "detail": "..." }
  ],
  "keywords": [
    {
      "id": 917,
      "phrase": "water heater repair",
      "state": "down",
      "baseline_position": 6,
      "recent_position": 14,
      "move": -8,
      "url_before": "https://example.com/water-heaters",
      "url_now": "https://example.com/water-heaters"
    }
  ]
}

state is one of up, down, flat, lost (ranked in the baseline, not in the top 100 now), not_ranking or no_data (too few checks to judge). findings are patterns among the declining keywords, such as several on the same page or a drop on the same day. They describe what happened in the data, not why it happened.

GET /domains/{domain}/competitors

The other domains that appeared in Google's top 10 for your keywords, ranked by how often they appeared.

ParameterDefaultDescription
days30Look-back period, 1 to 365.
site_idAs above.
{
  "site": { "...": "..." },
  "period_days": 30,
  "checks": 1050,
  "competitors": [
    {
      "domain": "rival-plumbing.com",
      "appearances": 612,
      "share_of_voice": 58.3,
      "keywords": 24,
      "average_position": 3.1,
      "outranked_you": 401
    }
  ]
}

share_of_voice is the percentage of your checks in the period where the domain was in the top 10. outranked_you counts the checks where it ranked above your site, or where your site wasn't in the top 100. Up to 25 competitors are returned.


Questions or a feature request for the API? Open a support ticket or email info@premiercodeinc.com.