Skip to content
MrKeyword
Developers

How to build your own SEO tool with an API

You do not need a crawler to launch an SEO tool. You need the right data, an API key, a small server that calls the API and caches the answers, and a price that covers your API bill. This guide walks through each step with working requests against MrKeyword's Data API, in curl, JavaScript and Python, and ends with the pricing math for five common tools.

Soft white and lavender building blocks assembled into a small dashboard screen on a workbench
The short version
  • Decide the one job your tool does first (authority, backlinks, keywords). It picks the endpoints, and the endpoints set your cost per lookup.
  • Keep the API key on your server. The browser calls your server; your server calls the API, caches the answer and returns it.
  • Every MrKeyword answer is { data, meta }; meta.creditsCharged tells you the cost of each call. A 402 means no credits left, a 429 means slow down for Retry-After seconds.
  • Batch where the API allows it: up to 100 domains per authority call and 500 keywords per difficulty, intent or cluster call, charged 1 credit per 10 keywords.
  • Cache by domain or keyword for at least a day. With caching, most small tools fit the free Developer plan (500 credits) or API Starter at $29 a month.

What do you need to build an SEO tool?

To build an SEO tool on an API you need four pieces: a data source (the API), a small backend that holds the key and caches answers, a front end that shows the results with their labels, and a price that covers what the API charges you. Everything else, accounts, billing and design, is ordinary web development.

The alternative is collecting the data yourself: a crawler, a link graph, a keyword database and the models on top. That is several long-running systems, and the shortcut many people try, scraping Google's results, is against Google's spam policies. Building on an API lets you test whether anyone wants your tool in days. You can always replace the data layer later if the data itself becomes your product.

This guide uses MrKeyword's Data API for every example because we make it and can show exact requests and prices. The structure works the same with any SEO API; the comparison of SEO APIs covers the others.

Step 1: pick the tool and the data it needs

Start from the single question your tool answers, then map it to the fewest endpoints that answer it. Fewer endpoints mean a lower cost per lookup and a simpler cache. The common tools map like this:

Tools, the data they need, and the endpoint that serves it

ToolQuestion it answersEndpointCredits
Domain authority checkerHow strong is this domain?GET|POST /domains/authority1 credit per domain
Backlink checkerWho links to this domain?GET /domains/referring-domains, GET /domains/backlinks2 credits each
Website traffic checkerRoughly how much organic traffic does it get?GET|POST /domains/traffic1 credit per domain
Domain reportEverything at a glanceGET /domains/overview3 credits
Keyword research toolWhat should I target, and how hard is it?GET /keywords/ideas, GET|POST /keywords/metrics2 credits; 1 credit per keyword with data
Keyword graderHow hard and what intent, for my list?POST /keywords/difficulty, POST /keywords/intent1 credit per 10 keywords
Content plannerHow do these keywords group into pages?POST /keywords/cluster1 credit per 10 keywords
Competitor keywordsWhat does that site rank for?GET /domains/organic-keywords3 credits
Credit costs from MrKeyword's price list, which the API also serves without a key at GET /api/v1/catalog.

Be clear about what you are not building. MrKeyword's API predicts which keywords a domain ranks for, but it does not check live Google results, so it will not power a live rank tracker; for that you need a SERP provider. Saying so on your own page early saves support emails later.

Free keyword research toolMonthly searches fetched live from Google Keyword Planner, with source and time on every figure.

Check a keyword

Step 2: get an API key

Create a free MrKeyword account, open Data API in the menu and press Create API key. The key starts with mkd_ and is shown once, so copy it into your server's environment straight away (for example MRKEYWORD_KEY). Every workspace starts on the Developer plan: 500 credits a month and 60 calls a minute, with no card.

  • One key per environment. Use separate keys for development and production, so revoking one never breaks the other. A workspace can hold up to 20 live keys.
  • Never in the browser. The API allows cross-origin calls, but a key in front-end code can be copied by anyone who opens the page and spent on your bill.
  • Set an expiry for experiments. A key can carry an end date and stops working after it.

Step 3: make your first call with curl

Send the key as a Bearer header and the domain or keyword as a query parameter; every success is HTTP 200 with { data, meta }. Start in the terminal so you see the raw answer before writing code.

Authority for one domain

