API v1

Plinda Engine API

One REST API for AI answer engines, search results and web pages. You queue a task, a worker runs it from the country you pick, and you get back the answer text, its sources and an optional brand analysis. All responses use the same envelope: { "success": true, "data": ... } or { "success": false, "error": ... }.

Base URL: https://promptgale.com

Authentication

Create a key in the dashboard under API keys and send it as a bearer token on every request. Keys start with pk_live_. We store only a hash, so a lost key cannot be recovered; revoke it and create a new one.

header
Authorization: Bearer pk_live_...

Async tasks

POST /v1/async/task validates the request, holds the task price from your balance and returns the task with status QUEUED (201). Poll GET /v1/async/task/{id} until the status is COMPLETED or FAILED, or pass webhookUrl to be called when it finishes. Completed tasks are charged; failed tasks are refunded in full. Retryable engine errors are retried up to 3 attempts before a task fails.

submit
curl -X POST https://promptgale.com/v1/async/task \
  -H "Authorization: Bearer $PLINDA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: run-2026-11-21-001" \
  -d '{
    "taskType": "PERPLEXITY",
    "payload": {
      "prompt": "Which project management tools are best for agencies?",
      "country": "US",
      "brand": "Acme",
      "competitors": ["Globex", "Initech"]
    },
    "webhookUrl": "https://example.com/hooks/plinda"
  }'
201 response
{
  "success": true,
  "data": {
    "id": "tsk_8Jx0c2...",
    "taskType": "PERPLEXITY",
    "status": "QUEUED",
    "country": "US",
    "credits": 1,
    "attempts": 0,
    "maxAttempts": 3,
    "result": null,
    "error": null,
    "createdAt": "2026-11-21T12:00:00.000Z"
  }
}
poll
curl https://promptgale.com/v1/async/task/tsk_8Jx0c2... \
  -H "Authorization: Bearer $PLINDA_API_KEY"
poll loop (Node)
const API = 'https://promptgale.com';
const headers = { Authorization: `Bearer ${process.env.PLINDA_API_KEY}` };

async function waitFor(id) {
  for (;;) {
    const res = await fetch(`${API}/v1/async/task/${id}`, { headers });
    const { data } = await res.json();
    if (data.status === 'COMPLETED' || data.status === 'FAILED') return data;
    await new Promise((r) => setTimeout(r, 2000));
  }
}

Send the same Idempotency-Key header (or idempotencyKey field) to retry a submit safely: the original task is returned with 200. Reusing a key with a different body returns RESOURCE_ALREADY_EXISTS. Submit up to 500 tasks at once with POST /v1/async/task/batch; a batch is accepted or rejected as a whole.

batch
curl -X POST https://promptgale.com/v1/async/task/batch \
  -H "Authorization: Bearer $PLINDA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tasks":[
    {"taskType":"CHATGPT","payload":{"prompt":"best crm","country":"US"}},
    {"taskType":"GEMINI","payload":{"prompt":"best crm","country":"US"}}
  ]}'

List your tasks with GET /v1/tasks?limit=50&engine=CHATGPT&status=COMPLETED&cursor=... (newest first; pass nextCursor to page). Balance is at GET /v1/credits and daily usage at GET /v1/usage?from=2026-11-01&to=2026-11-30.

Sync tasks

POST /v1/sync/task takes the same body and waits for the result. It answers 200 with the finished task (completed or failed) or, after 290 seconds (or Prefer: wait=N), 202 with the pending task and a Location header so you can keep polling. Prefer async for batches and anything in a job queue.

sync
curl -X POST https://promptgale.com/v1/sync/task \
  -H "Authorization: Bearer $PLINDA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"taskType":"GOOGLE_SERP","payload":{"query":"crm for agencies","country":"GB"}}'

Task types

taskType is case-insensitive. Aliases: GOOGLE → GOOGLE_AIO, AIMODE → GOOGLE_AIMODE, BING → BING_SEARCH, MICROSOFT_COPILOT → COPILOT, BING_COPILOT → COPILOT, COPILOT_SEARCH → BING_COPILOT_SEARCH, BING_AIMODE → BING_COPILOT_SEARCH, WEB_SEARCH → GOOGLE_SERP, SEARCH → GOOGLE_SERP, PLACES → GOOGLE_PLACES, GOOGLE_MAPS → GOOGLE_PLACES, MAPS → GOOGLE_PLACES. Live status per engine is at GET /v1/capabilities.

