Node.js SDK
Official TypeScript SDK for the RankParse API. Zero dependencies, dual ESM/CJS, typed responses.
Installation
npm install rankparseRequires Node.js 18+. No runtime dependencies — uses native fetch.
Quick start
import { RankParse } from 'rankparse';
const client = new RankParse({ apiKey: process.env.RANKPARSE_API_KEY! });
const result = await client.domainAuthority('github.com');
console.log(result.data.score); // 94
console.log(result.credits_remaining); // 9995CommonJS
const { RankParse } = require('rankparse');
const client = new RankParse({ apiKey: process.env.RANKPARSE_API_KEY });Configuration
const client = new RankParse({
apiKey: 'rp_...',
baseUrl: 'https://api.rankparse.com/v1', // optional override
timeout: 30_000, // ms, default 30s
});Error handling
import { RankParse, AuthError, InsufficientCreditsError, RateLimitError } from 'rankparse';
try {
const result = await client.backlinks('example.com');
} catch (err) {
if (err instanceof AuthError) {
// Invalid API key
} else if (err instanceof InsufficientCreditsError) {
// Top up at rankparse.com/dashboard
} else if (err instanceof RateLimitError) {
// Back off and retry
}
}All methods
Link graph
| Method | Endpoint | Credits |
|---|---|---|
backlinks(domain, opts?) | GET /backlinks | 2 |
referringDomains(domain, opts?) | GET /referring-domains | 2 |
outboundLinks(domain, opts?) | GET /outbound-links | 2 |
anchorText(domain, opts?) | GET /anchor-text | 2 |
linkIntersect(domainA, domainB, opts?) | GET /link-intersect | 5 |
linkVelocity(domain) | GET /link-velocity | 0 (v2) |
newLinks(domain) | GET /new-links | 0 (v2) |
lostLinks(domain) | GET /lost-links | 0 (v2) |
Domain intelligence
| Method | Endpoint | Credits |
|---|---|---|
domainAuthority(domain) | GET /domain-authority | 1 |
domainRank(domain) | GET /domain-rank | 2 |
domainOverlap(domains[], opts?) | GET /domain-overlap | 5 |
similarDomains(domain, opts?) | GET /similar-domains | 5 |
competitorGap(domain, vs, opts?) | GET /competitor-gap | 5 |
linkAudit(domain) | GET /link-audit | 8 |
siteExplorer(domain, opts?) | GET /site-explorer | 10 |
Page & site
| Method | Endpoint | Credits |
|---|---|---|
pageSeo(url) | GET /page-seo | 3 |
pagePerformance(url, opts?) | GET /page-performance | 3 |
techStack(url) | GET /tech-stack | 2 |
siteHealth(domain) | GET /site-health | 2 |
sitemap(domain) | GET /sitemap | 2 |
crawlHistory(domain, opts?) | GET /crawl-history | 2 |
topPages(domain, opts?) | GET /top-pages | 2 |
schemaMarkup(url) | GET /schema-markup | 0 (v2) |
internalLinks(url, opts?) | GET /internal-links | 0 (v2) |
Batch & dashboard
| Method | Description |
|---|---|
batch(requests[]) | Run up to 50 requests in one call |
me() | Current user profile + credit balance |
credits() | Credit balance |
keys() | List API keys |
createKey(name?) | Create a new API key |
revokeKey(keyId) | Revoke an API key |
usage(opts?) | Paginated usage logs |
Pagination
All list endpoints accept limit (default 100, max 1000) and offset:
const page1 = await client.backlinks('example.com', { limit: 100, offset: 0 });
const page2 = await client.backlinks('example.com', { limit: 100, offset: 100 });Batch requests
const results = await client.batch([
{ endpoint: 'domain-authority', domain: 'stripe.com' },
{ endpoint: 'domain-authority', domain: 'github.com' },
{ endpoint: 'backlinks', domain: 'vercel.com', limit: 10 },
]);Source & issues
GitHub: abhibavishi/rankparse-node