The actor set here runs the Apify Threads profile scraper and exposes three ways to start runs and retrieve results. Two operations execute the actor and wait for completion, returning the actor’s outputs directly; the third starts a run and returns the run metadata (IDs and locations) so you can inspect outputs later. Always provide an Apify token and the actor body input exactly as the actor expects.
Key entities and how they relate
- Run: an execution of the actor. A run may produce a Dataset and/or write objects into a Key-Value Store. The run response (the
RunsResponseSchema) contains identifiers and locations for those outputs when available. - Dataset: an ordered collection of items produced by the actor. Use it when the actor writes multiple records (rows/objects) as the primary result.
- Key-Value Store (KVS): a simple store for named values. The actor used here writes a single final payload under the
OUTPUTkey; use the KVS-based operation when you expect a single aggregated result.
These three operations map directly to those entities:
run-sync-apify-threads-profile-api-scraper— runs the actor, waits for completion, and returns the KVSOUTPUTvalue inbody.run-sync-get-dataset-items-apify-threads-profile-api-scraper— runs the actor, waits for completion, and returns the actor’s dataset items inbody.runs-sync-apify-threads-profile-api-scraper— starts a run and returns the run metadata (IDs, storage links) inbodyasRunsResponseSchema.
Entry points — what to call first
Decide whether you need immediate data or just run metadata:
-
If the user explicitly wants the scraped data immediately and the actor writes results into the Key-Value Store under
OUTPUT, callrun-sync-apify-threads-profile-api-scraper. It waits for the run to complete and returns theOUTPUTvalue in the responsebody. -
If the user expects multiple items/rows (an array of records), call
run-sync-get-dataset-items-apify-threads-profile-api-scraperto receive the actor’s dataset items in the responsebodywhen the run completes. -
If the user only needs the run ID, storage IDs, or wants to inspect where outputs will land (for example to fetch logs or datasets later), call
runs-sync-apify-threads-profile-api-scraper. The returnedRunsResponseSchemacontains the run identifier and pointers to Dataset/KVS, which tell you whether you should follow up with a dataset or KVS retrieval.
Always include the actor input in body. Inspect the operation’s input schema (the operation signature) to see which input fields the actor requires (actor identifier, start URLs, limits, credentials, etc.).
Common tasks and step-by-step choices
-
Return a single aggregated profile result to a user now:
- Use
run-sync-apify-threads-profile-api-scraper. The responsebodywill be the KVSOUTPUTpayload if the actor produced it.
- Use
-
Return multiple profile records (rows) to a user now:
- Use
run-sync-get-dataset-items-apify-threads-profile-api-scraper. The responsebodywill contain dataset items returned by the actor at completion.
- Use
-
Start a run and report identifiers or let another process fetch results later:
- Use
runs-sync-apify-threads-profile-api-scraper. Inspect the returnedRunsResponseSchemainbodyto find dataset IDs or KVS locations.
- Use
-
Decide whether to call a dataset vs KVS operation when uncertain:
- If unsure how the actor writes outputs, call
runs-sync-apify-threads-profile-api-scraperfirst to get the run metadata. Use the dataset or KVS follow-up that the run metadata indicates, or choose the sync operation that returns the desired output directly.
- If unsure how the actor writes outputs, call
Response semantics — what to look for in results
-
All three responses include a top-level
statusstring and abody:- For the two sync-run operations,
bodyholds the actor-produced payload (KVSOUTPUTor dataset items) when the run completes. - For
runs-sync-apify-threads-profile-api-scraper,bodyis aRunsResponseSchemacontaining the run ID and storage references (dataset ID, KVS IDs) when available.
- For the two sync-run operations,
-
If
bodyis empty or not the expected shape, check the run metadata from theruns-syncoperation to see whether the actor produced a dataset or wrote to KVS and whether any error logs are present. The run metadata is the authoritative source for where outputs live.
Gotchas and non-obvious behavior
-
Token is always required: every call requires the Apify
tokenparameter. Provide the correct token with appropriate permissions for the actor and storage. -
Two flavors of "sync" behavior:
- The two operations whose names begin with
run-syncwait for the actor to finish and return outputs inline. Use them when users want data immediately in the response. - The
runs-syncoperation returns run metadata (including run ID and storage links). Use it when you only need the run identifier or want to inspect where outputs went before fetching them.
- The two operations whose names begin with
-
The actor may write either to Dataset, to the Key-Value Store
OUTPUT, or to both. Don’t assume which one is used—inspect run metadata when in doubt or use the appropriate sync operation based on the expected output shape. -
Large outputs and run duration: since the two
run-syncoperations wait for completion, they can take as long as the actor needs to scrape and produce results. If a run typically takes long, prefer starting the run and returning the run metadata (viaruns-sync) so the caller can retrieve results later. -
Empty results can be valid: an empty dataset or missing
OUTPUTmay mean the actor ran successfully but found no data. Confirm by checking run metadata for logs or error indicators. -
Input must match the actor’s expected schema: supply the actor’s required input fields in
bodyexactly as specified by the operation’s input schema. Missing or malformed inputs will cause the run to fail or produce no data.
Quick decision checklist
- Need immediate, single aggregated payload ->
run-sync-apify-threads-profile-api-scraper. - Need immediate array of items ->
run-sync-get-dataset-items-apify-threads-profile-api-scraper. - Need run ID, storage IDs, or want to delay fetching outputs ->
runs-sync-apify-threads-profile-api-scraper.
Use the run metadata in RunsResponseSchema to confirm where outputs are stored before choosing dataset vs key-value retrieval. Provide the correct token and the actor input body as required by the operation signature.