Skip to main content
Version: 1.1.0

flowda Developer API

One API key for the four retrieval capabilities (extract, template, search, map) plus change monitoring (watch), all running on flowda's fetch network.

  • Base URL — the host this documentation is served from (production: https://openapi.flowda.ai).
  • Response body — every capability endpoint returns the fetch platform's own response body, projected verbatim into data. Field names and semantics therefore match the platform contract; the only exception is that internal fields (for example meta.snapshot_id, the platform's snapshot storage path) are removed.

Credentials​

Three credential forms are accepted, all of them scoped to your account:

HowHeaderNotes
API keyAuthorization: Bearer flw_<env>_<key_id>_<secret>Created in the console. Per-endpoint scope is enforced.
API keyX-API-Key: <key>Equivalent form; Authorization wins when both are present.
SessionAuthorization: Bearer <JWT> or the flowda_token cookieObtained by signing in to the console. A session is the account owner, so scopes are not enforced.

Scopes: extract (extract, template, templates), search, map, watch. A key that lacks a scope gets 403 with code 12015 (not 401) — the credential is valid, the grant is not; data.required_scope names the scope you need. GET /v1/account tells you which scopes your key carries.

Response envelope​

Success — HTTP 200, code is 0:

{
"code": 0,
"message": "success",
"request_id": "req_6a99053110d62d17",
"data": {
"success": true,
"request_id": "req_01K7XT3B6C9D4M2Q",
"credits_used": 1,
"outputs": { "markdown": "# Example" },
"meta": { "strategy_used": "X1", "cache_hit": true }
}
}

Failure — the HTTP status is the one in the table below and code is a non-zero application code. Every failure body has code, message and request_id; the only optional members are details and, for a single code, data:

{
"code": 16002,
"message": "the request was rejected, see details",
"request_id": "req_6a99053110d62d17",
"details": ["The request body is invalid(url)."]
}

details is present only for the codes marked yes in the error table: it carries the reason the request failed — for 16xxx codes that is the fetch service's own explanation (usually naming the exact field), for the rest it is ours — and it is the fastest way to fix a rejected call.

data is present on exactly one failure: a scope denial (403 with code 12015) puts the missing scope in data.required_scope, because that is the one field the caller needs in order to fix the key:

{
"code": 12015,
"message": "api key scope denied",
"request_id": "req_6a99053110d62d17",
"data": { "required_scope": "map" }
}

Every other failure omits data, so a failure handler must treat it as optional rather than required or forbidden.

⚠️ Check data.success, not just the status code​

The fetch platform reports "the target could not be retrieved" inside a 200 response: HTTP 200, outer code: 0, but data.success: false with a platform code and message:

{
"code": 0,
"message": "success",
"request_id": "req_a1b2c3d4e5f60718",
"data": {
"success": false,
"code": "TARGET_DNS_ERROR",
"message": "The target host could not be resolved.",
"request_id": "core-req-9f2c1b"
}
}

So a client must treat data.success === false as a failed call even though the status is 200. (The same rule is applied to your call log: such a call is recorded as failed, with the platform code and reason attached.) data.success is always present for capability calls.

What data.code can contain​

data.code is an uppercase string owned by the fetch service. The lists below are the codes that endpoint can currently produce; anything else should be handled like UNKNOWN_ERROR.

extract — TARGET_TIMEOUT, TARGET_DNS_ERROR (the host, or a redirect target, could not be resolved), TARGET_SSL_ERROR, TARGET_SITE_ERROR (unreachable, redirect loop, invalid redirect, non-routable address), TARGET_ALL_ENGINES_FAILED (every retrieval engine failed, or the page has no readable content — a JavaScript-only page also lands here: retry with advanced_mode), TARGET_UNSUPPORTED_FILE_TYPE (the target is a file type we do not deliver), UNKNOWN_ERROR.

template — TARGET_SITE_ERROR, TARGET_DNS_ERROR, TARGET_TIMEOUT, TARGET_SSL_ERROR, TARGET_ALL_ENGINES_FAILED, TEMPLATE_MISMATCH (the page no longer matches the template contract), UNKNOWN_ERROR. A missing product or an empty listing is not one of these: it comes back as a success with outputs: null and is still billed.

map — INVALID_REQUEST, INVALID_API_KEY, INSUFFICIENT_CREDITS, RATE_LIMITED, INTERNAL_ERROR, TARGET_ALL_ENGINES_FAILED, TARGET_TIMEOUT, UNKNOWN_ERROR.

search — a per-result extraction failure is reported inside data.outputs[].extract (success: false on that result) and does not fail the call; a platform-level failure uses this shape like every other capability endpoint.

Two extract rejections use the HTTP status line instead of data.success, and arrive with 16002: EXTRACTION_SELECTION_EMPTY (your exclude_tags removed all body text) and EXTRACTION_OUTPUT_TOO_LARGE (the parser output exceeded the resource budget — reduce formats).

Two request identifiers — quote both in a support request​

ValueWho generated itWhere
request_id (envelope)flowdaEnvelope of every response, success or failure
request_id inside datathe fetch platformPlatform response body; identical to the X-Upstream-Request-Id response header

For POST /v1/map the value inside data may be the fetch network's own identifier instead of the platform's; the X-Upstream-Request-Id header is the authoritative one when you need to trace a single call.

Replay​

