Skip to main content
rankraft-js on npm

Install

Requires Node 20+, or any runtime with fetch — Cloudflare Workers, Deno and Bun included. Zero runtime dependencies. ESM and CommonJS. Fully typed.

Quick start

Parameter and field names are the API’s own (site_id, start_date, group_by), never camelCase, so the API reference applies as written.

Methods

Pagination

Every report method is awaitable for the first page and async-iterable for every row.
The client re-sends your exact query with each cursor, so pages always line up. To change the filter, dates or grouping, start a new call.

Filters

Pass a plain object, or build one with f:
Operators: is, not_is, in, not_in, contains, not_contains, all case-insensitive. Numbers and booleans are converted to strings for you (f.is("verified", true)). Which fields each report accepts: Filtering.

Errors

Every error carries status, code, details and requestId — include the request id when you contact support.

Retries

On by default, with two retries after the first attempt. A 429 is retried after exactly the Retry-After time. Other errors are retried only for operations that are safe to repeat. maxRetryWaitMs caps the total time one call may spend waiting.

Managing prompts

Needs a key with Read and manage prompts access. Prompts can be created, re-categorised and switched on or off, but never deleted, so their history is always kept.

Options

Package

rankraft-js on npm · MIT licence