VOOZH about

URL: https://docs.apify.com/api

⇱ Apify Documentation


Skip to main content

REST API

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.

cURL
# 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'

API clients

The client libraries are a more convenient way to interact with the Apify platform than the HTTP REST API.

JavaScript API client

For web browser, JavaScript/TypeScript applications, Node.js, Deno, or Bun.Star
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();

Related articles

Web scraping with client-side Vanilla JavaScript
Read more
Apify ❀️ Python, so we’re releasing a Python API client
Read more
API for dummies
Read more