taskTypeEngineKindCredits
CHATGPTChatGPTanswer1
GEMINIGeminianswer1
PERPLEXITYPerplexityanswer1
COPILOTMicrosoft Copilotanswer1
BING_COPILOT_SEARCHBing Copilot Searchanswer1
META_AIMeta AIanswer1
GOOGLE_AIOGoogle AI Overviewanswer1.25
GOOGLE_AIMODEGoogle AI Modeanswer1.25
GOOGLE_SERPGoogle Searchsearch0.3
GOOGLE_NEWSGoogle Newssearch0.3
BING_SEARCHBing Searchsearch0.3
BRAVE_SEARCHBrave Searchsearch0.3
GOOGLE_PLACESGoogle Placesplaces1
WEB_SCRAPEWeb Scrapepage0.3

Payload fields

Top-level body fields, shared by every engine:

FieldTypeDescription
taskTypestringEngine to run. Required.
payloadobjectEngine input, see below. Required.
webhookUrlstring (url)Called with the finished task. Optional.
idempotencyKeystringUp to 200 characters. Optional.
priorityinteger 0..10Higher runs first within your account. Default 0.

Answer engines

FieldTypeDescription
promptstring1 to 4000 characters. Required.
countryISO2Market to ask from. Default US.
brandstringTurns on the analysis block (rule-based part).
brandAliasesstring[]Other names that count as the brand.
brandDomainsstring[]Domains that count as citing the brand.
competitorsstring[]Brands to compare against, up to 50.
includeobjectmarkdown (default true), html, rawResponse, screenshot, analysis (booleans). analysis: full answer analysis with sentiment, with or without brand.

Search engines

FieldTypeDescription
querystring1 to 2048 characters. Required.
countryISO2Default US.
hlstringInterface language override, for example es.
pageinteger 1..20Result page. Default 1.
limitinteger 1..100Results per page. Default 10.

Places

FieldTypeDescription
querystring1 to 500 characters, for example "coworking palermo". Required.
countryISO2Default US.
hlstringInterface language override.
limitinteger 1..20Places to return. Default 10.

Web scrape

FieldTypeDescription
urlstring (http/https)Page to fetch. Required.
renderbooleanRender JavaScript in a browser. Default false.
countryISO2Default US.
maxCharsintegerTruncate the extracted text.

Result schema

data.result is set when a task completes. SERP tasks fill organic (and news for news search), places tasks fillplaces, and both leave text empty; answer tasks fill text, markdown and sources.

FieldTypeDescription
enginestringCanonical task type.
textstringPlain answer text.
markdownstring?Answer with formatting kept.
sourcesSource[]position, url, domain, title?, snippet?, cited (false = only in the source list), citationNumber?.
organicOrganic[]?position, url, title, domain, snippet?.
newsNews[]?position, url, title, source?, date?.
placesPlace[]?position, name, url (Google Maps), placeId?, rating?, reviews?, category?, address?, phone?, website?, hours?, lat?, lng?, sponsored?.
searchQueriesstring[]?Queries the engine ran, when it shows them.
relatedQuestionsstring[]?Follow-up questions the engine suggests, when it shows them.
modelstring?Model name when the engine exposes it.
analysisAnalysis?brands (yours and competitors: mentioned, mentions, firstPosition, rank, cited, citedUrls, role, shareOfVoice, recommended, sentiment, sentimentReason), brandsNamed (every brand named, in order), sources (kind: owned, competitor, ugc, news, marketplace, review, reference, other), citationKinds, method, llm.
locationobjectcountry, locale, timezone, exitIp?, exitCountry?, proxyLabel?.
durationMsintegerTime spent running the engine.
metaobjectcaptchaSolves, captchaCostUsd, attempts?, notes?, analysisCostUsd?.
result
{
  "engine": "PERPLEXITY",
  "text": "For agencies, the most recommended tools are ...",
  "markdown": "For agencies, the most recommended tools are ...",
  "sources": [
    { "position": 1, "url": "https://example.com/review", "domain": "example.com",
      "title": "Review", "cited": true }
  ],
  "searchQueries": ["project management tools agencies"],
  "model": "default",
  "analysis": {
    "status": "ok",
    "brands": [
      { "name": "Acme", "role": "target", "mentioned": true, "mentions": 2,
        "firstPosition": 118, "rank": 1, "cited": true, "citedUrls": ["https://acme.com/"] }
    ]
  },
  "location": { "country": "US", "locale": "en-US", "timezone": "America/New_York",
                "exitCountry": "US", "proxyLabel": "us-1" },
  "durationMs": 14210,
  "meta": { "captchaSolves": 0, "captchaCostUsd": 0, "attempts": 1 }
}

