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:
POSTthe tool endpoint → credits are deducted and you get202 Acceptedwith ajobId.- Poll
GET /jobs/{jobId}every few seconds — status moves pending → processing → completed (or failed). - 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:
| Endpoint | Credits per call |
|---|---|
POST /audits | 50 |
POST /core-web-vitals | 25 |
POST /keyword-research | 50 |
POST /brand-visibility | 100 |
POST /faq-generator | 20 |
POST /llms-txt | 20 |
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" }
| Code | HTTP | Meaning |
|---|---|---|
UNAUTHORIZED | 401 | Missing or invalid x-api-key / x-api-secret headers. |
FORBIDDEN_SCOPE | 403 | The key is valid but not allowed for this resource (e.g. a domain not on your account). |
VALIDATION_ERROR | 400 | A required parameter is missing or malformed. |
INSUFFICIENT_CREDITS | 402 | Your balance is below the endpoint cost. details.required and details.available say by how much. |
RATE_LIMITED | 429 | Per-key rate limit exceeded. Respect the Retry-After header. |
NOT_FOUND | 404 | The resource (e.g. jobId) does not exist or is not yours. |
INTERNAL_ERROR | 500 | Something failed on our side. Retry, and contact support with the requestId if it persists. |
/api/v1/creditsGet credit balance
Returns your current credit balance, total credits used, and the 20 most recent transactions.
curl "https://www.airanklab.com/api/v1/credits" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-api-secret: YOUR_API_SECRET"{
"success": true,
"data": {
"balance": 1250,
"totalUsed": 750,
"recentTransactions": [
{ "type": "usage", "amount": -50, "description": "Used 50 credits for api_audits.create" }
]
},
"requestId": "a1b2c3d4e5f6a7b8"
}/api/v1/tracking/statsAI 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.
| Name | Type | Required | Description |
|---|---|---|---|
domain | string | Yes | A domain registered on your account, e.g. example.com |
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"{
"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": "..."
}/api/v1/citationsAI engine citations
Citations of your domain by AI engines (ChatGPT, Claude, Gemini, Perplexity) with a per-bot breakdown. Responses are cached for ~2 minutes.
| Name | Type | Required | Description |
|---|---|---|---|
domain | string | Yes | A domain registered on your account |
days | integer | No | Look-back window in days (default 30, max 90) |
limit | integer | No | Max citations returned (default 50, max 200) |
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"{
"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": "..."
}/api/v1/jobs/{jobId}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.
| Name | Type | Required | Description |
|---|---|---|---|
jobId | string (uuid) | Yes | The jobId returned by a tool endpoint |
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"{
"success": true,
"data": {
"jobId": "1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed",
"tool": "audits",
"status": "completed",
"result": { "...": "tool-specific result object" },
"creditsCharged": 50,
"creditsRefunded": false
},
"requestId": "..."
}/api/v1/auditsRun 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.
| Name | Type | Required | Description |
|---|---|---|---|
url | string (uri) | Yes | The public URL to audit |
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"}'{
"success": true,
"data": {
"jobId": "…",
"tool": "audits",
"status": "pending",
"creditsCharged": 50,
"pollUrl": "/api/v1/jobs/…"
},
"requestId": "..."
}/api/v1/core-web-vitalsCore Web Vitals scan
Google PageSpeed Insights scan for a URL — LCP, INP, CLS and the overall performance score, for mobile or desktop.
| Name | Type | Required | Description |
|---|---|---|---|
url | string (uri) | Yes | The public URL to scan |
strategy | string | No | "mobile" (default) or "desktop" |
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"}'{ "success": true, "data": { "jobId": "…", "status": "pending", "pollUrl": "/api/v1/jobs/…" } }/api/v1/keyword-researchKeyword 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.
| Name | Type | Required | Description |
|---|---|---|---|
url | string (uri) | No | Website to research keywords from |
keywords | string[] | No | Up to 10 seed keywords |
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"]}'{ "success": true, "data": { "jobId": "…", "status": "pending", "pollUrl": "/api/v1/jobs/…" } }/api/v1/brand-visibilityAI 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.
| Name | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | The question to ask the AI engine |
domain | string | Yes | Your brand domain to look for in the answer |
engine | string | No | "ChatGPT" (default), "Claude", "Gemini", or "Perplexity" |
competitors | string[] | No | Up to 5 competitor domains to also track |
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"}'{ "success": true, "data": { "jobId": "…", "status": "pending", "pollUrl": "/api/v1/jobs/…" } }/api/v1/faq-generatorGenerate FAQs
Generates 8-10 FAQ question/answer pairs from a page's content, plus a ready-to-embed FAQPage JSON-LD schema block.
| Name | Type | Required | Description |
|---|---|---|---|
url | string (uri) | Yes | The page to generate FAQs from |
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"}'{ "success": true, "data": { "jobId": "…", "status": "pending", "pollUrl": "/api/v1/jobs/…" } }/api/v1/llms-txtGenerate 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.
| Name | Type | Required | Description |
|---|---|---|---|
url | string (uri) | Yes | The site homepage (or key page) to generate from |
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"}'{ "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