Search + K

Command Palette

Search for a command to run...

Sign In

This actor-based API runs an Apify Instagram Reel scraper and returns either the run metadata, the dataset items produced by a run, or the key-value store OUTPUT value. There are three operations; pick the one whose return type matches what the user wants rather than assuming all runs return the same artifact.

How the domain is organized

  • An Actor (the Instagram reel scraper) executes a job called a run. A run produces runtime metadata (IDs, status) and output artifacts: a Dataset (items) and a Key-value store (arbitrary values, commonly a single OUTPUT key).
  • Each operation here starts the same Actor but returns different artifacts: either the run object (metadata), the dataset items, or the key-value OUTPUT value. The request body must conform to the Actor's InputSchema—that schema is where you find the acceptable input fields (target URL(s), limits, proxies, etc.).

Entry points — which operation to call first

Decide by what the user asked for:

  • If the user wants structured scraped records (JSON items): call run-sync-get-dataset-items-apify-instagram-reel-scraper. It waits for the run to finish and returns dataset items in the response body.
  • If the user specifically wants the Actor’s key-value store OUTPUT (some Actors place their primary result under a single key): call run-sync-apify-instagram-reel-scraper. It waits for completion and returns the OUTPUT value from the key-value store in the response body.
  • If the user wants to start a run and get run metadata (run id, status, references to dataset/key-value ids) so they can inspect or fetch outputs later: call runs-sync-apify-instagram-reel-scraper. It returns the run object (RunsResponseSchema) with IDs and status but does not return dataset items or the OUTPUT value itself.

Always supply a valid Apify token and a body that matches the Actor’s InputSchema. Inspect the InputSchema before calling to identify the fields you must provide (URLs, username, max items, proxy settings, etc.).

Common tasks and the correct operation

Scrape one or a few reels and return results to the user:

  • Use run-sync-get-dataset-items-apify-instagram-reel-scraper when the user expects JSON records. This is the simplest path: the operation runs the Actor to completion and returns the dataset items directly.

Scrape and return a single file-like output stored under OUTPUT:

  • Use run-sync-apify-instagram-reel-scraper. This returns the key-value store value the Actor wrote under the OUTPUT key.

Start a long-running scrape and return run identifiers (monitor later or fetch outputs separately):

  • Use runs-sync-apify-instagram-reel-scraper. The returned run object contains run id and references (datasetId / keyValueStoreId) you can use to retrieve outputs with the Apify dataset/key-value APIs (discover those operations when needed).

When users ask for "latest run status" or "run logs", start by returning the run object (runs-sync-...) so you have the run id and status fields to report or to use with follow-up calls.

Interpreting responses

  • Every response includes a status field and a body field. The meaning of body depends on the operation called:
    • run-sync-get-dataset-items-apify-instagram-reel-scraper: body contains dataset items (the scraped records). Inspect it as the primary result.
    • run-sync-apify-instagram-reel-scraper: body contains the key-value OUTPUT value (often the actor’s main artifact). Treat it as the primary result.
    • runs-sync-apify-instagram-reel-scraper: body conforms to RunsResponseSchema; find run id, status, and artifact IDs (datasetId, keyValueStoreId) there.

If you need further artifacts beyond what run-sync-* returned (for example, full dataset paging or other keys from the key-value store), use the run’s artifact IDs (from RunsResponseSchema) with the Apify dataset/key-value retrieval APIs.

Non-obvious patterns and gotchas

  • Name confusion: the difference between run-sync and runs-sync is about the return artifact, not whether the call is synchronous. All three here run the Actor; the run-sync-* variants wait for completion and return outputs, while runs-sync-* returns the run metadata (so you can fetch outputs later). Choose by desired output, not by name alone.

  • Two distinct output locations: the Actor can write results to a Dataset and/or to the Key-value store under OUTPUT. The two run-sync operations expose these separately. Do not assume one contains the other—inspect the response you called for.

  • Check InputSchema before calling: the body must include whatever target identifiers the Actor expects (URLs, usernames, or input lists). The schema also reveals optional limits or proxy/session options that affect success and result size.

  • Result size vs convenience: run-sync-get-dataset-items-* is convenient for small-to-moderate result sets because it returns items directly. For large datasets prefer getting the run metadata first (runs-sync-*) and then use dataset-specific APIs to stream or page results—those dataset APIs are not part of these three operations and must be invoked separately.

  • Credentials matter: every operation requires a valid Apify token with the scopes needed to start the Actor and access its artifacts. If outputs are missing, verify the token has read access to dataset/key-value artifacts for the run.

  • status in the response is the immediate indicator of success or failure at the API level; RunsResponseSchema also contains the run’s lifecycle status (running, succeeded, failed). When you need a run id for follow-up, extract it from the RunsResponseSchema returned by runs-sync-*.

Practical checklist for a user request

  1. Decide what the user wants: dataset records, key-value OUTPUT, or only run metadata.
  2. Inspect the Actor’s InputSchema to fill required fields for body (target URLs, limits, proxies).
  3. Provide a valid token and call the matching operation:
    • dataset items → run-sync-get-dataset-items-apify-instagram-reel-scraper
    • key-value OUTPUT → run-sync-apify-instagram-reel-scraper
    • run metadata → runs-sync-apify-instagram-reel-scraper
  4. Examine status and the body returned to extract results or IDs for follow-up.
  5. If you need more data than returned, use the run’s datasetId/keyValueStoreId (from the run object) with the Apify dataset or key-value APIs to fetch the full artifact.

Following these patterns ensures you call the operation that returns the artifact the user expects and gives you the IDs you need when you must fetch outputs with other Apify endpoints.