Skip to content

Quickstart

Sign in to the console, create an API key, and top up your credits. New accounts start at 0 credits and must add funds before submitting queries. Save your key immediately; it is shown only once.

export GEOEVAL_API_KEY="geo_live_..."
curl https://geo-api.geoeval.com/v1/me -H "Authorization: Bearer $GEOEVAL_API_KEY"
# uuidgen prints a new UUID. Send the same value when you retry a submission, so it is charged once
IDEMPOTENCY_KEY=$(uuidgen)
curl -X POST https://geo-api.geoeval.com/v1/queries \
-H "Authorization: Bearer $GEOEVAL_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-d '{"query":"Which robot vacuum is the best choice?","apps":["doubao"]}'

The API responds with 202 and a query_id, then processes the query asynchronously.

curl https://geo-api.geoeval.com/v1/queries/$QUERY_ID -H "Authorization: Bearer $GEOEVAL_API_KEY"

Poll while status is pending. Most tasks finish in roughly a minute, though the first request after an idle period may take a few minutes. When a task reaches done, read its answer from tasks[].result.answer_markdown.

submit-and-wait.ts
// Node 24+ runs this file as it is. Submits a query, waits until it is final and prints the answers.
export {};
const API = "https://geo-api.geoeval.com";
const headers = { Authorization: `Bearer ${process.env.GEOEVAL_API_KEY}` };
interface Task {
app: string;
status: "queued" | "running" | "uploaded" | "parsing" | "done" | "failed" | "unavailable";
error: string | null;
result: { answer_markdown: string } | null;
}
interface Query {
query_id: string;
status: "pending" | "completed" | "timeout" | "failed";
tasks: Task[];
}
const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
async function call(path: string, init: { method?: string; headers?: Record<string, string>; body?: string } = {}): Promise<Query> {
for (;;) {
const response = await fetch(API + path, { ...init, headers: { ...headers, ...init.headers } });
const data = (await response.json().catch(() => ({}))) as { code?: string; message?: string };
// 429 rate_limited and 503 are temporary: wait and repeat the same request
if (response.status === 503 || (response.status === 429 && data.code === "rate_limited")) {
await sleep(Number(response.headers.get("Retry-After") ?? 5) * 1000);
continue;
}
if (!response.ok) throw new Error(`${response.status} ${data.code}: ${data.message}`);
return data as Query;
}
}
let query = await call("/v1/queries", {
method: "POST",
// The same Idempotency-Key on a retry returns the same query instead of creating a second one
headers: { "Content-Type": "application/json", "Idempotency-Key": crypto.randomUUID() },
body: JSON.stringify({ query: "Which robot vacuum is the best choice?", apps: ["doubao", "kimi"] }),
});
// Poll until the query is final
while (query.status === "pending") {
await sleep(10_000);
query = await call(`/v1/queries/${query.query_id}`);
}
console.log("query", query.status);
for (const task of query.tasks) {
if (task.status === "done") console.log(task.app, task.result?.answer_markdown);
else console.log(task.app, task.status, task.error);
}

You can also test endpoints directly in your browser using the interactive playground on any reference page, such as Submit a query.