Skip to content

New AI assistant answers: ChatGPT, Gemini, Copilot and AI Mode by API

SerpKite
Get API key

TypeScript · npm install serpkite

Node.js / TypeScript + SerpKite

The official SerpKite TypeScript SDK: zero dependencies, fully typed responses, automatic retries on 429 and 5xx with Retry-After, and every vertical. Runs on Node 18+, Bun, Deno and edge runtimes.

Overview

What Node.js / TypeScript is, and where SerpKite fits

npm install serpkite gives you a typed SerpKite client built on fetch, so it runs on Node 18+, Bun, Deno and edge runtimes with no dependencies.

Keep your key on the server. CORS is enabled for the API, but a key in browser code can be copied by anyone.

Setup

Set it up in 3 steps

  1. 1

    Get an API key

    Sign up (no card), create a key in the dashboard and export it as SERPKITE_API_KEY. New accounts get 2,500 free credits, then 1,000 every month.

    export SERPKITE_API_KEY=skt_live_…
  2. 2

    Install the SDK

    Works with npm, pnpm, yarn and bun.

    npm install serpkite
  3. 3

    Search

    await sk.search({ q }) returns typed results; res.meta.credits_used is what the call cost.

Code

Example

TypeScript
import { SerpKite, SerpKiteError } from "serpkite";

// Reads SERPKITE_API_KEY; or new SerpKite({ apiKey, baseUrl, timeoutMs, maxRetries })
const sk = new SerpKite();

try {
  const res = await sk.search({ q: "best espresso machine 2026", country: "us", language: "en" });
  for (const r of res.results.slice(0, 5)) console.log(r.position, r.domain, r.title);
  console.log(`used ${res.meta.credits_used} credits`);
} catch (err) {
  if (err instanceof SerpKiteError) console.error(err.status, err.code, err.message, err.requestId);
  else throw err;
}

// Markdown for an LLM prompt (returns a string)
const md = await sk.search({ q: "best espresso machine 2026", format: "markdown" });

// Other verticals
const news = await sk.news({ q: "espresso machine recall", time: "week" });
const places = await sk.maps({ q: "coffee roasters", location: "Berlin, Germany" });

Balance and limits

Check your balance before a big job

sk.account() (GET /v1/account) is free and returns your balance, rate limit, plan and this month's usage. Use it to fail fast before a large batch.

TypeScript
const account = await sk.account();
console.log(account);

const { batches } = await sk.batches.create({
  endpoint: "search",
  requests: [{ q: "crm for startups" }, { q: "crm pricing" }],
});
const done = await sk.batches.wait(batches[0].id); // polls until done or failed
console.log(done.status, done.credits_used);

AI assistants

Ask ChatGPT, Gemini and other AI assistants

sk.chatgpt, sk.gemini, sk.copilot, sk.aiMode and sk.braveAi ask an AI assistant as a logged-out visitor and return the answer with the sources it cited. track adds mentions: whether the answer names each brand or domain and whether a cited source is on it. See AI assistants.

ChatGPT 4, Gemini 3, Copilot Search 3, Google AI Mode 2 and Brave AI 2 credits per answer; failed, refused and empty answers are free. Brave answers in 1–10 s, ChatGPT in 10–30 s and Gemini in 5–30 s, so allow at least 120 seconds per call.

TypeScript
import { SerpKite } from "serpkite";

const sk = new SerpKite();
const res = await sk.chatgpt({
  prompt: "What are the best CRMs for a 10-person startup?",
  track: ["hubspot.com", "Pipedrive"],
});
console.log(res.markdown); // citations as [n](link), matching res.sources[].position
for (const m of res.mentions ?? []) console.log(m.term, m.mentioned, m.cited);

FAQ

Node.js / TypeScript and SerpKite: common questions

Start building

Give your Node.js / TypeScript project Google search

2,500 free credits, then 1,000 every month. No credit card.