GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Get started
  • Get started
  • Actors
  • Storage
  • Proxy
  • Account
  • Integrations
  • Security
  • Academy
  • API
  • API reference
  • Client for JavaScript
  • Client for Python
  • Client for Go

This view

  • Original page
  • New address

GeezerVison is showing docs.apify.com — 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.

View API reference
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
Get startedView reference
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 { defaultDatasetId } = await client.actor('john-doe/my-cool-actor').call();

// Fetches results from the actor's dataset.
const { items } = await client.dataset(defaultDatasetId).listItems();

Experimental API clients

Clients for other languages are official Apify projects, but they are experimental: they are generated automatically from the OpenAPI schema. Review the code before you rely on them in production, and report issues on their repositories.
Go
PHP
Java
.NET
Rust

Go API client

Client for Go 1.23 or newer, built almost entirely on the standard library.
Get startedView reference
go get github.com/apify/apify-client-go
package main

import (
"context"
"fmt"
"log"

apify "github.com/apify/apify-client-go"
)

func main() {
client := apify.NewClient(apify.WithToken("MY-APIFY-TOKEN"))
ctx := context.Background()

// Starts an Actor and waits for it to finish.
run, err := client.Actor("john-doe/my-cool-actor").Call(ctx, nil, apify.ActorStartOptions{}, nil)
if err != nil {
log.Fatal(err)
}

// Fetches results from the Actor's dataset.
page, err := client.Dataset(run.DefaultDatasetID).ListItems(ctx, apify.DatasetListItemsOptions{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Got %d items\n", page.Total)
}

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
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.