curl "https://app.mrkeyword.io/api/v1/domains/authority?domain=example.com" \
  -H "Authorization: Bearer $MRKEYWORD_KEY"
1 credit per domain. x-api-key: mkd_… works too.

What comes back (abridged)

{
  "data": {
    "input": "example.com",
    "domain": "example.com",
    "authority": { "value": 46, "label": "Derived", "confidence": "high", "asOf": "2026-12-03", "referringDomains": 312, "reason": null },
    "referringDomains": { "value": 312, "label": "Measured" },
    "backlinks": { "value": 2184, "label": "Measured", "follow": 1560, "nofollow": 624 }
  },
  "meta": { "endpoint": "domains.authority", "creditsCharged": 1, "creditsRemaining": 499, "plan": "free", "generatedAt": "2026-12-04T09:30:00.000Z" }
}
Field names as the API returns them; the numbers are illustrative.

Three fields matter in every answer. label says what kind of number it is (Measured, Derived, Estimated, Predicted or Not available). confidence says how much evidence stands behind it. And reason explains a null: when MrKeyword has no data for a domain it says so rather than inventing a number, and your tool should do the same.

Keyword lists go in a JSON body. This call grades three keywords for difficulty in the US market:

Difficulty for a keyword list

curl -X POST "https://app.mrkeyword.io/api/v1/keywords/difficulty" \
  -H "Authorization: Bearer $MRKEYWORD_KEY" \
  -H "content-type: application/json" \
  -d '{"keywords":["plumber near me","emergency plumber","plumber cost"],"market":"US"}'
1 credit per 10 keywords, rounded up, so three keywords cost 1 credit. Up to 500 keywords per call.

Step 4: call the API from JavaScript, on your server

Put a thin endpoint of your own in front of the API: the browser asks your server, your server checks its cache, calls MrKeyword only on a miss, and returns the answer. This keeps the key secret, lets you rate-limit your own users, and turns repeat lookups into free ones. The example uses Node 18 or later, which has fetch built in.

server.mjs: a cached authority lookup (Node 18+)

import http from "node:http";

const BASE = "https://app.mrkeyword.io/api/v1";
const KEY = process.env.MRKEYWORD_KEY;
const DAY = 24 * 60 * 60 * 1000;
const cache = new Map(); // domain -> { at, data }

async function authority(domain) {
  const hit = cache.get(domain);
  if (hit && Date.now() - hit.at < DAY) return hit.data;
  const res = await fetch(`${BASE}/domains/authority?domain=${encodeURIComponent(domain)}`, {
    headers: { authorization: `Bearer ${KEY}` },
  });
  const body = await res.json();
  if (res.status === 429) throw Object.assign(new Error(body.error), { status: 429, retryAfter: Number(res.headers.get("retry-after") || 60) });
  if (!res.ok) throw Object.assign(new Error(body.error), { status: res.status });
  console.log("credits left", body.meta.creditsRemaining);
  cache.set(domain, { at: Date.now(), data: body.data });
  return body.data;
}

http.createServer(async (req, res) => {
  const url = new URL(req.url, "http://localhost");
  if (url.pathname !== "/api/authority") { res.writeHead(404).end(); return; }
  try {
    const data = await authority(String(url.searchParams.get("domain") || "").trim().toLowerCase());
    res.writeHead(200, { "content-type": "application/json" }).end(JSON.stringify(data));
  } catch (error) {
    res.writeHead(error.status === 400 ? 400 : 503, { "content-type": "application/json" })
      .end(JSON.stringify({ error: error.status === 400 ? error.message : "Try again in a minute." }));
  }
}).listen(3000);
An in-memory Map is enough to start; swap it for Redis or a database table when you run more than one server.

Notice what the server does not pass through: it never forwards MrKeyword's 402 or 429 to your visitor as-is. Those are your account's problems, not theirs, so log them and show a friendly retry message. A 400 is the visitor's input (a malformed domain), so its message is safe to show.

Step 5: batch keyword lists in Python

For lists, send as many items per call as the endpoint allows: it is cheaper in round trips and in rate-limit headroom, and the keyword list endpoints charge per ten keywords rather than per call. This script grades a keyword file of any length in chunks of 500, waits when told to, and stops cleanly when credits run out. It uses the requests library.

grade.py: difficulty and intent for a long keyword list

