Next.js Integration

Backlink data in Next.js. Server-side. Cached.

Call RankParse from Server Components, Route Handlers, or edge middleware. Your API key stays on the server. Cache responses with Next.js fetch to minimize credit usage.

Patterns

Server Component — static authority badge

Fetch a domain's authority score at build time or on revalidation. Render it server-side — no client JS required.

Route Handler — proxied SEO API

Create a /api/seo route that calls RankParse on the server. Keeps your API key off the client. Add your own rate limiting.

ISR — cached competitor comparisons

Build a comparison page that regenerates daily. Call RankParse once per revalidation period, not per visitor.

Middleware — block low-authority domains

Check domain authority in edge middleware for content gating or spam filtering. Under 200ms p95.

Setup

Add your API key to .env.local:

RANKPARSE_API_KEY=rp_your_key_here

Never expose the key client-side. Always call RankParse from a Server Component or Route Handler.

Example: Route Handler + Server Component

// app/api/domain-info/route.ts
// Server-side Route Handler — API key stays on the server

export async function GET(request: Request) {
  const { searchParams } = new URL(request.url);
  const domain = searchParams.get("domain");

  if (!domain) {
    return Response.json({ error: "domain required" }, { status: 400 });
  }

  const [authority, tech] = await Promise.all([
    fetch(`https://api.rankparse.com/v1/domain-authority?domain=${domain}`, {
      headers: { "X-API-Key": process.env.RANKPARSE_API_KEY! },
      next: { revalidate: 3600 }, // cache for 1 hour
    }).then((r) => r.json()),

    fetch(`https://api.rankparse.com/v1/tech-stack?domain=${domain}`, {
      headers: { "X-API-Key": process.env.RANKPARSE_API_KEY! },
      next: { revalidate: 3600 },
    }).then((r) => r.json()),
  ]);

  return Response.json({
    domain,
    authority_score: authority.data.authority_score,
    tech_stack: tech.data.technologies?.map((t: { name: string }) => t.name) ?? [],
  });
}

Backlink data in your Next.js app.

100 free credits. No credit card. 5-minute integration.

Get API key — free