canonical: https://jentic.com/apis/apify.com/apify

# Apify API

Apify is a cloud platform for building, running, and scaling web scrapers and browser automation jobs called Actors. The Apify API exposes 118 endpoints for managing Actors, Actor versions and builds, scheduled and on-demand runs, datasets, key-value stores, request queues, and webhooks. Agents and integrations use it to launch scraping jobs, poll their progress, and pull structured results from the default dataset. Authentication is via a bearer token issued from the Apify console, and the global rate limit is 250,000 requests per minute with 30 to 200 requests per second per resource.

## For AI agents

Run, monitor, and collect results from Apify Actors and tasks, plus manage datasets, key-value stores, and request queues across 118 endpoints.

## Scope

Does not handle natural-language understanding of scraped content, hosting of frontends, or general-purpose compute - use for managing Apify Actors, runs, and their storage only.

## Capabilities

- Launch Actor runs synchronously or asynchronously and pass JSON input that drives the scraper's behaviour
- Poll Actor run status, fetch logs, and abort or resurrect runs from the /v2/actor-runs endpoints
- Stream items out of a run's default dataset in JSON, CSV, XLSX, or RSS via /v2/datasets/{datasetId}/items
- Read and write arbitrary blobs in key-value stores using /v2/key-value-stores/{storeId}/records/{key}
- Enqueue and lock URLs in request queues to coordinate distributed crawls across multiple Actor runs
- Register webhooks that fire when an Actor run succeeds, fails, or times out so downstream systems react instantly

## Use cases

### On-demand web scraping for agents

Trigger a pre-built or custom Apify Actor to scrape product listings, search results, or social profiles, then read the structured output from the run's default dataset. Agents call POST /v2/acts/{actorId}/runs with a JSON input, poll GET /v2/actor-runs/{runId} until status is SUCCEEDED, then fetch items via GET /v2/datasets/{datasetId}/items. The whole loop typically completes in seconds to a few minutes depending on Actor complexity.

Example prompt: POST /v2/acts/apify~web-scraper/runs with input {startUrls:[{url:'https://example.com'}]}, poll the run, then GET /v2/datasets/{defaultDatasetId}/items?format=json.

### Scheduled data pipelines

Create an Actor task with a saved input and run it on a cron schedule, then have Apify push the dataset rows into your warehouse via webhook. Tasks decouple the run configuration from the Actor itself so analysts can edit inputs without touching code, and the /v2/schedules endpoints let you manage timing centrally. This pattern is well suited for daily price monitoring, SERP tracking, or competitor inventory feeds.

Example prompt: POST /v2/actor-tasks with actId, input, and a name, then POST /v2/schedules referencing the task id with a cron expression.

### Coordinated distributed crawls

Use Apify request queues to share a frontier of URLs between many Actor runs so a large crawl finishes faster without duplicate work. The /v2/request-queues/{queueId}/requests endpoints support add, get, update, and delete plus lock and unlock semantics, allowing multiple Actor runs to claim items safely. Combined with datasets for results and key-value stores for state, this gives a clean producer-consumer architecture for crawls of millions of pages.

Example prompt: POST /v2/request-queues/{queueId}/requests to enqueue URLs, then have multiple Actor runs call /v2/request-queues/{queueId}/requests/head with lockSecs to claim them.

### Agent-orchestrated research with Jentic

An agent answering a question about live web data can run an Apify Actor through Jentic without holding the bearer token directly. Jentic returns the run-and-fetch-results operations on demand, the token is injected from the vault, and the agent receives the dataset items as JSON to ground its answer. This lets the agent treat Apify as a single 'go scrape this' tool rather than orchestrating an SDK.

Example prompt: Through Jentic, search 'run a web scraper', load apify.com run-actor and get-dataset-items, then execute them in sequence to ground the answer.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /v2/acts | List Actors in your account |
| POST | /v2/acts/{actorId}/runs | Run an Actor asynchronously |
| GET | /v2/actor-runs/{runId} | Get an Actor run's status and metadata |
| GET | /v2/datasets/{datasetId}/items | Fetch dataset items as JSON, CSV, or XLSX |
| POST | /v2/actor-tasks | Create a saved task with input and Actor reference |
| POST | /v2/schedules | Schedule a task to run on a cron |
| POST | /v2/webhooks | Register a webhook for run lifecycle events |