import os, sys, time, requests

BASE = "https://app.mrkeyword.io/api/v1"
session = requests.Session()
session.headers["Authorization"] = f"Bearer {os.environ['MRKEYWORD_KEY']}"

def post(path, payload):
    while True:
        r = session.post(f"{BASE}{path}", json=payload, timeout=60)
        if r.status_code == 429:
            time.sleep(int(r.headers.get("Retry-After", "60")))
            continue
        if r.status_code == 402:
            sys.exit(f"Out of credits: {r.json()['credits']}")
        r.raise_for_status()
        return r.json()

keywords = [line.strip() for line in open("keywords.txt") if line.strip()]
rows = []
for i in range(0, len(keywords), 500):
    chunk = keywords[i:i + 500]
    kd = post("/keywords/difficulty", {"keywords": chunk, "market": "US"})
    intent = post("/keywords/intent", {"keywords": chunk})
    by_kw = {r["keyword"]: r for r in intent["data"]["results"]}
    for r in kd["data"]["results"]:
        rows.append((r["keyword"], r["difficulty"], r["label"], by_kw.get(r["keyword"], {}).get("intent")))
    print("charged", kd["meta"]["creditsCharged"] + intent["meta"]["creditsCharged"], "credits")

for row in rows:
    print(*row, sep="\t")
For 500 keywords, each of the two calls costs 50 credits. Keywords are lower-cased and de-duplicated by the API.

Step 6: cache, so each lookup is paid for once

Cache every answer by endpoint and input, for as long as the data stays meaningful: a day for domain data, a month for keyword volumes. Without a cache, a popular tool pays for the same lookup every time a visitor types example.com; with one, it pays once a day.

  • Key: endpoint plus the normalised input, for example authority:example.com or kd:US:plumber near me. Lower-case domains and strip www. before caching.
  • Lifetime: authority, backlinks and traffic change slowly, so 24 hours is safe. Keyword metrics are monthly figures; a few weeks is fine. Use the asOf date in each answer to decide when a cached row is stale.
  • Cache misses that had no data, too. A domain with a null value and a reason will usually still be empty tomorrow; cache it for a shorter time, say six hours, so you do not pay for it on every visit.
  • Warm the cache for the domains and keywords your landing pages show, so the first visitor gets an instant answer.

Step 7: respect rate limits and credits

MrKeyword limits calls per minute per key by plan and charges credits per call; a 429 says wait, a 402 says top up, and a call that fails on MrKeyword's side costs nothing. The plan limits are:

Data API plans: credits and rate limits

PlanPriceCredits a monthCalls a minute
DeveloperFree50060
API Starter$29 a month20,000300
API Growth$99 a month100,000600
API Scale$299 a month400,0001,500
From MrKeyword's price list. A credit pack adds 10,000 credits for $20, valid 12 months, spent after the monthly allowance.
  • 429 Too Many Requests comes with a Retry-After header in seconds, the standard defined in RFC 6585. Wait that long, then retry once. Do not retry in a tight loop.
  • 402 Payment Required means the month's allowance and any packs are spent. The body carries credits.required and credits.remaining. Alert yourself, not your visitor.
  • Watch the meter: meta.creditsRemaining and the x-mrkeyword-credits-remaining header are on every answer, and GET /usage is free. Alert at 80% of the month's allowance.
  • Batch to stay under the limit: one POST of 100 domains is one call against the per-minute limit, not a hundred.

Step 8: show results your users can trust

Show each number with its label and date, explain empty results with the API's reason, and never print a zero where the API returned null. SEO numbers from any provider are estimates or partial counts; tools that pretend otherwise lose trust the first time a user compares them with another tool.

  • Write the label next to the figure: "Link Authority 46 · Derived · as of 3 Dec 2026".
  • Show the confidence, or hide low-confidence scores behind a "limited data" note.
  • For keyword difficulty, say it is estimated. For predicted rankings, say they are predictions, not live positions.
  • Link counts are the links the index has found, not every link on the web; a short note under the table sets that expectation.

Reselling is allowed. Building a public tool on the Data API is what it is for. Keep the labels, call from your server, and contact MrKeyword for bigger volumes, invoicing or a data feed.

Step 9: do the pricing math

