LS-Labs GeoCheck Developer API documentation
OpenAPI 3.1 (YAML)Use the API to measure AI search citations from an agent, a backend service or an automated analysis. One request collects answers and their cited sources from four official search engines.
Make your first API call
The LS-Labs GeoCheck REST API processes observations asynchronously. Use the TypeScript SDK, cURL or Python to submit a request and poll for the result.
Verify access in three steps
- Sign in to the API console to check access. Only approved accounts can create API keys.
- Send
POST /v1/measurementswith anIdempotency-Keyand the official URL of the brand you want to check. - After receiving
202 Accepted, follow theRetry-Afterinterval to pollGET /v1/measurements/{id}for the results from all four engines.
# 1. Create an observation (POST /v1/measurements)
curl --fail-with-body --max-time 30 -X POST https://platform.lslabs.tw/v1/measurements \
-H "Authorization: Bearer $GEOCHECK_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"input": { "type": "url", "url": "https://example.com" },
"locale": "zh-TW"
}'
# 2. Poll for the result (GET /v1/measurements/{measurement_id})
curl --fail-with-body --max-time 30 -X GET https://platform.lslabs.tw/v1/measurements/msmt_81a2b3c4 \
-H "Authorization: Bearer $GEOCHECK_API_KEY"
Authentication
Include a bearer token in the HTTP header of every Developer API request.
Authorization: Bearer gck_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
gck_. The console displays the full key only once, when you create it. The backend stores a peppered hash. If you lose your key, revoke it and create a new one.
Error codes and troubleshooting
The API uses standard HTTP status codes. Each error response body includes a specific code and message.
| Status | Error code | Possible cause | What to check |
|---|---|---|---|
400 Bad Request |
invalid_request |
The request is malformed or a required field is missing. | Check the JSON syntax and verify that the URL uses a valid http(s):// domain. |
401 Unauthorized |
auth_required |
The key is missing, invalid or revoked. | Check that the Authorization header contains the correct Bearer gck_... key. |
402 Payment Required |
payment_required |
You have used all observations available in the current window. | Open the Console to check your balance or top up. |
403 Forbidden |
trial_not_started |
Your account’s plan entitlements are not active. | Open the Console to check the activation status for your account. |
404 Not Found |
not_found |
No matching job ID or measurement ID was found. | Check the ID. The result may have expired and been removed. |
409 Conflict |
result_not_ready |
The four engines are still working on the observation. | This is an expected polling response. Read the HTTP Retry-After header and wait the specified number of seconds before retrying. |
410 Gone |
content_deleted |
The client requested deletion of this result. | The content has been permanently deleted. The system keeps a tombstone record. |
429 Too Many Requests |
rate_limited |
The request rate exceeds the limit. | Reduce concurrency and use Retry-After to apply exponential backoff. |
503 Service Unavailable |
service_unavailable |
An upstream search engine is busy or the service is undergoing maintenance. | Retry later. If the error persists, contact technical support. |
Rate limits and quotas
Points are charged based on usage, and each account has a request rate limit. When the platform hits its provider spending limit, it pauses new observations and top-ups.
- Current quota. Open Usage in the console to see your points balance and the number of observations you can run. Paid points do not expire.
- Current rate limit. Each response includes
X-RateLimit-Limit,X-RateLimit-RemainingandX-RateLimit-Reset. Read these three headers for the current limits. - When you exceed the limit, the API returns
429 Too Many RequestswithRetry-Afterin seconds. Wait for the specified interval before retrying. - When an observation is free. The service reserves 8 points when it accepts a request and returns them if any engine fails. The request still counts toward your rate limit.
Pricing and metering
| Item | Availability | Where to check |
|---|---|---|
| Developer API | Subject to service capacity | Sign in to the console |
| Usage and rate limits | Defined by your account | Console and API responses |
| Paid access | Subject to service capacity | Check the console |
Four direct search-engine connections
LS-Labs GeoCheck connects to the search providers through their official APIs. Each observation starts four searches in parallel.
| Search engine | Official model ID | Search mechanism | What the engine contributes |
|---|---|---|---|
| OpenAI | gpt-6-luna | Native Web Search Tool | Broad coverage of general-purpose searches worldwide |
| Google Gemini | gemini-3.5-flash-lite | Google Search Grounding | Google’s current search index and Knowledge Graph |
| Perplexity | sonar | Live Web Search Pipeline | An answer engine used for research, development and business decisions |
| Anthropic Claude | claude-haiku-5-5 | Official Web Search Capability | Enterprise summaries with structured factual citations |
When an observation counts (atomic settlement)
Missing an engine makes side-by-side comparisons unreliable. The backend settles each observation as one unit.
- All four succeed (4/4). The job status becomes
succeededand one observation is deducted from the account. - Any engine fails (fewer than 4/4). The job status becomes
failed. The system releases the reserved allowance and the customer is charged nothing. For troubleshooting, the response still includes the successfulpartial_resultsentries.
Idempotency keys
When you create an observation, you must supply the Idempotency-Key header. We recommend a UUID v4.
After a network timeout or client retry, sending the same Idempotency-Key returns the original job. The service does not schedule or charge for it twice.
Polling and the job lifecycle
Each provider’s live search takes about 6–14 seconds. Use asynchronous polling to retrieve the results.
POST /v1/measurementsreturns202 Acceptedandmeasurement_id.- Every 2–3 seconds the client sends
GET /v1/measurements/{id}. - While the observation is running, the server returns
409 Conflict(result_not_ready) withRetry-After: 2. - Once every engine finishes, the server returns
200 OKwith the four answers and their cited URLs.
Diagnosing website access, WAF rules and crawler blocks
An aggressive WAF, a Cloudflare Turnstile challenge or a site rendered entirely in the browser can prevent ChatGPT Search, Perplexity or Gemini from reading a page. An engine may then report zero citations to the official site or fail to identify the business. We have not published a sample or sampling method for a prevalence estimate. Check the responses your own site serves.
1. How AI search engines fetch pages
OpenAI, Google, Perplexity and Anthropic use identifiable user agents to retrieve HTML during web searches. Services such as Cloudflare Bot Management, Akamai and DataDome commonly check these signals.
- TLS, JA3 and JA4 fingerprints. The protection service checks whether TLS ClientHello matches typical browser patterns.
- Browser environment and headless detection. The checks cover
navigator.webdriver, Canvas and WebGL rendering fingerprints, and the audio context. - JavaScript and CAPTCHA challenges. If a site requires Turnstile for nonresidential IP addresses, an AI crawler may be unable to pass the challenge and read the page.
2. Checks for site owners
| Check | How to verify | What to change |
|---|---|---|
| robots.txt rules | Check whether /robots.txt disallows the official bots. |
Allow OAI-SearchBot, PerplexityBot, Google-Extended, ClaudeBot to access your main public pages. |
| WAF allowlist | Look for the AI providers’ networks in the WAF block log. | Allow the IP ranges published by the official providers or the firewall’s verified-bot identities. |
| Server-side rendering (SSR) | Use curl -sL <URL> to inspect the raw HTML. |
Include key brand and product information in the HTML returned by the server so crawlers can read it before JavaScript runs. |
| HTTP status codes | Check whether crawler requests receive 403 or 503 |
Avoid blanket blocks on data-center IPs that prevent legitimate search engines from accessing your sources. |
3. How LS-Labs GeoCheck protects its own API
LS-Labs GeoCheck uses the following controls to protect the Developer API from abuse.
- CORS restrictions. The platform disallows wildcard (
*) CORS to protect account credentials. - Timing-safe token verification. API keys and administrative tokens are compared in constant time to protect against timing attacks.
- Rate limiting. Multiple limits track IP addresses and tokens to prevent brute-force probing and repeated job submissions.
Data retention and result deletion
Read the LS-Labs Platform Privacy policy for details on data processing. To delete an individual result, follow the steps below.
- Retention and cleanup. The console and terms of service show your retention terms when access is granted. These public docs do not promise a fixed retention period.
- Delete an individual result. An authorized client can call
DELETE /v1/measurements/{id}. A successful request returns204 No Content, and subsequent requests for that result return410 Gone. Account, security and transaction records are separate. Upstream providers handle deletion under their own policies.
TypeScript SDK
The TypeScript client @geocheck/sdk provides types, retries and polling.
The package has not been published to npm. Use the REST and Python examples below.
npm install @geocheck/sdk currently returns 404. This section will be updated after publication.
Python examples
Copy this example to get started. It reads the key from an environment variable, sets a timeout on every request and stops polling when a response falls outside the 2xx range.
import os, time, uuid, requests
BASE = "https://platform.lslabs.tw"
API_KEY = os.environ["GEOCHECK_API_KEY"] # fail fast if unset
HEADERS = {
"Authorization": f"Bearer {API_KEY}",
"Idempotency-Key": str(uuid.uuid4()),
"Content-Type": "application/json"
}
# 1. Create. Always pass a timeout: a stalled socket otherwise hangs forever.
created = requests.post(
f"{BASE}/v1/measurements",
headers=HEADERS,
json={"input": {"type": "url", "url": "https://example.com"}, "locale": "zh-TW"},
timeout=30
)
if created.status_code != 202:
raise SystemExit(f"create failed: {created.status_code} {created.text}")
measurement_id = created.json()["measurement_id"]
# 2. Poll with a deadline. 409 means still running; 429 must honour Retry-After.
deadline = time.monotonic() + 600
while time.monotonic() < deadline:
res = requests.get(f"{BASE}/v1/measurements/{measurement_id}", headers=HEADERS, timeout=30)
if res.status_code == 200:
print(res.json()["engines"])
break
if res.status_code in (409, 429):
time.sleep(float(res.headers.get("Retry-After", 5)))
continue
raise SystemExit(f"poll failed: {res.status_code} {res.text}")
else:
raise SystemExit("timed out before the measurement reached a terminal state")
Integrating coding agents and MCP
You can wrap the REST API in a Model Context Protocol (MCP) tool for Claude Code, Cursor, OpenCode or Codex. The official MCP server has not been published. The configuration below shows the intended setup once the package is available. In the meantime, call the REST endpoints directly or write your own wrapper.
{
"mcpServers": {
"geocheck": {
"command": "npx",
"args": ["-y", "@geocheck/mcp-server"],
"env": {
"GEOCHECK_API_KEY": "gck_xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}
}
}
REST API reference
1. Create an observation job
POST /v1/measurements
Accepts a target URL or question and starts an asynchronous observation across the four official search engines.
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | String | Yes | Bearer <API_KEY> |
Idempotency-Key | String | Yes | A unique random string (UUID v4) that prevents duplicate charges |
Content-Type | String | Yes | application/json |
Request body
| Field | Type | Required | Description and example |
|---|---|---|---|
input.type | String | Yes | url / prompt |
input.url | String | url | Official website to check, such as https://mybrand.com |
input.text | String | prompt | Question text (up to 4,000 characters) |
locale | String | No | Locale code. Defaults to "und" |
{
"job_id": "job_1784de66-d5ff-43e0-8894-a928302843c5",
"measurement_id": "msr_6cdf92d2-7b67-40fc-bd6c-2fcfc46a9169",
"status": "queued",
"created_at": "2026-09-12T08:00:00.000Z"
}
2. Retrieve an observation result
GET /v1/measurements/:measurement_id
Retrieves the measurement result. While it is running the API returns 409 Conflict. When all engines finish it returns 200 OK with the full result.
{
"measurement_id": "msr_6cdf92d2-7b67-40fc-bd6c-2fcfc46a9169",
"status": "succeeded",
"engines": [
{
"id": "openai",
"model": "gpt-6-luna",
"status": "succeeded",
"answer": "The brand is a French bistro in Taipei. Its official website lists the location and reservation information.",
"citations": [{ "url": "https://example.com/about", "title": "About us" }]
},
{
"id": "gemini",
"model": "gemini-3.5-flash-lite",
"status": "succeeded",
"answer": "(full answer text)",
"citations": [{ "url": "https://example.com/", "title": "Example" }]
},
{
"id": "perplexity",
"model": "sonar",
"status": "succeeded",
"answer": "(full answer text)",
"citations": [{ "url": "https://example.com/", "title": "Example" }]
},
{
"id": "anthropic",
"model": "claude-haiku-5-5",
"status": "succeeded",
"answer": "(full answer text)",
"citations": [{ "url": "https://example.com/", "title": "Example" }]
}
],
"created_at": "2026-09-12T08:00:00.000Z",
"completed_at": "2026-09-12T08:00:10.420Z"
}
3. Check job status
GET /v1/jobs/:job_id
Check scheduling progress without retrieving the full answers and citations from the four engines.
4. Check points and usage
GET /v1/usage
In points mode, remaining_rounds is the number of observations your balance covers. used_rounds counts completed observations in the retained job history. Insufficient points return 402 points_insufficient. No job is created while the platform is not accepting requests.
{"plan":"points","billing_mode":"points","mode":"live","balance_points":100,"paid_points":100,"promo_points":0,"points_per_observation":8,"remaining_rounds":12,"used_rounds":0,"quota_limit":null,"period":"all_retained_jobs"}
5. Delete an observation result
DELETE /v1/measurements/:measurement_id
Deletes the specified snapshot and answer. Success returns 204 No Content. Subsequent requests for that ID return 410 Gone.