Skip to main content

Apify API documentation

Learn how to use the Apify platform programmatically.

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'

OpenAPI schema

You can download the complete OpenAPI schema of the Apify API in the YAML or JSON formats. The source code is also available on GitHub.

API clients

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

JavaScript API client

For web browser, JavaScript/TypeScript applications, Node.js, Deno, or Bun.Star
npm install 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 = new ApifyClient({
token: 'MY-APIFY-TOKEN',
});

// Starts an actor and waits for it to finish.
const