Errors

Errors use the HTTP status below and a stable code. A task that fails while running is not an HTTP error: it ends with status FAILED and an error object.

error envelope
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "request validation failed",
    "details": [{ "path": "payload.prompt", "message": "Too small: expected string to have >=1 characters" }],
    "timestamp": "2026-11-21T12:00:00.000Z"
  }
}
CodeHTTPMeaning
VALIDATION_ERROR400The body or a parameter is invalid. details lists each field.
MISSING_API_KEY401No Authorization header.
INVALID_API_KEY401The key is unknown or revoked.
INSUFFICIENT_CREDITS402Not enough available credits, or the key reached its daily limit.
FORBIDDEN403The request is not allowed (for example a cross-origin form post).
RESOURCE_NOT_FOUND404No task with that id in your account.
RESOURCE_ALREADY_EXISTS409The idempotency key was already used with a different request.
LOCATION_UNSUPPORTED422The engine does not take that location field (state, uule, city or location), or does not support grids.
REGION_UNSUPPORTED422The engine cannot run from that country (details.cause no_exit). Not retryable; see /v1/countries?taskType=.
EVIDENCE_UNSUPPORTED422
ENGINE_UNAVAILABLE503The engine is turned off for now. Check /v1/capabilities.
QUEUE_LIMIT_EXCEEDED429Too many pending tasks on the account. Wait for some to finish.
INTERNAL_ERROR500Something failed on our side. Safe to retry.
GOOGLE_REDIRECT_UNRESOLVED502

Task error codes: CAPTCHA_UNSOLVED SIGNIN_WALL LOGIN_WALL BLOCKED TIMEOUT NO_ANSWER PROXY_ERROR NAVIGATION UNSUPPORTED INTERNAL ACCOUNT_LOGGED_OUT ENGINE_REFUSED CONSENT_WALL AGE_GATE LOCATION_UNSUPPORTED NO_PROXY EXITS_UNAVAILABLE LEASE_EXPIRED TASK_CANCELLED INSUFFICIENT_CREDITS

Batches

POST /v1/batches takes up to 10,000 items ({ items: [{ customId?, taskType, payload, idempotencyKey?, webhookUrl? }], idempotencyKey?, webhookUrl?, metadata? }). Every item is checked first; one bad item refuses the whole batch with the failing indexes. Items are queued as room frees up: each account keeps at most twice its concurrency limit of batch tasks queued or running, accounts and batches take turns, and your single tasks go before queued batch tasks of the same priority. Credits are held per item when it is queued; an item you cannot pay for at that moment ends rejected with INSUFFICIENT_CREDITS. The same idempotencyKey within 30 days returns the first batch. Follow it with GET /v1/batches/{id} (counts, percent, credits held and charged) and read GET /v1/batches/{id}/items?status=&cursor=&include=result. When every item has finished, webhookUrl gets{"event":"batch.completed","data":<batch>}, signed like task webhooks over ${batchId}.${timestamp}.${rawBody}.

Evidence pages

payload.include.html: true saves the screen the engine showed for the answer as one self-contained page (styles and images inlined, scripts removed) at result.htmlUrl; result.evidence has its status, format and expiry. Pages open without an API key for 30 days, are not indexed and run no scripts. +0.25 credit, charged only when the page was saved. Engines: CHATGPT, GEMINI, PERPLEXITY, META_AI, COPILOT, GOOGLE_AIO, GOOGLE_AIMODE, GOOGLE_SERP, BING_COPILOT_SEARCH; others answer 422 EVIDENCE_UNSUPPORTED. include.rawHtml returns the page HTML inline instead.

Queue, stats and utilities