Multiply credits per lookup by expected lookups a month after caching, and pick the plan that covers it with headroom; then price your own tool so one paying user covers many free ones. Five typical tools, worked through MrKeyword's price list:

Monthly API cost for five tools (after caching)

ToolCall patternPer lookupLookups a monthCredits a monthCheapest fit
Domain authority checkerOne authority call per domain1 credit per domain3,0003,000API Starter at $29 a month
Backlink checkerReferring domains + backlinks per domain4 credits2,0008,000API Starter at $29 a month
All-in-one domain reportOne overview call per domain3 credits5,00015,000API Starter at $29 a month
Keyword research toolOne ideas call + difficulty for 50 ideas7 credits1,50010,500API Starter at $29 a month
Bulk keyword graderDifficulty + intent for lists of 500100 credits per list40040,000API Growth at $99 a month
Lookups are unique (cache misses), not page views. A busy free tool with a good cache often sees five to ten page views per paid lookup.

Two pricing patterns work well for tools built this way. A free tier with a daily lookup cap per visitor (enforced by your server, by IP or account), with a paid plan for bulk lists and exports, keeps your bill proportional to revenue. Or charge per report, and let the per-report price carry the API cost several times over. Either way, track creditsCharged per user from day one so you know what each customer costs you.

Step 10: launch checklist

  1. Key safety

    Production key in server environment only, a separate development key, and a plan for revoking and rotating.

  2. Your own limits

    Rate-limit your endpoint per visitor so a bot cannot spend your monthly credits in an hour.

  3. Cache and alerts

    Cache hit rate logged, a credits-remaining alert, and a fallback message for 402 and 429.

  4. Honest copy

    Labels, dates and a short note on what the data is and is not, on the results page itself.

  5. Measure demand

    Log which inputs people try. The domains and keywords they ask for tell you what to build next.

Start building with 500 free creditsCreate a workspace, mint an mkd_ key under Data API and run the requests above. No card on the Developer plan.

See the Data API

For the endpoint detail of each tool type, see the keyword API, the backlink API and the domain authority API. If you are building an AI assistant rather than a web tool, SEO data for AI agents and the MCP server are the better starting points.

Questions and answers

Build an SEO tool questions

Can I build an SEO tool without a crawler?

Yes. An SEO data API supplies the crawled and computed data, such as authority, backlinks and keyword metrics, so your tool only needs a small backend that calls the API, caches answers and shows them.

Which SEO API is best for building a tool?

It depends on the data you need and your budget. Our comparison of seven SEO APIs sets out data, prices and limits; MrKeyword's Data API has a free plan and a single credit price list.

How do I keep my API key secret?

Call the API only from your server, keep the key in an environment variable, and have your front end call your own endpoint. Never put the key in browser JavaScript.

How much does it cost to run an SEO tool on an API?

It depends on unique lookups after caching. On MrKeyword, 3,000 domain authority lookups a month is 3,000 credits, which fits API Starter at $29 a month; the free Developer plan has 500 credits a month.

What should my tool do when the API rate-limits it?

On a 429, wait the number of seconds in the Retry-After header and retry once, and show your visitor a short try-again message. Batch requests so you make fewer calls.

Can I resell data from MrKeyword's API in my own tool?

Yes. Building a public tool on the Data API is what it is for. Call it from your server and keep the labels; contact MrKeyword for large volumes or a data feed.

About this article

Written by Raman Makkar, who builds an SEO workspace on first-party Search Console and Bing data. Outside facts link to their original source below. We update this page when the product or the sources change.

Sources

  1. MrKeyword Data API — endpoints, credit costs, plans and rate limits
  2. MrKeyword OpenAPI 3.1 spec — every endpoint, parameter and response shape
  3. Spam policies for Google web search — Google Search Central, on scraping results without permission
  4. Node.js: fetch — the built-in fetch used in the JavaScript example
  5. Requests: HTTP for Humans — the Python library used in the batching example
  6. RFC 6585, section 4: 429 Too Many Requests — the status code and the Retry-After header
Keep reading

More on MCP servers and APIs, plus the feature and free tool for the same job. All MCP servers and APIs guides →

Ship the tool this week.

Create a free MrKeyword workspace, mint an mkd_ key and build on 500 free credits a month. Free plan for one website, no card; paid plans from $10 a month.