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
OUTPUTkey). - Each operation here starts the same Actor but returns different artifacts: either the run object (metadata), the dataset items, or the key-value
OUTPUTvalue. The request body must conform to the Actor'sInputSchema—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): callrun-sync-apify-instagram-reel-scraper. It waits for completion and returns theOUTPUTvalue 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-scraperwhen 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 theOUTPUTkey.
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
statusfield and abodyfield. The meaning ofbodydepends on the operation called:run-sync-get-dataset-items-apify-instagram-reel-scraper:bodycontains dataset items (the scraped records). Inspect it as the primary result.run-sync-apify-instagram-reel-scraper:bodycontains the key-valueOUTPUTvalue (often the actor’s main artifact). Treat it as the primary result.runs-sync-apify-instagram-reel-scraper:bodyconforms toRunsResponseSchema; 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-syncandruns-syncis about the return artifact, not whether the call is synchronous. All three here run the Actor; therun-sync-*variants wait for completion and return outputs, whileruns-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 tworun-syncoperations expose these separately. Do not assume one contains the other—inspect the response you called for. -
Check
InputSchemabefore 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
tokenwith 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. -
statusin the response is the immediate indicator of success or failure at the API level;RunsResponseSchemaalso contains the run’s lifecycle status (running, succeeded, failed). When you need a run id for follow-up, extract it from theRunsResponseSchemareturned byruns-sync-*.
Practical checklist for a user request
- Decide what the user wants: dataset records, key-value
OUTPUT, or only run metadata. - Inspect the Actor’s
InputSchemato fill required fields forbody(target URLs, limits, proxies). - Provide a valid
tokenand 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
- dataset items →
- Examine
statusand thebodyreturned to extract results or IDs for follow-up. - 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.