Development / API GUIDE

DataSEO request limits and error handling: fix, investigate, or stop

Validate DataSEO task bodies, space Apple searches four seconds apart, check root and task status before reading metadata, and handle 400, 503 and 402 differently.

A slim code-editor surface, request envelope and structured-output object form a technical still life.

Check HTTP status first, then the root and task status codes, then the expected result shape. Correct invalid input after HTTP 400; investigate source or connection failures after 503; stop on 402 rather than purchasing credit automatically. Page analysis returns meta and checks under its first result item. App search returns app wrappers, so it needs different parsing.

Fix, wait, or stop

The short answer is to fix, investigate, or stop based on the error. HTTP 400 means invalid input and the same body should not be retried unchanged, HTTP 503 means a source failure or a not-connected state, and HTTP 402 means stop without purchasing credit automatically. The task body must be an array with exactly one object, and after an HTTP success you must still check the root status_code and tasks[0].status_code and confirm tasks[0].result[0].items[0] exists before reading tasks[0].result[0].items[0].meta or tasks[0].result[0].items[0].checks. Any retry, backoff, snapshot, or diff strategy you add around a 503 is client design guidance, not a guaranteed API behavior.

DataSEO API contract · DataSEO agent integration instructions

Scope and request limits

The public base is https://dataseo.dev/api/v3 and the two paid operations in scope are POST /api/v3/on_page/instant_pages and POST /api/v3/app_data/apple/app_listings/search/live. Page analysis accepts public HTML up to 2 MB and does not render JavaScript or load external resources, while Apple search accepts keyword, location_code, language_code, limit, and offset with keyword 1 to 200 characters, limit 1 to 50, offset 0 to 100, and language en only. Apple requests follow the recorded one-request-every-four-seconds spacing rule. The account check endpoint is GET https://dataseo.dev/api/v3/appendix/user_data and the key is sent as an Authorization Bearer header from server-side credential storage.

DataSEO API contract · DataSEO agent integration instructions

Primary evidence and controlled fixture

For successful page fixtures, meta and checks are nested under tasks[0].result[0].items[0]. The successful app fixture returns a wrapper at that item path with app_id and a nested item. These are different response shapes. Check HTTP and task status before applying operation-specific parsing. The fixtures are controlled cases, not live provider or billing observations.

DataSEO API contract · Controlled runtime and arithmetic checks

Worked example from the controlled fixture

In the original controlled page fixture, tasks[0].result[0].items[0].meta.title is Trail Notes. The updated fixture changes that value to Trail Notes: updated checklist and sets description_length to 0. Read each value only after checking the root and task status codes. These are synthetic inputs and outputs, not live page observations.

DataSEO API contract · Controlled runtime and arithmetic checks

Failure cases

Two failure cases were observed in the controlled fixture. The rendering_rejected case returned HTTP 400 with the message that only HTML analysis is supported and rendering, resource loading, and other advanced flags must be disabled. The app_limit_rejected case returned HTTP 400 with the message that limit must be 1 to 50 and offset 0 to 100. Those 400 cases argue for client-side validation before sending, while a 503 should be handled as a source or connection problem and a 402 as a hard stop, with any backoff added by your client labeled as client design guidance.

DataSEO API contract · Controlled runtime and arithmetic checks · DataSEO agent integration instructions

Costs and related next steps

Successful requests cost $0.001 for page analysis and $0.01 for app search from prepaid credit, and failed requests are free in the verified tool descriptions. Confirm current pricing before adding credit, keep keys server-side, preserve the four-second Apple spacing and exactly-one-task body, and validate request shapes in the playgrounds before adding any client retry loop.

DataSEO API contract · Controlled runtime and arithmetic checks · DataSEO agent integration instructions · DataSEO prepaid pricing

Secure server-side reference request code with HTTP-before-JSON checks and verified item existence guard

Server-side reference example. javascript

// Reference request code only. This is not the executed controlled fixture and was not a live API run.
// Secure server-side only: DATASEO_API_KEY must stay in server or tool credential storage, never in client code, prompts, or URLs.
const BASE = "https://dataseo.dev/api/v3";
const key = process.env.DATASEO_API_KEY;
if (!key) throw new Error("DATASEO_API_KEY is not configured");

async function call(path, task) {
  const res = await fetch(`${BASE}${path}`, {
    method: "POST",
    headers: { Authorization: `Bearer ${key}`, "Content-Type": "application/json" },
    body: JSON.stringify([task]),
  });
  // Check HTTP status before parsing JSON business fields.
  if (res.status === 402) throw new Error("Payment required: stop and ask the account owner to add credit; do not purchase automatically.");
  if (res.status === 400) throw new Error("Invalid input: check the task body");
  if (res.status === 503) throw new Error("Source failure or not connected: do not treat as an input error.");
  if (!res.ok) throw new Error(`Request failed with HTTP ${res.status}`);
  const body = await res.json().catch(() => ({}));
  if (body.status_code !== 20000) throw new Error(`Root status_code was not 20000: ${body.status_code ?? "missing"}`);
  const taskResult = body.tasks?.[0];
  if (!taskResult || taskResult.status_code !== 20000) throw new Error("Task status_code was not 20000; do not use result fields.");
  const item = taskResult.result?.[0]?.items?.[0];
  if (!item) throw new Error("Missing or empty result: tasks[0].result[0].items[0] does not exist; do not use metadata or item fields.");
  return { taskResult, item };
}

// Page request fields follow the verified example, with rendering and resource flags disabled.
const page = await call("/on_page/instant_pages", {
  url: "https://example.com",
  enable_javascript: false,
  load_resources: false,
  enable_xhr: false,
  enable_browser_rendering: false,
});
const meta = page.item.meta;
if (!meta) throw new Error("Missing meta at tasks[0].result[0].items[0].meta");
console.log(meta.title);

// Client design guidance, not a guaranteed API behavior: space Apple searches at least four seconds apart, and if your client retries a 503 it should use its own backoff and snapshot or diff strategy rather than assuming the API guarantees that policy.
const app = await call("/app_data/apple/app_listings/search/live", {
  keyword: "planner",
  location_code: 2840,
  language_code: "en",
  limit: 1,
  offset: 0,
});
console.log(app.item.item?.title);

Limits and interpretation

  • Page analysis covers public HTML up to 2 MB only, with no JavaScript rendering or external resources, and advanced rendering or resource-loading flags must be disabled.
  • Apple app search supports English only, keyword 1 to 200 characters, limit 1 to 50, and offset 0 to 100, with one request every four seconds.
  • HTTP success alone does not establish task success, so root and task status_code and the presence of tasks.result.items must be checked before using metadata or checks.
  • The controlled fixture used self-authored HTML and an injected Apple response and involved no production API, customer data, provider requests, billing, or live performance measurements, so it is not evidence of live speed, uptime, accuracy, or parity.
  • Retry, backoff, snapshot, and diff behavior for 503 responses is client design guidance, not a guaranteed API behavior.

Sources and verification

Reviewed against first-party documentation and the current DataSEO implementation. Worked scenarios are illustrative unless explicitly identified otherwise. Reviewed 14 November 2026.

  1. DataSEO prepaid pricing
  2. DataSEO API contract
  3. Controlled runtime and arithmetic checks — Synthetic fixtures and pure calculations; no production request or payment was executed.
  4. DataSEO agent integration instructions

Keep building