Retry a Task
POST https://maxaeo.ai/geoapi/geodata/developer/task/retryRetries a task whose crawl failed. The task keeps its task_id and goes back to the queue to run again. It’s charged only on success, at the price set when it was submitted, once.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
task_id |
string | Yes | The task ID returned by Submit a task or List tasks, up to 64 characters |
The body has task_id only; any extra field returns 1001. Which tasks you can act on follows the same rule as Cancel a task.
Which tasks can be retried
Section titled “Which tasks can be retried”A task can be retried only if all three of these hold:
statusisfailed;error_codeiscrawl_failed(the platform crawl failed);- it was submitted no more than 7 days ago.
Other failures (such as a rejected submission or an invalid API key) return 1032 — submit a new task instead. In rare cases a task that meets all three conditions also returns 1032 because it can no longer be found on the platform side; submit a new task then too. A canceled task can’t be retried either.
Calling retry on a task that is unfinished, succeeded, or canceled returns it unchanged, without an error. So if you lose the response to a retry call, calling it again is safe.
Request examples
Section titled “Request examples”curl -X POST "https://maxaeo.ai/geoapi/geodata/developer/task/retry" \ -H "Authorization: Bearer $MAXAEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{"task_id": "task_9b2e4f60-1c3d-4e8a-b7f5-2d6c8a0e4b19"}'import os
import requests
URL = "https://maxaeo.ai/geoapi/geodata/developer/task/retry"HEADERS = {"Authorization": f"Bearer {os.environ['MAXAEO_API_KEY']}"}
data = requests.post( URL, headers=HEADERS, json={"task_id": "task_9b2e4f60-1c3d-4e8a-b7f5-2d6c8a0e4b19"}, timeout=30).json()if data["ret"] == 1032: print("This task can't be retried; submit a new one")elif data["ret"] != 1: raise RuntimeError(f"ret={data['ret']}: {data['msg']}")else: task = data["data"]["ent"] print(task["status"], task["error_code"]) # pending / running / dispatching — keep pollingconst URL = "https://maxaeo.ai/geoapi/geodata/developer/task/retry";const headers = { Authorization: `Bearer ${process.env.MAXAEO_API_KEY}`, "Content-Type": "application/json",};
const resp = await fetch(URL, { method: "POST", headers, body: JSON.stringify({ task_id: "task_9b2e4f60-1c3d-4e8a-b7f5-2d6c8a0e4b19" }),});const data = await resp.json();if (data.ret === 1032) { console.log("This task can't be retried; submit a new one");} else if (data.ret !== 1) { throw new Error(`ret=${data.ret}: ${data.msg}`);} else { const task = data.data.ent; console.log(task.status, task.error_code); // pending / running / dispatching — keep polling}Response
Section titled “Response”data.ent is the task object, the same structure as Retrieve a task.
When the retry succeeds, status is usually pending, running, or dispatching; keep polling it with Retrieve a task. If an earlier retry has already finished (for example, its response was lost), you may get succeeded right away. Always go by the status returned.
task_id,created_at,monitor_date, and the price set at submission don’t change; the old answer and error are cleared.- When
statusisdispatching,error_codeisretry_uncertain: the retry is being confirmed. This usually takes under a second and isn’t a failure — keep polling.error_messageand similar fields may still hold the previous failure at that point, so go bystatus.
Example response:
{ "ret": 1, "data": { "ent": { "thinking": false, "task_id": "task_9b2e4f60-1c3d-4e8a-b7f5-2d6c8a0e4b19", "platform": "deepseek", "query": "跑步新手应该怎么选第一双跑鞋?", "status": "pending", "answer": "", "result_json": "", "share_link": "", "error_code": "", "error_message": "", "started_at": 0, "finished_at": 0, "created_at": 1793006882, "updated_at": 1793093300, "monitor_date": "2026-10-26", "priority": 2, "country": "", "credits": 3 } }}Credits
Section titled “Credits”A retry reserves credits again, so — like a submission — it can be rejected with 1022 (billing not enabled), 1023 (insufficient credits), 1024 (too many tasks waiting or running), 1025 (too many submissions), or 1029 (platform unsupported or under maintenance).
Credits are charged only on success, at the price set when the task was submitted, once; a retry that fails again isn’t charged. See Billing & Credits.
Errors
Section titled “Errors”ret |
Cause |
|---|---|
1001 |
task_id is missing or longer than 64 characters, or the body contains undefined fields |
1030 |
API key missing or invalid |
1031 |
The task doesn’t exist or doesn’t belong to the current user |
1032 |
The task can’t be retried; submit a new task |
1022 / 1023 / 1024 / 1025 / 1029 |
Rejected while reserving credits again — same meaning as in Submit a task |
-1 |
Service temporarily unavailable — the task is left unchanged, so you can call again |
Related pages
Section titled “Related pages”- Task Lifecycle: statuses, and the rules for canceling and retrying
- Cancel a task: cancel a task that is still queued
- Error Handling: every error code, including
crawl_failedandretry_uncertain - The task object: every field
