# Find AI-cited sources with JavaScript

Send a query to the Getspotted API from JavaScript 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

```javascript
const res = await fetch("https://getspotted.ai/api/v1/search", {
  method: "POST",
  headers: {
    authorization: "Bearer gsp_live_…",
    "content-type": "application/json",
  },
  body: JSON.stringify({ query: "best CRM for B2B SaaS", country: "US" }),
});
const { data } = await res.json();
console.log(data.sources); // cited sources, scored, per engine
```

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

[API referenceEvery endpoint and field.](/content/docs/api-reference/index.html) [MCP serverCall it from an AI agent instead.](/content/mcp/index.html)

## Other languages

[cURLQuickstart](/content/docs/quickstart/curl/index.html) [Next.jsQuickstart](/content/docs/quickstart/nextjs/index.html) [PythonQuickstart](/content/docs/quickstart/python/index.html) [GoQuickstart](/content/docs/quickstart/go/index.html)
