Skip to main content
RankRaft AI publishes two official clients for the REST API. Both are open source, MIT licensed, and built from the same OpenAPI specification the API serves, so they cover every endpoint.

JavaScript / TypeScript

npm install rankraft-js — Node 20+, Cloudflare Workers, Deno and Bun. Zero dependencies.

Python

pip install rankraft-py — Python 3.10+. Optional .to_pandas().

Why use an SDK

You can call the API with plain fetch or requests, but the SDKs handle the parts that are easy to get wrong:
  • Pagination — one call gives you the first page; iterate to get every row. The client re-sends the exact query with each cursor, so you never hit invalid_cursor.
  • Retries — a 429 is retried after exactly the Retry-After time, and only safe operations are retried on other errors.
  • Typed errors — one error class per API error code, each carrying the request_id for support.
  • Filters — a small builder for the filter tree that sends values in the format the API expects.
  • Same numbers as the dashboard — the API scores with the same code as your dashboard, and the SDKs pass results through unchanged.

Before you start

1

Enterprise plan

The REST API, and so the SDKs, are part of the Enterprise plan.
2

Create an API key

An owner creates one under Settings → API & AI assistants. It starts with rr_api_ and is shown once. See API keys.
3

Set it as an environment variable

Both SDKs read RANKRAFT_API_KEY automatically.
Use the SDKs on a server only — route handlers, background jobs, Workers, notebooks. A key reads every site in your organization, and the API deliberately sends no CORS headers. The JavaScript client refuses to start in a browser.

SDK, MCP server or skill?

Packages