Skip to content

Docs

Quickstart: your first RankHound API request

Mint a key, confirm it, make a real request. Five minutes end to end, and nothing to install.

Start 7-day free trialFull API reference

Card required, nothing charged for 7 days

Before you start

You need a RankHound account with at least one brand set up, and the Owner or Admin role, because those are the only roles that may mint a key.

The API reads what RankHound has already done and what has already been collected. It triggers neither, so a brand that finished onboarding an hour ago may not have a week of rankings yet, or enough AI answers to quote a rate from. See how to read our numbers.

Four steps

  1. 1

    Mint a key

    Go to API keys in the app and create one. It starts rh_live_ and is shown once. Copy it somewhere safe before you close the dialog.

  2. 2

    Put it in the environment

    Never in source control, never in front-end code. It reads every brand the key covers.

  3. 3

    Confirm it with /me

    One request that proves the key works and tells you the rules in force.

  4. 4

    Ask a real question

    This week's rankings for your target keywords, the agent's articles, or per-engine AI visibility.

Step 1 and 2: the key

shell
export RANKHOUND_API_KEY=rh_live_...

Keys belong to the organisation, not to you. They survive the person who made them leaving, and a request is not re-checked against that person's role — demoting an admin must not take production down at 3am. Revoke a key when someone leaves; deleting the user does not.

Step 3: confirm the key with /me

curl
curl -H "X-API-Key: $RANKHOUND_API_KEY" \
  https://app.rankhound.ai/api/v1/me

A 200 means the key is good. The response carries your plan, whether the key is pinned to a single brand, your current rate-limit position, and a reporting_rules block with the live thresholds. Read those rather than hardcoding 5: if we change the floor, your client should follow without a release.

Anything else means something specific. The full list is on errors and rate limits.

Step 4: your first real request

Start with this week's rankings for your target keywords. If your organisation has one brand, this is all it takes. /agent answers what RankHound did this week, and /visibility reads AI visibility tracking the same way.

curl
curl -H "X-API-Key: $RANKHOUND_API_KEY" \
  "https://app.rankhound.ai/api/v1/keywords"

If you have more than one brand you will get 400 brand_required. That is the API refusing to guess. Call /brands, take the id, pass it on every request after that. Full detail on working with multiple brands.

curl
curl -H "X-API-Key: $RANKHOUND_API_KEY" \
  "https://app.rankhound.ai/api/v1/brands"

curl -H "X-API-Key: $RANKHOUND_API_KEY" \
  "https://app.rankhound.ai/api/v1/keywords?brand=<id>"

Before you render any of it

Three rules for the SEO numbers

Every SEO tool and endpoint carries these. Each one is a way to report a ranking or an article wrongly while looking right.

  1. 1

    A null number is never zero.

    It means not measured yet, or, for a rank inside a completed check, not in the top 100. An article's results stay null until it is published and Google reports the page; a keyword's rank.latest is null until its first check. Never render either as 0 clicks or position 0.

  2. 2

    Ranks are checked weekly, not live.

    Quote a position as of the week it was checked (rank.latest.week_start). A rank check runs once a week through the top 100, and its results arrive over a few hours rather than instantly.

  3. 3

    These tools only read.

    Approving, rejecting or publishing an article happens in RankHound, so send the customer there for it. There is no endpoint, flag or tool that publishes.

Three rules you must not break

These are not style preferences. Breaking them produces a confidently wrong report in your customer's name.

  1. 1

    A null rate means "not enough answers yet". It is NOT zero.

    Rates come back as {present, responses, rate, min_sample}. When rate is null, the sample is below the floor. Say “3 of 4 answers, too few to quote a percentage”. Never render it as 0%, and never let it into an average. Reporting “0% visibility” for a brand that was named in 3 of 4 answers is the single most damaging thing you can do with this data.

  2. 2

    Never average the engines.

    There is no single visibility score and you must not compute one. ChatGPT, Perplexity and Google AI Overviews are different surfaces that disagree, so a mean describes nothing real. Report per engine. If the user insists on one number, give them the pooled counts (present and responses summed) and say plainly what you did.

  3. 3

    An empty alerts list does NOT mean nothing changed.

    A finding is raised only when both comparison windows carry enough answers AND the move is larger than its own margin of error. On a small plan that excludes most real movement. Say “no change large enough to distinguish from noise at this sample size”. GET /me shows the thresholds in force.

If you would rather not write HTTP

Inside an AI assistant, the hosted MCP server gives it the same reads as tools, with no install and no key handling in the conversation. The CLI will do the same from a terminal or a CI job once it is on npm.

Not installable yet. @rankhound/cli is written and tested but is not published on npm, so there is no install command to give you. The hosted MCP server needs no install and works now, and the REST API takes any HTTP client.

Quickstart questions

Answered from the implementation.

Where do I get a RankHound API key?
In the app, under API keys. Owner and Admin roles only. The key is displayed once and stored as a SHA-256 hash, so we cannot show it to you again or recover it. If you lose it, revoke it and mint another.
Should I call /me first?
Yes, every time you build something new. It confirms the key works, tells you the plan, says whether the key is pinned to one brand, and returns the live reporting thresholds in a reporting_rules block so your client can state them accurately instead of hardcoding them.
Why did my request return 400 brand_required?
Your organisation has more than one brand, so the API refuses to guess which one you meant. Call GET /brands, take the id you want, and pass it as ?brand=<id>. This is deliberate: a silent default would file one client's numbers under another's with nothing in the response saying so.
Can I use the API key in a browser?
No. It is an organisation credential with read access to every brand it covers, so it belongs on a server or in a CI secret. Putting it in front-end code hands your competitors' visibility data to anyone who opens devtools.
Do I need an SDK?
No. It is plain HTTP with one header, so curl, fetch or whatever HTTP client you already have is enough. The hosted MCP server exists for AI assistants, not because the API is hard to call.

7-day trial

You need data before you can read it

RankHound is SEO automation software that finds the searches your site can win and writes for them, and the API returns what it has already done. Start a trial and the first week's research, rankings and articles are there to read.

Card required, nothing charged for 7 days.

On every plan

  • Keyword research and competitor analysis, every week.
  • Articles written against the pages that rank, waiting for your approval.
  • Google rankings checked weekly, beside your Search Console data.
  • Publishing to WordPress or any site by webhook, once you approve.
  • AI visibility tracking across six AI assistants.