Skip to content
looot docs
Esc
↑↓navigate↵open⌘Jpreview
On this page

Apify / run any actor (submit-then-poll, async)

Apify tool apify-actor-run on looot: input fields, $0.06 per call, output shape, and code to run it with curl, JavaScript or Python.

Runs any Apify actor and waits for it to finish. Send the actor id and the actor’s own input. Returns the Apify run object (status, timing, defaultDatasetId, usageTotalUsd, stats), not the scraped rows. To get the rows, call apify-dataset-items with the run’s defaultDatasetId. Set Apify’s timeout parameter to bound a long run; a run that outlives the wait is not aborted.

  • Tool id: apify-actor-run
  • Provider: Apify
  • Job: Run actors (actors.run)
  • Price: $0.06 per call. A call that fails at the provider costs $0.

Inputs

Name Type Required Description
input object no The actor’s own input document, sent as the request body exactly as Apify’s Run Actor API expects (the body IS the actor’s input, never wrapped in an ‘input’ key). Shape is actor-specific – read it from apify-actors-builds-openapi-json for this actorId, or the actor’s public Apify Store page, before calling. Optional: omitting it runs the actor with its own default input, when it has one.
maxItems number no Server-side cap on results returned/produced – always set this for a bounded call. Example: 10
maxTotalChargeUsd number no Hard USD ceiling Apify enforces on this run’s pay-per-event charges. Kept at round 3’s bound (0.001-0.04) – real metering (see price.estimateFormula) makes billing ACCURATE, it does not raise what’s actually safe to let Apify itself spend on this shared account, which is still governed by this cap. Example: 0.04
memory number no Actor run memory in MB. Example: 512
timeout number no Seconds before APIFY ITSELF aborts the run server-side. Raised from round 3’s sync ceiling (120) since this endpoint no longer runs inside the gateway’s own 15s outbound-fetch window – it submits and polls, so a slower cold start no longer needs to fit in 15s. Bounded 5-300 so one call still can’t run forever; see the description’s ‘No cleanup-on-timeout’ note for why this bound is the only real protection. Example: 60
actorId string yes Apify actor id, e.g. ’apifywebsite-content-crawler’ ( in place of /).

Output

Shape of the run’s result, checked against 1 real answer:

{ data: { id, meta: { origin, userAgent }, actId, stats: { metamorph, netRxBytes, netTxBytes, cpuAvgUsage, cpuMaxUsage, memAvgBytes, memMaxBytes, rebootCount, runTimeSecs, computeUnits, inputBodyLen, ... ...

The shape is cut here. Signed in, looot inspect apify-actor-run prints all of it.

Run it

Every call needs your API token in LOOOT_TOKEN; Sign in shows how to get one. Each run also needs a new idempotency key, so a retry never pays twice. With wait: 30 the answer comes back inline when the run ends within 30 seconds. Otherwise you get the running run back: poll GET /v1/runs/<runId>.

Example input with placeholder values:

curl -X POST "https://api.looot.ai/v1/runs" \
  -H "Authorization: Bearer $LOOOT_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"endpointId":"apify-actor-run","input":{"actorId":"<actorId>","memory":512,"timeout":60,"maxItems":10,"maxTotalChargeUsd":0.04},"wait":30}'
const response = await fetch("https://api.looot.ai/v1/runs", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.LOOOT_TOKEN}`,
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID(),
  },
  body: JSON.stringify({
    endpointId: "apify-actor-run",
    input: {
      actorId: "<actorId>",
      memory: 512,
      timeout: 60,
      maxItems: 10,
      maxTotalChargeUsd: 0.04,
    },
    wait: 30,
  }),
});
const run = await response.json();
console.log(run.status, run.result);
import os
import uuid

import requests

response = requests.post(
    "https://api.looot.ai/v1/runs",
    headers={
        "Authorization": f"Bearer {os.environ['LOOOT_TOKEN']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "endpointId": "apify-actor-run",
        "input": {
            "actorId": "<actorId>",
            "memory": 512,
            "timeout": 60,
            "maxItems": 10,
            "maxTotalChargeUsd": 0.04,
        },
        "wait": 30,
    },
    timeout=90,
)
run = response.json()
print(run["status"], run.get("result"))

To let looot pick among every provider of this job instead, send job:actors.run as endpointId; see the job page.

Was this page helpful?