TypeScript SDK
A zero-dependency, single-file TypeScript SDK for the Ranked AI REST API v1. Works anywherefetch is available — Node 18+, Deno, Bun, and modern browsers.
Installation
The SDK is a single file with no external dependencies. Copy it directly into your project:Quick start
Configuration
Error handling
Every failed request throws aRankedAIError with the HTTP status, error code, and request ID:
Pagination
All list endpoints return paginated responses. Themeta.pagination object tells you whether more data is available:
Manual pagination
Auto-pagination iterator
The SDK provides a built-inpaginate helper that yields every item across all pages:
Endpoints
Projects
Keywords (Rankings)
AI Prompts
Audits
Backlinks
Content
Reports
Webhooks
Webhook signature verification
When your server receives a webhook, verify the signature to confirm it was sent by Ranked AI. The signature is in theX-Webhook-Signature header as sha256=<hex>.
Node.js / Bun
Edge runtimes (Cloudflare Workers, Vercel Edge)
Use the async variant which uses the Web Crypto API:Webhook event types
| Event | Description |
|---|---|
content.created | A new content item was added to the calendar |
content.updated | A content item was modified |
content.scheduled | A content item was scheduled |
content.status_changed | A content item’s status changed |
audit.completed | A site audit finished crawling |
audit.started | A site audit started |
keywords.updated | Keyword ranking positions were refreshed |
prompts.updated | AI prompt visibility data was refreshed |