Developer API v1

API Reference

Run AI Rank Lab's tools programmatically — URL audits, Core Web Vitals, keyword research, AI brand-visibility checks, FAQ and llms.txt generation — and read your AI bot-visit and citation data. Authenticated with your API key and secret; billed in the same credits as the dashboard.

Introduction

The base URL for all endpoints is https://www.airanklab.com/api/v1. All requests and responses are JSON. Every response — success or error — includes a requestId you can reference when contacting support.

Endpoints come in two flavors: data endpoints (free, synchronous reads of data your account already collects) and tool endpoints (credit-billed jobs that run asynchronously — see Async jobs).

Authentication

Every request must carry two headers: x-api-key and x-api-secret. Get both from Dashboard → API & Integrations. You can rotate the pair at any time; rotation invalidates the old pair within seconds.

Treat the secret like a password: keep it in environment variables or a secret manager, never in client-side code or a public repository. Requests are only accepted over HTTPS.

Quickstart

From zero to your first audit result in four steps:

# 1. Get your key + secret: Dashboard → Settings → API & Integrations
# 2. Check your balance
curl "https://www.airanklab.com/api/v1/credits" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-api-secret: YOUR_API_SECRET"

# 3. Start an audit (returns 202 + jobId)
curl -X POST "https://www.airanklab.com/api/v1/audits" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-api-secret: YOUR_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com"}'

# 4. Poll for the result
curl "https://www.airanklab.com/api/v1/jobs/JOB_ID" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-api-secret: YOUR_API_SECRET"

Prefer Postman? Import the ready-made collection from /api/v1/postman.json (in Postman: Import → Link) — it includes every endpoint, saves the last jobId automatically, and only needs your key and secret set as collection variables. Logged-in users can also try every endpoint live in the API Playground.

Async jobs

Tool endpoints do real work — crawling pages, calling AI engines — which can take seconds to minutes. Instead of holding your connection open, they follow a job pattern:

  1. POST the tool endpoint → credits are deducted and you get 202 Accepted with a jobId.
  2. Poll GET /jobs/{jobId} every few seconds — status moves pending → processing → completed (or failed).
  3. On completed, the full result is in data.result. Jobs are retained for 7 days.

If a job fails — including interruption by a server restart — the charged credits are refunded automatically. The refund appears in your transactions in GET /credits.

Credits & billing

API calls spend the same credit balance as the dashboard — a tool costs the same everywhere. Data endpoints are free. Costs per tool call:

EndpointCredits per call
POST /audits50
POST /core-web-vitals25
POST /keyword-research50
POST /brand-visibility100
POST /faq-generator20
POST /llms-txt20

Rate limits

Each API key is limited to 60 requests per minute by default. Standard RateLimit-* headers report your remaining allowance on every response; a 429 includes Retry-After. Need a higher limit? Contact us.

Errors

Errors share one envelope: { "success": false, "error": { "code", "message", "details" }, "requestId" }

CodeHTTPMeaning
UNAUTHORIZED401Missing or invalid x-api-key / x-api-secret headers.
FORBIDDEN_SCOPE403The key is valid but not allowed for this resource (e.g. a domain not on your account).
VALIDATION_ERROR400A required parameter is missing or malformed.
INSUFFICIENT_CREDITS402Your balance is below the endpoint cost. details.required and details.available say by how much.
RATE_LIMITED429Per-key rate limit exceeded. Respect the Retry-After header.
NOT_FOUND404The resource (e.g. jobId) does not exist or is not yours.
INTERNAL_ERROR500Something failed on our side. Retry, and contact support with the requestId if it persists.
GET
/api/v1/credits
Free

Get credit balance

Returns your current credit balance, total credits used, and the 20 most recent transactions.

Request
curl "https://www.airanklab.com/api/v1/credits" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-api-secret: YOUR_API_SECRET"
Response
{
  "success": true,
  "data": {
    "balance": 1250,
    "totalUsed": 750,
    "recentTransactions": [
      { "type": "usage", "amount": -50, "description": "Used 50 credits for api_audits.create" }
    ]
  },
  "requestId": "a1b2c3d4e5f6a7b8"
}
GET
/api/v1/tracking/stats
Free

AI bot visit statistics

Aggregated AI and search bot visit stats for one of your registered domains: totals, AI bot share, top bots, and top pages. The domain must be registered on your account. Responses are cached for ~2 minutes.

Parameters (query)
NameTypeRequiredDescription
domainstringYesA domain registered on your account, e.g. example.com
Request
curl "https://www.airanklab.com/api/v1/tracking/stats?domain=example.com" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-api-secret: YOUR_API_SECRET"
Response
{
  "success": true,
  "data": {
    "domain": "example.com",
    "totalVisits": 4821,
    "uniqueBots": 12,
    "aiBotVisits": 3106,
    "visitsLast30Days": 913,
    "topBots": [{ "name": "GPTBot", "count": 1204, "isAIBot": true }],
    "topPages": [{ "url": "/pricing", "count": 402 }]
  },
  "requestId": "..."
}
GET
/api/v1/citations
Free

AI engine citations

Citations of your domain by AI engines (ChatGPT, Claude, Gemini, Perplexity) with a per-bot breakdown. Responses are cached for ~2 minutes.