GET /v1/async/status: your queued and running tasks, batch items not queued yet, concurrency used and limit. DELETE /v1/async/queue: cancels every queued task (FAILED with TASK_CANCELLED, credits released) and pending batch item. GET /stats?hours=24: counts by status and engine, success rate, durations, top errors. GET /capacity: per engine status, queue depth and usable accounts. POST /v1/google/goto {"url":"https://www.google.com/goto?url=..."}: the page a Google redirect leads to (no credits). WEB_SCRAPE returns result.page (metadata, JSON-LD, images) and with maxAge (seconds) serves a cached read (result.cached). Agents: /llms.txt, /llms-full.txt, /.well-known/agent-skills/.

Webhooks

When a task with webhookUrl finishes we POST the task to that URL. Any 2xx response counts as delivered. Other responses and timeouts (30 s) are retried 4 more times, after 2, 4, 8 and 16 minutes.

body
{
  "event": "task.completed",          // or "task.failed"
  "data": { "id": "tsk_...", "status": "COMPLETED", "result": { ... }, ... }
}
FieldTypeDescription
plinda-webhook-idheaderUnique per delivery attempt. Use it to deduplicate.
plinda-webhook-timestampheaderUnix seconds when the request was signed.
plinda-webhook-signatureheaderv1,<base64 HMAC-SHA256>. Key: the signing secret of the API key that created the task.

The signed message is ${taskId}.${timestamp}.${rawBody}. Compute it over the raw request body, before any JSON parsing.

verify.mjs (Node)
import crypto from 'node:crypto';
import express from 'express';

const app = express();
const SECRET = process.env.PLINDA_SIGNING_SECRET; // shown once when the key is created

// Keep the raw body: the signature covers the exact bytes we sent.
app.post('/hooks/plinda', express.raw({ type: 'application/json' }), (req, res) => {
  const raw = req.body.toString('utf8');
  const timestamp = req.header('plinda-webhook-timestamp');
  const signature = req.header('plinda-webhook-signature') ?? '';
  const event = JSON.parse(raw);

  // Reject old deliveries (replay protection): 5 minutes of tolerance.
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return res.sendStatus(400);

  const expected = crypto
    .createHmac('sha256', SECRET)
    .update(`${event.data.id}.${timestamp}.${raw}`)
    .digest('base64');
  const given = signature.replace(/^v1,/, '');
  const ok =
    given.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(given), Buffer.from(expected));
  if (!ok) return res.sendStatus(401);

  // Deduplicate on plinda-webhook-id, then handle event.data
  res.sendStatus(200);
});

Countries

Pass any ISO 3166-1 alpha-2 code as payload.country. Locale, timezone and language headers follow the country. Search engines serve every country (by URL parameters when we have no exit there); chat engines need an exit in the country. GET /v1/countries?taskType=CHATGPT lists what an engine accepts. Finer locations: payload.state (US, +1 credit, GET /v1/states?country=US), payload.uule and payload.city (Google engines), payload.location (a point, +1 credit), and location grids with POST /v1/async/task/grid.

