![]() |
VOOZH | about |
The Apify API is built around HTTP REST, uses predictable resource-oriented URLs, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
# Prepare Actor input and run it synchronously
echo'{ "searchStringsArray": ["Apify"] }'|
curl-X POST -d @- \
-H'Content-Type: application/json'\
-H'Authorization: Bearer <YOUR_API_TOKEN>'\
-L'https://api.apify.com/v2/actors/compass~crawler-google-places/run-sync-get-dataset-items'
npminstall apify-client
// Easily run Actors, await them to finish using the convenient .call() method, and retrieve results from the resulting dataset.
const{ApifyClient}=require('apify-client');
const client =newApifyClient({
token:'MY-APIFY-TOKEN',
});
// Starts an actor and waits for it to finish.
const{ defaultDatasetId }=await client.actor('john-doe/my-cool-actor').call();
// Fetches results from the actor's dataset.
const{ items }=await client.dataset(defaultDatasetId).listItems();