GET /v1/replay/{request_id} returns the original response body of an earlier capability call, byte for byte, without calling the fetch service again.

  • The path parameter is the platform request id — the X-Upstream-Request-Id response header of the original call (also data.request_id inside its body). flowda's own envelope request_id is a different value and is not accepted.
  • The id format is req_YYYYMMDD_<hex16>. Older ids (req_<hex16>) were never retained and answer 404.
  • A replay is never billed and does not re-run the call: data.credits_used is what the original call was billed, and data.success is the original outcome — false means the call you replayed had failed. The replay itself succeeded.
  • Ownership is enforced per account: another account's request_id answers 404, exactly as if it did not exist. The key must also carry the scope of the original operation (search, extract or map), otherwise the answer is 403 with code 12015.
  • Results are retained for a limited time. Once a result is gone the endpoint answers 410 (code 11006) — retrying will not bring it back. A result that is still being archived answers 409 with Retry-After: 1.
  • The response carries the original call's metadata as headers: X-Replay-Of (the replayed id), X-Replay-Operation (search / extract / map), X-Original-Status and X-Original-Outcome (succeeded / failed).

Error codes​

codeHTTPMeaningWhat to dodetails
10000500Internal errorRetry later; contact us if it persistsno
11000400Invalid requestFix the request as described in detailsyes
11004404Not foundCheck the path; jobs and checks must belong to your accountno
11005405Method not allowedUse the documented methodno
11006410The result is no longer availableDo not retry; the result was not retainedno
12001401Authentication requiredSend an API key or a session tokenno
12002401Invalid or expired session tokenSign in againno
12003403ForbiddenAccount disabled, or the write request failed its origin checkno
12014401API key invalid, revoked or expiredCheck the key in the consoleno
12015403API key lacks this endpoint's scopeAdd the scope named in data.required_scopeno
13000429Rate limit exceededBack off using Retry-Afterno
13002402Daily quota exhaustedWait for the next UTC day, or ask us for a higher quotayes
14000500Storage unavailableRetry later; contact us if it persistsno
16000502The fetch service failedRetry laterno
16001504The fetch service did not answer in timeRetry laterno
16002400The fetch service rejected the requestFix the request as described in detailsyes
16003429The fetch service is rate limitingReduce concurrency and retryno
16004402The fetch service has no credits leftContact us to top upyes
16005503The fetch service is unreachableRetry laterno
16006400webhook_url rejectedFix the URL as described in detailsyes
16007401Webhook signature invalidOnly returned on the platform callback endpointno
16008409Conflicts with the job's current stateAdjust the state; details says which conflictyes
16009500Configuration problem on our sideContact us — retrying will not helpno

Codes in the 16xxx range describe the fetch service. 16009 means our platform credential is broken (a flowda-side configuration fault), never your API key: it is deliberately not a 401 so that you do not go looking for a problem in your own credentials.

Form-encoded request bodies​

Endpoints that accept both application/json and application/x-www-form-urlencoded use the same field names for both media types. Form-encoded bodies are converted to JSON before processing, so all validation and field rules apply identically.

Encoding rules​

  • Strings: send as a single value. Repeating the same field name for scalar fields returns 400 with code 11000.
  • Booleans: only true and false are accepted (as literal strings, unquoted).
  • Integers: decimal notation only; no leading zeros or decimal points (01, 1.0 rejected).
  • Arrays: repeat the field name (formats=markdown&formats=links), or send a JSON array as a single string value (formats=["markdown","links"]). If the value starts with [ but is not valid JSON (for example, the CSS selector [data-kind]), it is treated as a regular string element in a single-item array.
  • Objects (headers, extract_options, params): send as a JSON object string (headers={"Accept-Language":"en-US"}).
  • Empty values: a field sent with an empty value (include_tags=) means "not provided" — it is dropped before the request is forwarded, exactly as if you had left the field out. Send include_tags=[] if you really need an empty array.
  • Character encoding: UTF-8 only. A charset parameter other than utf-8 or a body that is not valid UTF-8 after percent-decoding returns 400 with code 11000.

Unknown fields are accepted and forwarded — the fetch service will reject them with a specific field message if they are not recognized. This matches the JSON behavior.

Example:

POST /v1/extract HTTP/1.1
Content-Type: application/x-www-form-urlencoded

url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FHTTP%2FGuides%2FCaching&formats=markdown&formats=links&only_main_content=false&max_age_ms=0&headers=%7B%22Accept-Language%22%3A%22en-US%22%7D

is equivalent to:

{
"url": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching",
"formats": ["markdown", "links"],
"only_main_content": false,
"max_age_ms": 0,
"headers": {"Accept-Language": "en-US"}
}

Billing​

  • Every call to a capability endpoint is billed once it reaches the fetch service. There is no idempotency key, so a retry after a timeout can be billed twice — confirm the outcome in your call log before retrying.
  • credits_used in the response reports what this call cost: extract costs 1 credit on a cache hit and 1 / 3 / 5 by the strategy used on a miss; template execution costs a flat 5 credits (a successful but empty result still costs 5, a failed execution costs 0); search is billed per result.
  • GET /v1/templates and GET /v1/templates/{template_id} are metadata calls: they cost 0 credits but still appear in your call log.
  • render_js is an internal troubleshooting switch of the fetch service and is not exposed — use advanced_mode when a page needs rendering.
  • A request that carries your own headers never reads the platform's snapshot cache, and the target URL stays marked for 48 hours. Do not send headers for private pages you do not want to be re-fetched.

Availability​

The whole /v1/** surface (capabilities, GET /v1/account, this documentation and everything under /v1/watch) shares a single server-side switch. When the operator has it off, every /v1 route answers 404 with code 11004 — that is a deliberate, uniform state, not a routing mistake. GET /api/v1/healthz and GET /api/v1/readyz stay available either way.

Authentication​

An API key created in the console. Per-endpoint scopes are enforced.

Security Scheme Type:

http

HTTP Authorization Scheme:

bearer

Bearer format:

flw_<env><key_id><secret>