Quickstart

Find AI-cited sources with Next.js

Send a query to the Getspotted API from Next.js and get back the sources AI engines (ChatGPT, Claude, Perplexity, Gemini) and Google cite for it, per country. Authenticate with Authorization: Bearer gsp_live_…

Call the API

typescript
// app/api/sources/route.ts (server-side — keep your key secret)
export async function GET() {
  const res = await fetch("https://getspotted.ai/api/v1/search", {
    method: "POST",
    headers: {
      authorization: `Bearer ${process.env.GETSPOTTED_API_KEY}`,
      "content-type": "application/json",
    },
    body: JSON.stringify({ query: "best CRM for B2B SaaS", country: "US" }),
  });
  return Response.json(await res.json());
}

Each search costs 10 credits. The response shape is { success, data: { sources, hotspots, enginesQueried } } — every source lists the engines that cited it and its per-engine position.

Next steps

Other languages