Skip to content
FrankX.AI
AI ArchitectureNov 22, 20265 min read815 words

How to run an Apify Actor and verify its dataset

TL;DR

Start with one permitted page and an expected result. Save the run ID, wait for a terminal status, then read the exact dataset and check the returned URL and text before using it.

Frank Riemer
FrankX
AI Architect & Independent Creator
Ex-Oracle AI Architect · Starlight & ACOS Systems
Run a one-page Apify Actor, retrieve its dataset through the API, and check the source before handing the output to an agent or a teammate.
Reading Goal

Start one bounded Actor run, retrieve its dataset by ID, and verify one result against its source.

Give your first Apify Actor one page whose contents you already know. When the run finishes, you should be able to show a teammate the original page, the exact run that read it and the part of its output you accepted. Carry those three things into your next automation and you can investigate a bad result without guessing what an agent saw.

This guide uses Apify’s Website Content Crawler and the Actor API. The walkthrough follows Apify’s published interface. The example uses a placeholder URL for a fixture you host, and the review examples are illustrative.

Disclosure: FrankX participates in Apify’s affiliate program.

See the run in Apify Console

Apify’s own walkthrough shows the sequence in under a minute. At 0:15 it enters the Actor input, at 0:42 it starts the run, and at 0:51 it opens the export. The video uses a different Actor. Watch how the Console moves from input to run to output, then use the crawler input below.

YouTube
Getting started with Apify: set up and run an Actor

Watch on YouTube.

Give the Actor one page and a known answer

Use a static page you own or have permission to process. Put one distinctive sentence in the main content, such as “The pilot opens on Monday.” Write down the source URL and the expected sentence before starting. You can then tell whether the extractor found the page’s actual content or brought back an access notice, navigation text or an empty result.

Paste the following into the Website Content Crawler input and replace the example URL with your page. Depth zero keeps the crawl on its start URLs. The page limit provides a second bound. Keep sitemap discovery off for this run.

{
  "startUrls": [{ "url": "https://example.com/actor-fixture" }],
  "crawlerType": "cheerio",
  "maxCrawlDepth": 0,
  "maxCrawlPages": 1,
  "useSitemaps": false
}

Use the raw HTTP crawler for this fixture. A page that renders its main content only after JavaScript runs calls for a browser-capable configuration and a fresh comparison. Check the Actor’s pricing and execution settings before you start. The crawler’s page limit controls scope. Your expected spend also depends on the Actor’s pricing model and run settings.

Follow the run ID to the dataset

Save the input as actor-input.json. With your API token in the local APIFY_TOKEN environment variable, the following starts one asynchronous run and prints its ID. The examples require curl and jq. Starting a run can incur charges.

curl -fsS -X POST \
  'https://api.apify.com/v2/actors/apify~website-content-crawler/runs?timeout=60' \
  -H "Authorization: Bearer ${APIFY_TOKEN:?Set APIFY_TOKEN}" \
  -H 'Content-Type: application/json' \
  --data-binary @actor-input.json | jq -er '.data.id'

Save the ID as RUN_ID. If the start request times out after you submit it, check the Actor’s recent runs in Console before repeating the POST. The server may already have accepted the first request. Once you have an ID, check that specific run and keep the response as the run record.

curl -fsS "https://api.apify.com/v2/actor-runs/${RUN_ID:?Set RUN_ID}" \
  -H "Authorization: Bearer ${APIFY_TOKEN:?Set APIFY_TOKEN}" > run.json

jq '.data | {id, status, defaultDatasetId, finishedAt}' run.json

Repeat the status read after a pause if the run is in progress. When it reports SUCCEEDED, read a small window from that run’s dataset.

DATASET_ID=$(jq -er '.data | select(.status == "SUCCEEDED") | .defaultDatasetId' run.json) &&
curl -fsS "https://api.apify.com/v2/datasets/${DATASET_ID}/items?format=json&limit=5" \
  -H "Authorization: Bearer ${APIFY_TOKEN:?Set APIFY_TOKEN}" > items.json

The query limit controls how many rows this GET returns. The input controls how much the crawler attempts. Using the exact dataset ID also protects the handoff from a teammate starting a newer run between your two requests. Run an Actor · Get a run · Read dataset items.

Decide whether the result is usable

What you observeWhat to do
The returned source and sentence match the fixtureKeep the relevant excerpt, retrieval time, run ID and dataset ID together.
The run reports success and the dataset is emptyInspect the log and the fixture. Keep the result out of the next workflow until the extraction is understood.
One row contains an access notice, placeholder or unexpected URLReject the row and verify the request against the page you intended to read.
The run failed or timed outSave its status and inspect the log. Change one input or runtime setting before retesting.

As a second exercise, edit the sentence on the fixture and run the same input again. Retrieve both runs by ID and make sure the two evidence records still point to different results. That is a small test of the handoff your teammate or agent will depend on.

When one observation holds up, schedule the same Actor for a weekly changelog watch. To choose who owns execution and recovery when an agent is involved, read Apify MCP vs the Actor API.

Axi

Read on FrankX.AI — AI Architecture, Music & Creator Intelligence

Stay in the intelligence loop

Field notes on AI systems, production patterns, and builder strategy.

Occasional FrankX field notes. Unsubscribe anytime. Privacy details.