Skip to main content
POST https://api.acedata.cloud/webextrator/tasks The WebExtrator Task Query API is used to query the results of historical render / extract tasks. Common usages include:
  • Callback to check the complete envelope after an asynchronous task is completed (besides callback_url push or active polling).
  • Audit what has been submitted — task records store both the original request and the final response.
  • Batch refill — pull multiple records at once by id or trace_id.
Task records are retained in Redis for 7 days. The task query interface is free (not counted towards Credits usage).

Authentication

You can only query tasks under your own AceDataCloud account.

Request Parameters

The request body is a discriminative union based on action, with two types of actions:

action: "retrieve" — Single Query

Either id or trace_id must be provided.

action: "retrieve_batch" — Batch Query

Either ids or trace_ids must be provided.

Single Response

If not found, it returns { "task": null } (HTTP 200, not 404). The timing fields of the task object are described as follows.
  • created_at, task creation time, Unix timestamp (seconds, float).
  • started_at, task execution start time, Unix timestamp (seconds, float). It is null when the task has not started.
  • finished_at, task completion time, Unix timestamp (seconds, float). It is null when the task is not completed.
  • elapsed, task execution duration, in seconds (float, rounded to 3 decimal places). It is null when the task is not completed.

Batch Response

Non-existent IDs will not cause an error, they will simply be missing from tasks.

Examples

Query Single by task_id

Query Single by trace_id

Batch Query

Python (requests) — Polling Until Completion

Node.js (fetch) — Pull Complete Envelope After Receiving Callback

Error Responses

Tips and Pitfalls

  • If you can customize trace_id, then do so. Upload it in the original render/extract request ?trace_id=… (QueryString), aligning it with your own business ID (workflow run id, etc.), and then you can query tasks using the business ID. If not provided, the server will automatically generate a UUID.
  • Retention period is 7 days. Tasks older than this will return task: null — if long-term archiving is needed, please store it in your own database.
  • Task queries are free. You can query as many times as you want; the fees for the original render/extract calls have already been paid.
  • Prefer using asynchronous + callbacks instead of polling. If business allows, pass callback_url in the original request, allowing the platform to push the envelope to you, which is more efficient than polling every 2 seconds.