GET /api/v1/reels/:id¶
Get the analysis result for a submitted Reel.
Poll this endpoint every 5 seconds until status is done or error.
Request¶
Path parameters¶
| Parameter | Type | Description |
|---|---|---|
id |
integer | Job ID returned by POST /api/v1/reels/analyze |
Response¶
200 OK
{
"id": 42,
"url": "https://www.instagram.com/reel/DYa0IXPgnP5/",
"status": "done",
"error": null,
"result": { ... },
"created_at": "2026-05-22T10:00:00Z"
}
| Field | Type | Description |
|---|---|---|
id |
integer | Job ID |
url |
string | The submitted URL |
status |
string | pending | processing | done | error |
error |
string | null | Error message when status is error |
result |
object | null | Full analysis — populated when status is done |
created_at |
string | ISO 8601 timestamp |
See Response Schema → for the full result structure.
Polling pattern¶
import time
import httpx
def wait_for_result(job_id: int, token: str, timeout: int = 120) -> dict:
headers = {"Authorization": f"Bearer {token}"}
deadline = time.time() + timeout
while time.time() < deadline:
r = httpx.get(
f"https://api.instatollm.com/api/v1/reels/{job_id}",
headers=headers,
)
r.raise_for_status()
data = r.json()
match data["status"]:
case "done":
return data["result"]
case "error":
raise RuntimeError(f"Analysis failed: {data['error']}")
case _:
time.sleep(5)
raise TimeoutError(f"Job {job_id} timed out after {timeout}s")
async function waitForResult(id, token, timeoutMs = 120_000) {
const headers = { Authorization: `Bearer ${token}` };
const deadline = Date.now() + timeoutMs;
while (Date.now() < deadline) {
const r = await fetch(
`https://api.instatollm.com/api/v1/reels/${id}`,
{ headers }
);
const data = await r.json();
if (data.status === "done") return data.result;
if (data.status === "error") throw new Error(data.error);
await new Promise((res) => setTimeout(res, 5000));
}
throw new Error(`Timeout for job ${id}`);
}
Status transitions¶
Once a job reaches done or error, its status never changes.
Errors¶
| Status | Cause |
|---|---|
401 |
Invalid or missing token |
404 |
Job ID not found |
500 |
Server error |