Parameters (query)
NameTypeRequiredDescription
domainstringYesA domain registered on your account
daysintegerNoLook-back window in days (default 30, max 90)
limitintegerNoMax citations returned (default 50, max 200)
Request
curl "https://www.airanklab.com/api/v1/citations?domain=example.com&days=30" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-api-secret: YOUR_API_SECRET"
Response
{
  "success": true,
  "data": {
    "domain": "example.com",
    "periodDays": 30,
    "total": 42,
    "byBot": [{ "bot": "ChatGPT", "count": 18 }],
    "citations": [
      { "bot": "ChatGPT", "path": "/blog/what-is-aeo", "timestamp": "2026-07-09T14:02:11Z" }
    ]
  },
  "requestId": "..."
}
GET
/api/v1/jobs/{jobId}
Free

Poll an async job

Returns the status of an async tool job and — once status is "completed" — its result. Jobs and results are retained for 7 days. If a job fails, credits are refunded automatically and the refund is visible in /credits.

Parameters (path)
NameTypeRequiredDescription
jobIdstring (uuid)YesThe jobId returned by a tool endpoint
Request
curl "https://www.airanklab.com/api/v1/jobs/1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-api-secret: YOUR_API_SECRET"
Response
{
  "success": true,
  "data": {
    "jobId": "1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed",
    "tool": "audits",
    "status": "completed",
    "result": { "...": "tool-specific result object" },
    "creditsCharged": 50,
    "creditsRefunded": false
  },
  "requestId": "..."
}
POST
/api/v1/audits
async · 202 + jobId
50 credits

Run a URL audit

Full technical + AEO audit of a single URL: HTTP and security headers, robots.txt / sitemap / llms.txt, structured data, heading hierarchy, and content quality signals.

Parameters (body)
NameTypeRequiredDescription
urlstring (uri)YesThe public URL to audit
Request
curl -X POST "https://www.airanklab.com/api/v1/audits" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-api-secret: YOUR_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/pricing"}'
Response
{
  "success": true,
  "data": {
    "jobId": "…",
    "tool": "audits",
    "status": "pending",
    "creditsCharged": 50,
    "pollUrl": "/api/v1/jobs/…"
  },
  "requestId": "..."
}
POST
/api/v1/core-web-vitals
async · 202 + jobId
25 credits

Core Web Vitals scan

Google PageSpeed Insights scan for a URL — LCP, INP, CLS and the overall performance score, for mobile or desktop.

Parameters (body)
NameTypeRequiredDescription
urlstring (uri)YesThe public URL to scan
strategystringNo"mobile" (default) or "desktop"
Request
curl -X POST "https://www.airanklab.com/api/v1/core-web-vitals" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-api-secret: YOUR_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","strategy":"mobile"}'
Response
{ "success": true, "data": { "jobId": "…", "status": "pending", "pollUrl": "/api/v1/jobs/…" } }
POST
/api/v1/keyword-research
async · 202 + jobId
50 credits

Keyword research

Keyword research from a website URL (topics are auto-extracted from the site) or from up to 10 seed keywords. Provide either "url" or "keywords" — not both.

Parameters (body)
NameTypeRequiredDescription
urlstring (uri)NoWebsite to research keywords from
keywordsstring[]NoUp to 10 seed keywords
Request
curl -X POST "https://www.airanklab.com/api/v1/keyword-research" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-api-secret: YOUR_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"keywords":["answer engine optimization","ai seo"]}'
Response
{ "success": true, "data": { "jobId": "…", "status": "pending", "pollUrl": "/api/v1/jobs/…" } }
POST
/api/v1/brand-visibility
async · 202 + jobId
100 credits

AI brand visibility check

Asks an AI engine your prompt and analyzes whether — and how — your brand or domain appears in the answer: mention position, sentiment, citations, and competitor mentions.

Parameters (body)
NameTypeRequiredDescription
promptstringYesThe question to ask the AI engine
domainstringYesYour brand domain to look for in the answer
enginestringNo"ChatGPT" (default), "Claude", "Gemini", or "Perplexity"
competitorsstring[]NoUp to 5 competitor domains to also track
Request
curl -X POST "https://www.airanklab.com/api/v1/brand-visibility" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-api-secret: YOUR_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"Best AEO platforms?","domain":"example.com","engine":"ChatGPT"}'
Response
{ "success": true, "data": { "jobId": "…", "status": "pending", "pollUrl": "/api/v1/jobs/…" } }
POST
/api/v1/faq-generator
async · 202 + jobId
20 credits

Generate FAQs

Generates 8-10 FAQ question/answer pairs from a page's content, plus a ready-to-embed FAQPage JSON-LD schema block.

Parameters (body)
NameTypeRequiredDescription
urlstring (uri)YesThe page to generate FAQs from
Request
curl -X POST "https://www.airanklab.com/api/v1/faq-generator" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-api-secret: YOUR_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/features"}'
Response
{ "success": true, "data": { "jobId": "…", "status": "pending", "pollUrl": "/api/v1/jobs/…" } }
POST
/api/v1/llms-txt
async · 202 + jobId
20 credits

Generate llms.txt

Generates an llms.txt markdown file for a website — the emerging standard that helps AI language models understand, navigate, and cite your site.

Parameters (body)
NameTypeRequiredDescription
urlstring (uri)YesThe site homepage (or key page) to generate from
Request
curl -X POST "https://www.airanklab.com/api/v1/llms-txt" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-api-secret: YOUR_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com"}'
Response
{ "success": true, "data": { "jobId": "…", "status": "pending", "pollUrl": "/api/v1/jobs/…" } }

Start building

Generate your API key and secret from the dashboard and make your first call in under a minute.

Get your API key