Search + K

Command Palette

Search for a command to run...

Sign In

These operations run an Apify Playwright actor and return results synchronously. Choose the operation based on the kind of output you need: the Key-value store output, dataset items, or only the run metadata. All three require an Apify token in the token parameter and a body payload that specifies which actor and what input to run.

How the domain is organized

The API centers on three related concepts: an Actor (the Playwright scraper you run), a Run (an execution of that actor), and the outputs that a run produces (Key-value store records and/or dataset items). The three operations map directly to these concerns:

  • runs-sync-apify-playwright-scraper starts a run and returns the run record (metadata about the initiated run). The run record is what clients use to reference the execution (run id, status, timestamps, etc.).
  • run-sync-apify-playwright-scraper starts a run, waits until it completes, and returns the actor's Key-value store OUTPUT in the response body.
  • run-sync-get-dataset-items-apify-playwright-scraper starts a run, waits until it completes, and returns the run's dataset items in the response body.

Treat the run record as the canonical identifier for follow-up work. If you need to fetch logs, status, or outputs later (or from other endpoints not exposed here), the run record contains the run id and resource links you will need.

Entry points — which operation to call first

Decide by the output you must deliver to the user:

  • If the user asked for the dataset items produced by the run, call run-sync-get-dataset-items-apify-playwright-scraper with token and the appropriate body describing the actor and input. The response body contains the dataset items (inspect it to see its shape).

  • If the user asked for the Key-value store output (for example, a single JSON or HTML blob the actor writes under a known key), call run-sync-apify-playwright-scraper. The response body contains the Key-value OUTPUT returned by the actor.

  • If the user only needs the run id, status, or metadata (for example, to display run details or to use another system to poll outputs), call runs-sync-apify-playwright-scraper. The response follows RunsResponseSchema and includes identifiers and status fields.

Always inspect the body type for required fields before calling. The body payload typically contains the actor identifier and the input to send to the actor; required field names vary, so verify what the body expects for this integration.

Common user requests and how to accomplish them

  1. "Run this Playwright scraper with X input and return the scraped items to me"
  • Use run-sync-get-dataset-items-apify-playwright-scraper. Provide your token and a body that names the actor and supplies the input object. When the call returns, check status and then read body for the items.
  1. "Run the actor and give me the OUTPUT file it writes"
  • Use run-sync-apify-playwright-scraper. Supply token and body. The call waits for the actor to finish and returns the Key-value OUTPUT in body.
  1. "Start the actor but I only need the run id and status"
  • Use runs-sync-apify-playwright-scraper. It returns the run record immediately after starting and contains the run id and status fields for later reference.
  1. "Run the actor, but I expect a long execution or a very large dataset"
  • Start with runs-sync-apify-playwright-scraper if you want a quick confirmation and a run id. If you must receive the data synchronously, use the dataset or Key-value sync endpoints knowing they wait for completion; if the run is very long or produces large payloads, prefer retrieving outputs asynchronously (via run id) using dataset/Key-value retrieval endpoints available elsewhere in the platform.

Response patterns to rely on

  • Every response includes a status field and a body field. Use status to determine whether the run succeeded, failed, or was cancelled, then inspect body for the returned payload or error details.

  • The runs-sync-apify-playwright-scraper response follows RunsResponseSchema; expect run identifiers, timestamps, and status values there. The other two synchronous run endpoints return body that contains the actor's outputs (Key-value or dataset items). The exact shape of body depends on the actor and the body payload you sent—inspect the returned body rather than assuming a shape.

  • If you need a run id for downstream actions, look for it in the runs-sync response or inside the body of the sync run responses; run ids are included in the run metadata returned when available.

Gotchas and practical tips

  • Supply the Apify token in the token parameter, not inside the body. A missing or insufficiently privileged token will produce authorization errors.

  • The three operations are synchronous wrappers: they wait for the actor run to complete before returning. For long-running actors or very large outputs, synchronous calls may be slow or hit platform timeouts—when in doubt, use the run-metadata operation (runs-sync-apify-playwright-scraper) to get a run id and then fetch outputs asynchronously via the platform's dataset or Key-value APIs.

  • body schemas vary. Always inspect the request body type to find the required actor identifier and input fields (actor reference, input object, optional execution options like build or memory). Do not assume field names.

  • Responses may include partial or platform-formatted error messages inside body when a run fails. A non-success status indicates failure; inspect body for log snippets or error details.

  • Dataset items can be large or numerous. If you receive an unexpectedly large body, consider switching to an asynchronous retrieval strategy (use the run id and a dataset-fetching endpoint elsewhere on the platform) rather than requesting the entire dataset synchronously.

  • Access and permissions matter: the token must have rights to start the actor and read its outputs. If outputs are stored under an account or dataset the token cannot access, the call will fail even if the run itself starts.

Quick pre-call checklist

Before calling any of the sync run operations, confirm:

  • The correct operation for the required output (run-sync-get-dataset-items for dataset items, run-sync-apify-playwright-scraper for Key-value OUTPUT, runs-sync-apify-playwright-scraper for run metadata).
  • A valid Apify token with the necessary permissions.
  • The body payload matches the expected schema: it names the actor and provides the actor input and any optional execution parameters you need.
  • You understand whether you require synchronous delivery (wait-for-completion) or prefer to use the run id for asynchronous retrieval later.

Following these patterns will let you reliably start Playwright scraper runs and obtain the outputs users commonly request: dataset rows, Key-value store objects, or run metadata for tracking.