Constructor
| Parameter | Type | Required | Default |
|---|---|---|---|
apiKey | string | Yes | — |
baseUrl | string | No | https://api.socialrouter.io |
Extraction (URL-driven)
extract(options)
Start an extraction. Returns immediately with the result (most extractions are synchronous).
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | one of url/urls | Single social media URL. |
urls | string[] | one of url/urls | Batch list of URLs. Only effective for batch-capable actors — see the providers page. |
provider | string | Yes | Service slug <provider>/<platform>/<type>[:<tag>] (e.g. apify/linkedin/profile.info or apify/linkedin/profile.posts:apimaestro). |
limit | number | No | Max records to return (default 100, capped at 250). |
fallback | boolean | No | Whether to walk the provider chain on failure (default true). Set to false to surface the requested provider’s error directly. |
Extraction object:
getExtraction(id)
Retrieve an extraction or search by ID. Useful for polling async results.
extractAndWait(options, pollIntervalMs?, timeoutMs?)
Convenience method that calls extract() then polls getExtraction() until the status is no longer pending.
Error if the extraction doesn’t complete within the timeout.
Batch URLs
Disable fallback
Search (query-driven)
Companion toextract() for services where the input is a search term rather than a URL — currently place.search on Google Maps.
search(options)
| Parameter | Type | Required | Description |
|---|---|---|---|
queries | string[] | Yes | Non-empty list of search queries (terms or context-pinning URLs). |
provider | string | Yes | Slug <provider>/<platform>/<type>[:<tag>] whose type is a search type (e.g. apify/googlemaps/place.search). |
limit | number | No | Per-query record cap (default 100, capped at 1000). |
fallback | boolean | No | Whether to walk the provider chain on failure (default true). |
Extraction shape as extract() — distinguish via kind === "search". The original queries array is echoed back on the response.
searchAndWait(options, pollIntervalMs?, timeoutMs?)
Same polling helper as extractAndWait, but for searches.