ADAndorra
AEUnited Arab Emirates
AFAfghanistan
AGAntigua and Barbuda
AIAnguilla
ALAlbania
AMArmenia
AOAngola
AQAntarctica
ARArgentina
ASAmerican Samoa
ATAustria
AUAustralia
AWAruba
AXÅland Islands
AZAzerbaijan
BABosnia and Herzegovina
BBBarbados
BDBangladesh
BEBelgium
BFBurkina Faso
BGBulgaria
BHBahrain
BIBurundi
BJBenin
BLSaint Barthélemy
BMBermuda
BNBrunei
BOBolivia
BQCaribbean Netherlands
BRBrazil
BSBahamas
BTBhutan
BVBouvet Island
BWBotswana
BYBelarus
BZBelize
CACanada
CCCocos (Keeling) Islands
CDCongo (DRC)
CFCentral African Republic
CGCongo
CHSwitzerland
CICôte d'Ivoire
CKCook Islands
CLChile
CMCameroon
CNChina
COColombia
CRCosta Rica
CUCuba
CVCabo Verde
CWCuraçao
CXChristmas Island
CYCyprus
CZCzechia
DEGermany
DJDjibouti
DKDenmark
DMDominica
DODominican Republic
DZAlgeria
ECEcuador
EEEstonia
EGEgypt
EHWestern Sahara
EREritrea
ESSpain
ETEthiopia
FIFinland
FJFiji
FKFalkland Islands
FMMicronesia
FOFaroe Islands
FRFrance
GAGabon
GBUnited Kingdom
GDGrenada
GEGeorgia
GFFrench Guiana
GGGuernsey
GHGhana
GIGibraltar
GLGreenland
GMGambia
GNGuinea
GPGuadeloupe
GQEquatorial Guinea
GRGreece
GSSouth Georgia and the South Sandwich Islands
GTGuatemala
GUGuam
GWGuinea-Bissau
GYGuyana
HKHong Kong
HMHeard Island and McDonald Islands
HNHonduras
HRCroatia
HTHaiti
HUHungary
IDIndonesia
IEIreland
ILIsrael
IMIsle of Man
INIndia
IOBritish Indian Ocean Territory
IQIraq
IRIran
ISIceland
ITItaly
JEJersey
JMJamaica
JOJordan
JPJapan
KEKenya
KGKyrgyzstan
KHCambodia
KIKiribati
KMComoros
KNSaint Kitts and Nevis
KPNorth Korea
KRSouth Korea
KWKuwait
KYCayman Islands
KZKazakhstan
LALaos
LBLebanon
LCSaint Lucia
LILiechtenstein
LKSri Lanka
LRLiberia
LSLesotho
LTLithuania
LULuxembourg
LVLatvia
LYLibya
MAMorocco
MCMonaco
MDMoldova
MEMontenegro
MFSaint Martin
MGMadagascar
MHMarshall Islands
MKNorth Macedonia
MLMali
MMMyanmar
MNMongolia
MOMacao
MPNorthern Mariana Islands
MQMartinique
MRMauritania
MSMontserrat
MTMalta
MUMauritius
MVMaldives
MWMalawi
MXMexico
MYMalaysia
MZMozambique
NANamibia
NCNew Caledonia
NENiger
NFNorfolk Island
NGNigeria
NINicaragua
NLNetherlands
NONorway
NPNepal
NRNauru
NUNiue
NZNew Zealand
OMOman
PAPanama
PEPeru
PFFrench Polynesia
PGPapua New Guinea
PHPhilippines
PKPakistan
PLPoland
PMSaint Pierre and Miquelon
PNPitcairn Islands
PRPuerto Rico
PSPalestine
PTPortugal
PWPalau
PYParaguay
QAQatar
RERéunion
RORomania
RSSerbia
RURussia
RWRwanda
SASaudi Arabia
SBSolomon Islands
SCSeychelles
SDSudan
SESweden
SGSingapore
SHSaint Helena, Ascension and Tristan da Cunha
SISlovenia
SJSvalbard and Jan Mayen
SKSlovakia
SLSierra Leone
SMSan Marino
SNSenegal
SOSomalia
SRSuriname
SSSouth Sudan
STSão Tomé and Príncipe
SVEl Salvador
SXSint Maarten
SYSyria
SZEswatini
TCTurks and Caicos Islands
TDChad
TFFrench Southern Territories
TGTogo
THThailand
TJTajikistan
TKTokelau
TLTimor-Leste
TMTurkmenistan
TNTunisia
TOTonga
TRTurkey
TTTrinidad and Tobago
TVTuvalu
TWTaiwan
TZTanzania
UAUkraine
UGUganda
UMU.S. Outlying Islands
USUnited States
UYUruguay
UZUzbekistan
VAVatican City
VCSaint Vincent and the Grenadines
VEVenezuela
VGBritish Virgin Islands
VIU.S. Virgin Islands
VNVietnam
VUVanuatu
WFWallis and Futuna
WSSamoa
YEYemen
YTMayotte
ZASouth Africa
ZMZambia
ZWZimbabwe

MCP

The MCP server speaks streamable HTTP at https://promptgale.com/mcp and uses the same API key as a bearer token. Tools: run_prompt submit_prompt get_task web_search web_scrape get_credits get_usage get_capabilities list_countries list_states submit_location_grid get_location_grid.

Claude Code
claude mcp add --transport http plinda https://promptgale.com/mcp \
  --header "Authorization: Bearer pk_live_..."
Cursor: ~/.cursor/mcp.json
{
  "mcpServers": {
    "plinda": {
      "url": "https://promptgale.com/mcp",
      "headers": { "Authorization": "Bearer pk_live_..." }
    }
  }
}

OpenAPI

The machine-readable contract is at /v1/openapi.json (OpenAPI 3.1). Use it to generate a client or import it into your API tool.