## Key resources

- **Actors** — Manage scraper definitions, versions, and builds via /v2/acts and /v2/actor-builds.
- **Actor runs** — Launch, poll, abort, and resurrect runs via /v2/acts/{actorId}/runs and /v2/actor-runs.
- **Actor tasks** — Saved Actor configurations runnable via /v2/actor-tasks and /v2/schedules.
- **Datasets** — Append-only result tables exposed via /v2/datasets and /v2/datasets/{datasetId}/items.
- **Key-value stores** — Arbitrary blob storage via /v2/key-value-stores and /v2/key-value-stores/{storeId}/records/{key}.
- **Request queues** — Crawl frontiers via /v2/request-queues with lock semantics for multi-worker safety.
- **Webhooks** — Event subscriptions via /v2/webhooks that fire on run lifecycle events.

## Why Jentic

- **Setup:** Wiring Apify by hand means setting up its bearer or query token auth, learning the actor, run, and dataset resource shapes, and polling runs yourself. Through Jentic you install once, import Apify from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** Apify puts the actor id and run id in the URL path (/acts/{actorId}/runs, /actor-runs/{runId}), so a rule can pin your agent to one actor: it can start and read runs for that actor and nothing else. You choose the operations it may call, so creating schedules or webhooks is not included unless you add it.
- **Credential handling:** Your Apify token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'run an Apify actor' or 'read a dataset's items', and Jentic returns the matching Apify operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **ZenRows** — Single-call scraping API with built-in proxy rotation and anti-bot bypass.
- **Browserless** — Hosted headless Chrome with a Puppeteer-compatible API.
- **GitHub API** — Source control and Actions, often used to deploy Apify Actor source.

## FAQ

### What authentication does the Apify API use?

The Apify API uses a bearer token sent in the Authorization header as 'Bearer <token>', with the token issued from the Integrations page in the Apify Console. A less-secure ?token= query parameter is also accepted. When called through Jentic, the token is held in your Jentic One instance and never exposed to the agent.

### Can I run an Actor synchronously and get its output in one call?

Yes. POST /v2/acts/{actorId}/run-sync waits up to 300 seconds and returns the run's output directly. For longer runs, call POST /v2/acts/{actorId}/runs and poll GET /v2/actor-runs/{runId} until status is SUCCEEDED, then fetch items from the default dataset.

### How do I fetch dataset items with the Apify API?

Call GET /v2/datasets/{datasetId}/items with optional offset, limit, and format query parameters. Format defaults to json but xlsx, csv, html, rss, and xml are supported. The defaultDatasetId for a run is returned in the run object.

### What are the rate limits for the Apify API?

The global limit is 250,000 requests per minute, counted per user for authenticated calls or per IP for anonymous calls. Per-resource limits are 30 requests per second by default, 100 for key-value store CRUD, and 200 for run-actor, push-items, and request-queue CRUD. Each response carries an X-RateLimit-Limit header.

### How do I run an Apify Actor through Jentic?

Search Jentic for 'run a web scraper', load the apify.com run-actor operation, and execute with the actorId and a JSON input. Jentic returns the run object; follow up with the get-dataset-items operation against the run's defaultDatasetId to retrieve results.

### Does the Apify API support webhooks for run completion?

Yes. POST /v2/webhooks to register a subscription with eventTypes such as ACTOR.RUN.SUCCEEDED, ACTOR.RUN.FAILED, and ACTOR.RUN.TIMED_OUT, plus a requestUrl for delivery. Apify retries failed deliveries with exponential backoff.

### Can I limit what my agent is allowed to do with the Apify API?

Yes. Because you run Jentic One yourself, your own rules decide which Apify operations and which stored token the agent may use. Apify carries the actor id and run id in the URL path (/acts/{actorId}/runs and /actor-runs/{runId}), so you can pin the agent to a single actor, letting it start and read runs for that actor and nothing else. Higher-impact operations such as creating schedules or registering webhooks stay off limits unless you explicitly grant them.
