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.
Next.js Integration
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
Fetch a domain's authority score at build time or on revalidation. Render it server-side, no client JS required.
Create a /api/seo route that calls RankParse on the server. Keeps your API key off the client. Add your own rate limiting.
Build a comparison page that regenerates daily. Call RankParse once per revalidation period, not per visitor.
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
// 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) ?? [],
});
}Your stack
Start free
100 free credits. No credit card. 5-minute integration.