Apify API
Download OpenAPI specification:Download
UPDATE 2025-01-14: We have rolled out this new Apify API Documentation. In case of any issues, please report here. The old API Documentation is still available here.
The Apify API (version 2) provides programmatic access to the Apify platform. The API is organized around RESTful HTTP endpoints.
You can download the complete OpenAPI schema of Apify API in the YAML or JSON formats. The source code is also available on GitHub.
All requests and responses (including errors) are encoded in JSON format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference.
To access the API using Node.js, we recommend the
apify-client
NPM
package.
To access the API using Python, we recommend the
apify-client
PyPI
package.
The clients' functions correspond to the API endpoints and have the same
parameters. This simplifies development of apps that depend on the Apify
platform.
Note: All requests with JSON payloads need to specify the Content-Type: application/json
HTTP header!
All API endpoints support the method
query parameter that can override the
HTTP method.
For example, if you want to call a POST endpoint using a GET request, simply
add the query parameter method=POST
to the URL and send the GET request.
This feature is especially useful if you want to call Apify API endpoints
from services that can only send GET requests.
You can find your API token on the Integrations page in the Apify Console.
To use your token in a request, either:
- Add the token to your request's
Authorization
header asBearer <token>
. E.g.,Authorization: Bearer xxxxxxx
. More info. (Recommended). - Add it as the
token
parameter to your request URL. (Less secure).
Using your token in the request header is more secure than using it as a URL parameter because URLs are often stored in browser history and server logs. This creates a chance for someone unauthorized to access your API token.
Do not share your API token or password with untrusted parties.
For more information, see our integrations documentation.
To run an Actor, send a POST request to the Run
Actor endpoint using either the
Actor ID code (e.g. vKg4IjxZbEYTYeW8T
) or its name (e.g.
janedoe~my-actor
):
https://api.apify.com/v2/acts/[actor_id]/runs
If the Actor is not runnable anonymously, you will receive a 401 or 403
response code.
This means you need to add your secret API
token to the request's
Authorization
header (recommended) or as a
URL query parameter ?token=[your_token]
(less secure).
Optionally, you can include the query parameters described in the Run Actor section to customize your run.
If you're using Node.js, the best way to run an Actor is using the
Apify.call()
method from the Apify
SDK. It
runs the Actor using the account you are currently logged into (determined
by the secret API token).
The result is an Actor run
object and its output (if
any).
A typical workflow is as follows:
- Run an Actor or task using the Run Actor or Run task API endpoints.
- Monitor the Actor run by periodically polling its progress using the Get run API endpoint.
- Fetch the results from the Get
items API endpoint using the
defaultDatasetId
, which you receive in the Run request response. Additional data may be stored in a key-value store. You can fetch them from the Get record API endpoint using thedefaultKeyValueStoreId
and the store'skey
.
Note: Instead of periodic polling, you can also run your Actor or task synchronously. This will ensure that the request waits for 300 seconds (5 minutes) for the run to finish and returns its output. If the run takes longer, the request will time out and throw an error.
Most API endpoints return a JSON object with the data
property:
{
"data": {
...
}
}
However, there are a few explicitly described exceptions, such as
Dataset Get items or
Key-value store Get record
API endpoints, which return data in other formats.
In case of an error, the response has the HTTP status code in the range of
4xx or 5xx and the data
property is replaced with error
. For example:
{
"error": {
"type": "record-not-found",
"message": "Store was not found."
}
}
See Errors for more details.
All API endpoints that return a list of records (e.g. Get list of Actors) enforce pagination in order to limit the size of their responses.
Most of these API endpoints are paginated using the offset
and limit
query parameters.
The only exception is Get list of
keys,
which is paginated using the exclusiveStartKey
query parameter.
IMPORTANT: Each API endpoint that supports pagination enforces a certain
maximum value for the limit
parameter,
in order to reduce the load on Apify servers.
The maximum limit could change in future so you should never
rely on a specific value and check the responses of these API endpoints.
Using offset
Most API endpoints that return a list of records enable pagination using the following query parameters:
limit |
Limits the response to contain a specific maximum number of items, e.g. limit=20 . |
offset |
Skips a number of items from the beginning of the list, e.g. offset=100 . |
desc |
By default, items are sorted in the order in which they were created or added to the list.
This feature is useful when fetching all the items, because it ensures that items
created after the client started the pagination will not be skipped.
If you specify the desc=1 parameter, the items will be returned in the reverse order,
i.e. from the newest to the oldest items.
|
The response of these API endpoints is always a JSON object with the following structure:
{
"data": {
"total": 2560,
"offset": 250,
"limit": 1000,
"count": 1000,
"desc": false,
"items": [
{ 1st object },
{ 2nd object },
...
{ 1000th object }
]
}
}
The following table describes the meaning of the response properties:
Property | Description |
---|---|
total |
The total number of items available in the list. |
offset |
The number of items that were skipped at the start.
This is equal to the offset query parameter if it was provided, otherwise it is 0 . |
limit |
The maximum number of items that can be returned in the HTTP response.
It equals to the limit query parameter if it was provided or
the maximum limit enforced for the particular API endpoint, whichever is smaller. |
count |
The actual number of items returned in the HTTP response. |
desc |
true if data were requested in descending order and false otherwise. |
items |
An array of requested items. |
Using key
The records in the key-value store are not ordered based on numerical indexes, but rather by their keys in the UTF-8 binary order. Therefore the Get list of keys API endpoint only supports pagination using the following query parameters:
limit |
Limits the response to contain a specific maximum number items, e.g. limit=20 . |
exclusiveStartKey |
Skips all records with keys up to the given key including the given key, in the UTF-8 binary order. |
The response of the API endpoint is always a JSON object with following structure:
{
"data": {
"limit": 1000,
"isTruncated": true,
"exclusiveStartKey": "my-key",
"nextExclusiveStartKey": "some-other-key",
"items": [
{ 1st object },
{ 2nd object },
...
{ 1000th object }
]
}
}
The following table describes the meaning of the response properties:
Property | Description |
---|---|
limit |
The maximum number of items that can be returned in the HTTP response.
It equals to the limit query parameter if it was provided or
the maximum limit enforced for the particular endpoint, whichever is smaller. |
isTruncated |
true if there are more items left to be queried. Otherwise false . |
exclusiveStartKey |
The last key that was skipped at the start. Is `null` for the first page. |
nextExclusiveStartKey |
The value for the exclusiveStartKey parameter to query the next page of items. |
The Apify API uses common HTTP status codes: 2xx
range for success, 4xx
range for errors caused by the caller
(invalid requests) and 5xx
range for server errors (these are rare).
Each error response contains a JSON object defining the error
property,
which is an object with
the type
and message
properties that contain the error code and a
human-readable error description, respectively.
For example:
{
"error": {
"type": "record-not-found",
"message": "Store was not found."
}
}
Here is the table of the most common errors that can occur for many API endpoints:
status | type | message |
---|---|---|
400 |
invalid-request |
POST data must be a JSON object |
400 |
invalid-value |
Invalid value provided: Comments required |
400 |
invalid-record-key |
Record key contains invalid character |
401 |
token-not-provided |
Authentication token was not provided |
404 |
record-not-found |
Store was not found |
429 |
rate-limit-exceeded |
You have exceeded the rate limit of 30 requests per second |
405 |
method-not-allowed |
This API endpoint can only be accessed using the following HTTP methods: OPTIONS, POST |
All API endpoints limit the rate of requests in order to prevent overloading of Apify servers by misbehaving clients.
There are two kinds of rate limits - a global rate limit and a per-resource rate limit.
Global rate limit
The global rate limit is set to 250 000 requests per minute. For authenticated requests, it is counted per user, and for unauthenticated requests, it is counted per IP address.
Per-resource rate limit
The default per-resource rate limit is 30 requests per second per resource, which in this context means a single Actor, a single Actor run, a single dataset, single key-value store etc.
The default rate limit is applied to every API endpoint except a few select ones, which have higher rate limits.
Each API endpoint returns its rate limit in X-RateLimit-Limit
header.
These endpoints have a rate limit of 100 requests per second per resource:
These endpoints have a rate limit of 200 requests per second per resource:
- Run Actor
- Run Actor task asynchronously
- Run Actor task synchronously
- Metamorph Actor run
- Push items to dataset
- CRUD (add, get, update, delete) operations on requests in request queues
Rate limit exceeded errors
If the client is sending too many requests, the API endpoints respond with the HTTP status code 429 Too Many Requests
and the following body:
{
"error": {
"type": "rate-limit-exceeded",
"message": "You have exceeded the rate limit of ... requests per second"
}
}
Retrying rate-limited requests with exponential backoff
If the client receives the rate limit error, it should wait a certain period of time and then retry the request. If the error happens again, the client should double the wait period and retry the request, and so on. This algorithm is known as exponential backoff and it can be described using the following pseudo-code:
- Define a variable
DELAY=500
- Send the HTTP request to the API endpoint
- If the response has status code not equal to
429
then you are done. Otherwise:- Wait for a period of time chosen randomly from the interval
DELAY
to2*DELAY
milliseconds - Double the future wait period by setting
DELAY = 2*DELAY
- Continue with step 2
- Wait for a period of time chosen randomly from the interval
If all requests sent by the client implement the above steps, the client will automatically use the maximum available bandwidth for its requests.
Note that the Apify API clients for JavaScript and for Python use the exponential backoff algorithm transparently, so that you do not need to worry about it.
There are three main ways to refer to a resource you're accessing via API.
- the resource ID (e.g.
iKkPcIgVvwmztduf8
) username~resourcename
- when using this access method, you will need to use your API token, and access will only work if you have the correct permissions.~resourcename
- for this, you need to use an API token, and theresourcename
refers to a resource in the API token owner's account.
The API endpoints in this section allow you to manage Apify Actors. For more details about Actors, refer to the Actor documentation.
For API endpoints that require the actorId
parameter to identify an Actor, you can provide either:
- The Actor ID (e.g.,
HG7ML7M8z78YcAPEB
), or - A tilde-separated combination of the Actor owner's username and the Actor name (e.g.,
janedoe~my-actor
).
Get list of Actors
ClientsGets the list of all Actors that the user created or used. The response is a
list of objects, where each object contains a basic information about a single Actor.
To only get Actors created by the user, add the my=1
query parameter.
The endpoint supports pagination using the limit
and offset
parameters
and it will not return more than 1000 records.
By default, the records are sorted by the createdAt
field in ascending
order, therefore you can use pagination to incrementally fetch all Actors while new
ones are still being created. To sort the records in descending order, use the desc=1
parameter.
Authorizations:
query Parameters
my | boolean Example: my=true If |
offset | number <double> Example: offset=10 Number of records that should be skipped at the start. The default value
is |
limit | number <double> Example: limit=99 Maximum number of records to return. The default value as well as the
maximum is |
desc | boolean Example: desc=true If |
Responses
Response Schema: application/json
required | object (PaginationResponse) | ||||||||||||
|
Request samples
- JS client
- Apify CLI
import { ApifyClient } from 'apify-client'; const apifyClient = new ApifyClient({ token: '<TOKEN>', }); const { items } = await apifyClient .actors() .list(); console.log(items);
Response samples
- 200
{- "data": {
- "total": 2,
- "count": 2,
- "offset": 0,
- "limit": 1000,
- "desc": false,
- "items": [
- {
- "id": "br9CKmk457",
- "createdAt": "2019-10-29T07:34:24.202Z",
- "modifiedAt": "2019-10-30T07:34:24.202Z",
- "name": "MyAct",
- "username": "janedoe"
}, - {
- "id": "ksiEKo23pz",
- "createdAt": "2019-11-30T07:34:24.202Z",
- "modifiedAt": "2019-12-12T07:34:24.202Z",
- "name": "MySecondAct",
- "username": "janedoe"
}
]
}
}
Create Actor
ClientsCreates a new Actor with settings specified in an Actor object passed as
JSON in the POST payload.
The response is the full Actor object as returned by the
Get Actor endpoint.
The HTTP request must have the Content-Type: application/json
HTTP header!
The Actor needs to define at least one version of the source code. For more information, see Version object.
If you want to make your Actor
public using isPublic: true
, you will need to provide the Actor's title
and the categories
under which that Actor will be classified in Apify Store. For this, it's
best to use the constants from our apify-shared-js
package.
Authorizations:
Request Body schema: application/jsonrequired
name | string or null |
description | string or null |
title | string or null |
isPublic | boolean or null |
seoTitle | string or null |
seoDescription | string or null |
restartOnError | boolean or null |
Array of objects or null (Version) | |
categories | Array of strings or null |
(any or null) or defaultRunOptions (object) |
Responses
Location | any |
Response Schema: application/json
required | object (Actor) | ||||||||||||||||||||||||||||||||||
|
Request samples
- Payload
- JS client
- Apify CLI
{- "name": "MyActor",
- "description": "My favourite Actor!",
- "title": "My Actor",
- "isPublic": false,
- "seoTitle": "My Actor",
- "seoDescription": "My Actor is the best",
- "restartOnError": false,
- "versions": [
- {
- "versionNumber": "0.0",
- "sourceType": "SOURCE_FILES",
- "envVars": [
- {
- "name": "SECRET_PASSWORD",
- "value": "MyTopSecretPassword123",
- "isSecret": true
}
], - "applyEnvVarsToBuild": false,
- "buildTag": "latest",
- "sourceFiles": [ ]
}
], - "categories": [ ],
- "defaultRunOptions": {
- "build": "latest",
- "timeoutSecs": 3600,
- "memoryMbytes": 2048
}
}
Response samples
- 201
{- "data": {
- "id": "zdc3Pyhyz3m8vjDeM",
- "userId": "wRsJZtadYvn4mBZmm",
- "name": "MyActor",
- "username": "jane35",
- "description": "My favourite Actor!",
- "restartOnError": false,
- "isPublic": false,
- "createdAt": "2019-07-08T11:27:57.401Z",
- "modifiedAt": "2019-07-08T14:01:05.546Z",
- "stats": {
- "totalBuilds": 9,
- "totalRuns": 16,
- "totalUsers": 6,
- "totalUsers7Days": 2,
- "totalUsers30Days": 6,
- "totalUsers90Days": 6,
- "totalMetamorphs": 2,
- "lastRunStartedAt": "2019-07-08T14:01:05.546Z"
}, - "versions": [
- {
- "versionNumber": "0.1",
- "envVars": null,
- "sourceType": "SOURCE_FILES",
- "applyEnvVarsToBuild": false,
- "buildTag": "latest",
- "sourceFiles": [ ]
}, - {
- "versionNumber": "0.2",
- "sourceType": "GIT_REPO",
- "envVars": null,
- "applyEnvVarsToBuild": false,
- "buildTag": "latest",
}, - {
- "versionNumber": "0.3",
- "sourceType": "TARBALL",
- "envVars": null,
- "applyEnvVarsToBuild": false,
- "buildTag": "latest",
}, - {
- "versionNumber": "0.4",
- "sourceType": "GITHUB_GIST",
- "envVars": null,
- "applyEnvVarsToBuild": false,
- "buildTag": "latest",
}
], - "defaultRunOptions": {
- "build": "latest",
- "timeoutSecs": 3600,
- "memoryMbytes": 2048
}, - "exampleRunInput": {
- "body": "{ \"helloWorld\": 123 }",
- "contentType": "application/json; charset=utf-8"
}, - "isDeprecated": false,
- "deploymentKey": "ssh-rsa AAAA ...",
- "title": "My Actor",
- "taggedBuilds": {
- "latest": {
- "buildId": "z2EryhbfhgSyqj6Hn",
- "buildNumber": "0.0.2",
- "finishedAt": "2019-06-10T11:15:49.286Z"
}
}
}
}
Get Actor
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
Responses
Response Schema: application/json
required | object (Actor) | ||||||||||||||||||||||||||||||||||
|
Request samples
- JS client
- Apify CLI
import { ApifyClient } from 'apify-client'; const apifyClient = new ApifyClient({ token: '<TOKEN>', }); const actor = await apifyClient .actor('<ACTOR ID>') .get(); console.log(actor);
Response samples
- 200
{- "data": {
- "id": "zdc3Pyhyz3m8vjDeM",
- "userId": "wRsJZtadYvn4mBZmm",
- "name": "MyActor",
- "username": "jane35",
- "description": "My favourite Actor!",
- "restartOnError": false,
- "isPublic": false,
- "createdAt": "2019-07-08T11:27:57.401Z",
- "modifiedAt": "2019-07-08T14:01:05.546Z",
- "stats": {
- "totalBuilds": 9,
- "totalRuns": 16,
- "totalUsers": 6,
- "totalUsers7Days": 2,
- "totalUsers30Days": 6,
- "totalUsers90Days": 6,
- "totalMetamorphs": 2,
- "lastRunStartedAt": "2019-07-08T14:01:05.546Z"
}, - "versions": [
- {
- "versionNumber": "0.1",
- "envVars": null,
- "sourceType": "SOURCE_FILES",
- "applyEnvVarsToBuild": false,
- "buildTag": "latest",
- "sourceFiles": [ ]
}, - {
- "versionNumber": "0.2",
- "sourceType": "GIT_REPO",
- "envVars": null,
- "applyEnvVarsToBuild": false,
- "buildTag": "latest",
}, - {
- "versionNumber": "0.3",
- "sourceType": "TARBALL",
- "envVars": null,
- "applyEnvVarsToBuild": false,
- "buildTag": "latest",
}, - {
- "versionNumber": "0.4",
- "sourceType": "GITHUB_GIST",
- "envVars": null,
- "applyEnvVarsToBuild": false,
- "buildTag": "latest",
}
], - "defaultRunOptions": {
- "build": "latest",
- "timeoutSecs": 3600,
- "memoryMbytes": 2048
}, - "exampleRunInput": {
- "body": "{ \"helloWorld\": 123 }",
- "contentType": "application/json; charset=utf-8"
}, - "isDeprecated": false,
- "deploymentKey": "ssh-rsa AAAA ...",
- "title": "My Actor",
- "taggedBuilds": {
- "latest": {
- "buildId": "z2EryhbfhgSyqj6Hn",
- "buildNumber": "0.0.2",
- "finishedAt": "2019-06-10T11:15:49.286Z"
}
}
}
}
Update Actor
ClientsUpdates settings of an Actor using values specified by an Actor object
passed as JSON in the POST payload.
If the object does not define a specific property, its value will not be
updated.
The response is the full Actor object as returned by the Get Actor endpoint.
The request needs to specify the Content-Type: application/json
HTTP header!
When providing your API authentication token, we recommend using the
request's Authorization
header, rather than the URL. (More
info).
If you want to make your Actor
public using isPublic: true
, you will need to provide the Actor's title
and the categories
under which that Actor will be classified in Apify Store. For this, it's
best to use the constants from our apify-shared-js
package.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
Request Body schema: application/jsonrequired
name required | string |
description | string or null |
isPublic required | boolean |
seoTitle | string or null |
seoDescription | string or null |
title | string or null |
restartOnError | boolean or null |
required | Array of objects (CreateOrUpdateEnvVarRequest) |
categories | Array of strings or null |
(any or null) or defaultRunOptions (object) |
Responses
Response Schema: application/json
required | object (Actor) | ||||||||||||||||||||||||||||||||||
|
Request samples
- Payload
{- "name": "MyActor",
- "description": "My favourite Actor!",
- "isPublic": false,
- "seoTitle": "My Actor",
- "seoDescription": "My Actor is the best",
- "title": "My Actor",
- "restartOnError": false,
- "versions": [
- {
- "versionNumber": "0.0",
- "sourceType": "SOURCE_FILES",
- "envVars": [
- {
- "name": "SECRET_PASSWORD",
- "value": "MyTopSecretPassword123",
- "isSecret": true
}
], - "applyEnvVarsToBuild": false,
- "buildTag": "latest",
- "sourceFiles": [ ]
}
], - "categories": [ ],
- "defaultRunOptions": {
- "build": "latest",
- "timeoutSecs": 3600,
- "memoryMbytes": 2048
}
}
Response samples
- 200
{- "data": {
- "id": "zdc3Pyhyz3m8vjDeM",
- "userId": "wRsJZtadYvn4mBZmm",
- "name": "MyActor",
- "username": "jane35",
- "description": "My favourite Actor!",
- "restartOnError": false,
- "isPublic": false,
- "createdAt": "2019-07-08T11:27:57.401Z",
- "modifiedAt": "2019-07-08T14:01:05.546Z",
- "stats": {
- "totalBuilds": 9,
- "totalRuns": 16,
- "totalUsers": 6,
- "totalUsers7Days": 2,
- "totalUsers30Days": 6,
- "totalUsers90Days": 6,
- "totalMetamorphs": 2,
- "lastRunStartedAt": "2019-07-08T14:01:05.546Z"
}, - "versions": [
- {
- "versionNumber": "0.1",
- "envVars": null,
- "sourceType": "SOURCE_FILES",
- "applyEnvVarsToBuild": false,
- "buildTag": "latest",
- "sourceFiles": [ ]
}, - {
- "versionNumber": "0.2",
- "sourceType": "GIT_REPO",
- "envVars": null,
- "applyEnvVarsToBuild": false,
- "buildTag": "latest",
}, - {
- "versionNumber": "0.3",
- "sourceType": "TARBALL",
- "envVars": null,
- "applyEnvVarsToBuild": false,
- "buildTag": "latest",
}, - {
- "versionNumber": "0.4",
- "sourceType": "GITHUB_GIST",
- "envVars": null,
- "applyEnvVarsToBuild": false,
- "buildTag": "latest",
}
], - "defaultRunOptions": {
- "build": "latest",
- "timeoutSecs": 3600,
- "memoryMbytes": 2048
}, - "exampleRunInput": {
- "body": "{ \"helloWorld\": 123 }",
- "contentType": "application/json; charset=utf-8"
}, - "isDeprecated": false,
- "deploymentKey": "ssh-rsa AAAA ...",
- "title": "My Actor",
- "taggedBuilds": {
- "latest": {
- "buildId": "z2EryhbfhgSyqj6Hn",
- "buildNumber": "0.0.2",
- "finishedAt": "2019-06-10T11:15:49.286Z"
}
}
}
}
Delete Actor
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
Responses
Response Schema: application/json
Request samples
- JS client
- Apify CLI
import { ApifyClient } from 'apify-client'; const apifyClient = new ApifyClient({ token: '<TOKEN>', }); await apifyClient.actor('<ACTOR ID>').delete();
Response samples
- 204
{ }
The API endpoints in this section allow you to manage your Apify Actors versions.
- The version object contains the source code of a specific version of an Actor.
- The
sourceType
property indicates where the source code is hosted, and based on its value the Version object has the following additional property:
Value | Description |
---|---|
"SOURCE_FILES" |
Source code is comprised of multiple files specified in the sourceFiles array. Each item of the array is an object with the following fields:- name : File path and name- format : Format of the content, can be either "TEXT" or "BASE64" - content : File contentSource files can be shown and edited in the Apify Console's Web IDE. |
"GIT_REPO" |
Source code is cloned from a Git repository, whose URL is specified in the gitRepoUrl field. |
"TARBALL" |
Source code is downloaded using a tarball or Zip file from a URL specified in the tarballUrl field. |
"GITHUB_GIST" |
Source code is taken from a GitHub Gist, whose URL is specified in the gitHubGistUrl field. |
For more information about source code and Actor versions, check out Source code in Actors documentation.
Get list of versions
ClientsGets the list of versions of a specific Actor. The response is a JSON object
with the list of Version objects, where each
contains basic information about a single version.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
Responses
Response Schema: application/json
required | object | ||||
|
Response samples
- 200
{- "data": {
- "total": 5,
- "items": [
- {
- "versionNumber": "0.1",
- "envVars": null,
- "sourceType": "SOURCE_FILES",
- "applyEnvVarsToBuild": false,
- "buildTag": "latest",
- "sourceFiles": [ ]
}, - {
- "versionNumber": "0.2",
- "sourceType": "GIT_REPO",
- "envVars": null,
- "applyEnvVarsToBuild": false,
- "buildTag": "latest",
}, - {
- "versionNumber": "0.3",
- "sourceType": "TARBALL",
- "envVars": null,
- "applyEnvVarsToBuild": false,
- "buildTag": "latest",
}, - {
- "versionNumber": "0.4",
- "sourceType": "GITHUB_GIST",
- "envVars": null,
- "applyEnvVarsToBuild": false,
- "buildTag": "latest",
}
]
}
}
Create version
ClientsCreates a version of an Actor using values specified in a Version
object passed as JSON in the POST
payload.
The request must specify versionNumber
and sourceType
parameters (as
strings) in the JSON payload and a Content-Type: application/json
HTTP
header.
Each sourceType
requires its own additional properties to be passed to the
JSON payload object. These are outlined in the Version
object table below and in more detail in
the Apify
documentation.
For example, if an Actor's source code is stored in a GitHub
repository,
you will set the sourceType
to GIT_REPO
and pass the repository's URL in
the gitRepoUrl
property.
{
"versionNumber": "0.1",
"sourceType": "GIT_REPO",
"gitRepoUrl": "https://github.com/my-github-account/actor-repo"
}
The response is the Version object as returned by the Get version endpoint.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
Request Body schema: application/jsonrequired
versionNumber | string or null |
(any or null) or VersionSourceType (string) | |
Array of objects or null (EnvVar) | |
applyEnvVarsToBuild | boolean or null |
buildTag | string or null |
Array of SourceCodeFile (object) or SourceCodeFolder (object) (VersionSourceFiles) |
Responses
Location | any |
Response Schema: application/json
required | object (Version) | ||||||||||||
|
Request samples
- Payload
{- "versionNumber": "0.1",
- "sourceType": "GIT_REPO",
}
Response samples
- 201
{- "data": {
- "versionNumber": "0.0",
- "sourceType": { },
- "envVars": [
- {
- "name": "MY_ENV_VAR",
- "value": "my-value",
- "isSecret": false
}
], - "applyEnvVarsToBuild": false,
- "buildTag": "latest",
- "sourceFiles": [
- {
- "format": "TEXT",
- "content": "console.log('This is the main.js file');",
- "name": "src/main.js"
}
]
}
}
Get version
ClientsGets a Version object that contains all the details about a specific version of an Actor.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
versionNumber required | string Example: 1.0 Actor major and minor version of the Actor. |
Responses
Response Schema: application/json
required | object (Version) | ||||||||||||
|
Response samples
- 200
{- "data": {
- "versionNumber": "0.0",
- "sourceType": { },
- "envVars": [
- {
- "name": "MY_ENV_VAR",
- "value": "my-value",
- "isSecret": false
}
], - "applyEnvVarsToBuild": false,
- "buildTag": "latest",
- "sourceFiles": [
- {
- "format": "TEXT",
- "content": "console.log('This is the main.js file');",
- "name": "src/main.js"
}
]
}
}
Update version
ClientsUpdates Actor version using values specified by a Version object passed as JSON in the POST payload.
If the object does not define a specific property, its value will not be updated.
The request needs to specify the Content-Type: application/json
HTTP
header!
When providing your API authentication token, we recommend using the
request's Authorization
header, rather than the URL. (More
info).
The response is the Version object as returned by the Get version endpoint.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
versionNumber required | string Example: 1.0 Actor major and minor version of the Actor. |
Request Body schema: application/jsonrequired
versionNumber | string or null |
(any or null) or VersionSourceType (string) | |
Array of objects or null (EnvVar) | |
applyEnvVarsToBuild | boolean or null |
buildTag | string or null |
Array of SourceCodeFile (object) or SourceCodeFolder (object) (VersionSourceFiles) |
Responses
Response Schema: application/json
required | object (Version) | ||||||||||||
|
Request samples
- Payload
{- "versionNumber": "0.0",
- "sourceType": "SOURCE_FILES",
- "envVars": [
- {
- "name": "SECRET_PASSWORD",
- "value": "MyTopSecretPassword123",
- "isSecret": true
}
], - "applyEnvVarsToBuild": false,
- "buildTag": "latest",
- "sourceFiles": [ ]
}
Response samples
- 200
{- "data": {
- "versionNumber": "0.0",
- "sourceType": { },
- "envVars": [
- {
- "name": "MY_ENV_VAR",
- "value": "my-value",
- "isSecret": false
}
], - "applyEnvVarsToBuild": false,
- "buildTag": "latest",
- "sourceFiles": [
- {
- "format": "TEXT",
- "content": "console.log('This is the main.js file');",
- "name": "src/main.js"
}
]
}
}
Delete version
Deletes a specific version of Actor's source code.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
versionNumber required | string Example: 1.0 Actor major and minor version of the Actor. |
Responses
Response Schema: application/json
Response samples
- 204
{ }
Get list of environment variables
ClientsGets the list of environment variables for a specific version of an Actor.
The response is a JSON object with the list of EnvVar objects, where each contains basic information about a single environment variable.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
versionNumber required | string Example: 0.1 Actor version |
Responses
Response Schema: application/json
required | object | ||||
|
Response samples
- 200
{- "data": {
- "total": 5,
- "items": [
- {
- "name": "MY_ENV_VAR",
- "value": "my-value",
- "isSecret": false
}
]
}
}
Create environment variable
ClientsCreates an environment variable of an Actor using values specified in a
EnvVar object passed as
JSON in the POST payload.
The request must specify name
and value
parameters (as strings) in the
JSON payload and a Content-Type: application/json
HTTP header.
{
"name": "ENV_VAR_NAME",
"value": "my-env-var"
}
The response is the EnvVar object as returned by the Get environment variable endpoint.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
versionNumber required | string Example: 0.1 Actor version |
Request Body schema: application/jsonrequired
name required | string |
value required | string |
isSecret | boolean or null |
Responses
Location | any |
Response Schema: application/json
required | object (EnvVar) | ||||||
|
Request samples
- Payload
{- "name": "ENV_VAR_NAME",
- "value": "my-env-var"
}
Response samples
- 201
{- "data": {
- "name": "MY_ENV_VAR",
- "value": "my-value",
- "isSecret": false
}
}
Get environment variable
ClientsGets a EnvVar object that
contains all the details about a specific environment variable of an Actor.
If isSecret
is set to true
, then value
will never be returned.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
versionNumber required | string Example: 0.1 Actor version |
envVarName required | string Example: MY_ENV_VAR The name of the environment variable |
Responses
Response Schema: application/json
required | object (EnvVar) | ||||||
|
Response samples
- 200
{- "data": {
- "name": "MY_ENV_VAR",
- "value": "my-value",
- "isSecret": false
}
}
Update environment variable
ClientsUpdates Actor environment variable using values specified by a EnvVar
object
passed as JSON in the POST payload.
If the object does not define a specific property, its value will not be
updated.
The request needs to specify the Content-Type: application/json
HTTP
header!
When providing your API authentication token, we recommend using the
request's Authorization
header, rather than the URL. (More
info).
The response is the EnvVar object as returned by the Get environment variable endpoint.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
versionNumber required | string Example: 0.1 Actor version |
envVarName required | string Example: MY_ENV_VAR The name of the environment variable |
Request Body schema: application/jsonrequired
name required | string |
value required | string |
isSecret | boolean or null |
Responses
Response Schema: application/json
required | object (EnvVar) | ||||||
|
Request samples
- Payload
{- "name": "MY_ENV_VAR",
- "value": "my-new-value",
- "isSecret": false
}
Response samples
- 200
{- "data": {
- "name": "MY_ENV_VAR",
- "value": "my-value",
- "isSecret": false
}
}
Delete environment variable
Deletes a specific environment variable.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
versionNumber required | string Example: 0.1 Actor version |
envVarName required | string Example: MY_ENV_VAR The name of the environment variable |
Responses
Response Schema: application/json
Response samples
- 204
{ }
The API endpoints in this section allow you to manage your Apify Actors builds.
Get list of builds
ClientsGets the list of builds of a specific Actor. The response is a JSON with the
list of objects, where each object contains basic information about a single build.
The endpoint supports pagination using the limit
and offset
parameters
and it will not return more than 1000 records.
By default, the records are sorted by the startedAt
field in ascending order,
therefore you can use pagination to incrementally fetch all builds while new
ones are still being started. To sort the records in descending order, use
the desc=1
parameter.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
query Parameters
offset | number <double> Example: offset=10 Number of records that should be skipped at the start. The default value is |
limit | number <double> Example: limit=99 Maximum number of records to return. The default value as well as the maximum is |
desc | boolean Example: desc=true If |
Responses
Response Schema: application/json
required | object | ||||||||||||
|
Request samples
- JS client
- Apify CLI
import { ApifyClient } from 'apify-client'; const apifyClient = new ApifyClient({ token: '<TOKEN>', }); const { items } = await apifyClient .actor('<ACTOR ID>') .builds() .list(); console.log(items);
Response samples
- 200
{- "data": {
- "total": 2,
- "offset": 0,
- "limit": 1000,
- "desc": false,
- "count": 2,
- "items": [
- {
- "id": "HG7ML7M8z78YcAPEB",
- "actId": "janedoe~my-actor",
- "status": "SUCCEEDED",
- "startedAt": "2019-11-30T07:34:24.202Z",
- "finishedAt": "2019-12-12T09:30:12.202Z",
- "usageTotalUsd": 0.02,
- "meta": {
- "origin": "WEB",
- "clientIp": "172.234.12.34",
- "userAgent": "Mozilla/5.0 (iPad)"
}
}
]
}
}
Build Actor
ClientsBuilds an Actor.
The response is the build object as returned by the
Get build endpoint.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
query Parameters
version required | string Example: version=0.0 Actor version number to be built. |
useCache | boolean Example: useCache=true If |
betaPackages | boolean Example: betaPackages=true If |
tag | string Example: tag=latest Tag to be applied to the build on success. By default, the tag is taken
from Actor version's |
waitForFinish | number <double> Example: waitForFinish=60 The maximum number of seconds the server waits for the build to finish.
By default it is |
Responses
Location | any |
Response Schema: application/json
required | object (Build) | ||||||||||||||||||||||||||||||||
|
Request samples
- JS client
- Apify CLI
import { ApifyClient } from 'apify-client'; const apifyClient = new ApifyClient({ token: '<TOKEN>', }); const build = await apifyClient .actor('<ACTOR ID>') .build('0.0'); console.log(build);
Response samples
- 201
{- "data": {
- "id": "HG7ML7M8z78YcAPEB",
- "actId": "janedoe~my-actor",
- "userId": "klmdEpoiojmdEMlk3",
- "startedAt": "2019-11-30T07:34:24.202Z",
- "finishedAt": "2019-12-12T09:30:12.202Z",
- "status": "SUCCEEDED",
- "meta": {
- "origin": "WEB",
- "clientIp": "172.234.12.34",
- "userAgent": "Mozilla/5.0 (iPad)"
}, - "stats": {
- "durationMillis": 1000,
- "runTimeSecs": 45.718,
- "computeUnits": 0.012699444444444444
}, - "options": {
- "useCache": false,
- "betaPackages": false,
- "memoryMbytes": 1024,
- "diskMbytes": 2048
}, - "usage": {
- "ACTOR_COMPUTE_UNITS": 0.08
}, - "usageTotalUsd": 0.02,
- "usageUsd": {
- "ACTOR_COMPUTE_UNITS": 0.02
}, - "inputSchema": "{\\n \\\"title\\\": \\\"Schema for ... }",
- "readme": "# Magic Actor\\nThis Actor is magic.",
- "buildNumber": "0.1.1"
}
}
Get default build
Get the default build for an Actor.
Use the optional waitForFinish
parameter to synchronously wait for the build to finish.
This avoids the need for periodic polling when waiting for the build to complete.
This endpoint does not require an authentication token. Instead, calls are authenticated using the build's unique ID.
However, if you access the endpoint without a token, certain attributes (e.g., usageUsd
and usageTotalUsd
) will be hidden.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
query Parameters
waitForFinish | number <double> Example: waitForFinish=60 The maximum number of seconds the server waits for the build to finish.
If the build finishes within this time, the returned build object will have a terminal status (e.g. By default it is |
Responses
Response Schema: application/json
required | object (Build) | ||||||||||||||||||||||||||||||||
|
Response samples
- 200
{- "data": {
- "id": "HG7ML7M8z78YcAPEB",
- "actId": "janedoe~my-actor",
- "userId": "klmdEpoiojmdEMlk3",
- "startedAt": "2019-11-30T07:34:24.202Z",
- "finishedAt": "2019-12-12T09:30:12.202Z",
- "status": "SUCCEEDED",
- "meta": {
- "origin": "WEB",
- "clientIp": "172.234.12.34",
- "userAgent": "Mozilla/5.0 (iPad)"
}, - "stats": {
- "durationMillis": 1000,
- "runTimeSecs": 45.718,
- "computeUnits": 0.012699444444444444
}, - "options": {
- "useCache": false,
- "betaPackages": false,
- "memoryMbytes": 1024,
- "diskMbytes": 2048
}, - "usage": {
- "ACTOR_COMPUTE_UNITS": 0.08
}, - "usageTotalUsd": 0.02,
- "usageUsd": {
- "ACTOR_COMPUTE_UNITS": 0.02
}, - "inputSchema": "{\\n \\\"title\\\": \\\"Schema for ... }",
- "readme": "# Magic Actor\\nThis Actor is magic.",
- "buildNumber": "0.1.1"
}
}
Get OpenAPI definition
Get the OpenAPI definition for Actor builds. Two similar endpoints are available:
- First endpoint: Requires both
actorId
andbuildId
. Usedefault
as thebuildId
to get the OpenAPI schema for the default Actor build. - Second endpoint: Requires only
buildId
.
Get the OpenAPI definition for a specific Actor build.
To fetch the default Actor build, simply pass default
as the buildId
.
Authentication is based on the build's unique ID. No authentication token is required.
:::note
You can also use the /api/v2/actor-build-openapi-json-get
endpoint to get the OpenAPI definition for a build.
:::
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
buildId required | string Example: soSkq9ekdmfOslopH ID of the build you want to get, found in the build's |
Responses
Response Schema: application/json
openapi | string |
object | |
Array of objects | |
object | |
object |
Response samples
- 200
{- "openapi": "3.0.1",
- "info": {
- "title": "Your Magic Actor",
- "version": "1.0",
- "x-build-id": "ID of build"
}, - "paths": {
- "/acts/<username>~<actor>/run-sync-get-dataset-items": {
- "post": {
- "operationId": "run-sync-get-dataset-items",
- "x-openai-isConsequential": false,
- "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
- "tags": [
- "Run Actor"
], - "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/inputSchema"
}
}
}
}, - "parameters": [
- {
- "name": "token",
- "in": "query",
- "required": true,
- "schema": {
- "type": "string"
}, - "description": "Enter your Apify token here"
}
], - "responses": {
- "200": {
- "description": "OK"
}
}
}
}, - "/acts/<username>~<actor>/runs": {
- "post": {
- "operationId": "runs",
- "x-openai-isConsequential": false,
- "summary": "Executes an Actor and returns information about the initiated run in response.",
- "tags": [
- "Run Actor"
], - "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/inputSchema"
}
}
}
}, - "parameters": [
- {
- "name": "string",
- "in": "query",
- "required": true,
- "schema": {
- "type": "string"
}, - "description": "string"
}
], - "responses": {
- "200": {
- "description": "OK",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/runsResponseSchema"
}
}
}
}
}
}
}, - "/acts/<username>~<actor>/run-sync": {
- "post": {
- "operationId": "run-sync",
- "x-openai-isConsequential": false,
- "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
- "tags": [
- "Run Actor"
], - "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/inputSchema"
}
}
}
}, - "parameters": [
- {
- "name": "string",
- "in": "query",
- "required": true,
- "schema": {
- "type": "string"
}, - "description": "string"
}
], - "responses": {
- "200": {
- "description": "OK"
}
}
}
}
}, - "components": {
- "schemas": {
- "inputSchema": {
- "type": "object"
}, - "runsResponseSchema": {
- "type": "object",
- "properties": {
- "data": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
}, - "actId": {
- "type": "string"
}, - "userId": {
- "type": "string"
}, - "startedAt": {
- "type": "string",
- "format": "date-time",
- "example": "2025-01-08T00:00:00.000Z"
}, - "finishedAt": {
- "type": "string",
- "format": "date-time",
- "example": "2025-01-08T00:00:00.000Z"
}, - "status": {
- "type": "string",
- "example": "READY"
}, - "meta": {
- "type": "object",
- "properties": {
- "origin": {
- "type": null,
- "example": null
}, - "userAgent": {
- "type": null
}
}
}
}
}
}
}
}
}
}
Get build Deprecated
By passing the optional waitForFinish
parameter the API endpoint will
synchronously wait for the build to finish.
This is useful to avoid periodic polling when waiting for an Actor build to
finish.
This endpoint does not require the authentication token. Instead, calls are authenticated using a hard-to-guess ID of the build. However,
if you access the endpoint without the token, certain attributes, such as usageUsd
and usageTotalUsd
, will be hidden.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
buildId required | string Example: soSkq9ekdmfOslopH ID of the build you want to get, found in the build's |
query Parameters
waitForFinish | number <double> Example: waitForFinish=60 The maximum number of seconds the server waits for the build to finish.
By default it is |
Responses
Response Schema: application/json
required | object (Build) | ||||||||||||||||||||||||||||||||
|
Response samples
- 200
{- "data": {
- "id": "HG7ML7M8z78YcAPEB",
- "actId": "janedoe~my-actor",
- "userId": "klmdEpoiojmdEMlk3",
- "startedAt": "2019-11-30T07:34:24.202Z",
- "finishedAt": "2019-12-12T09:30:12.202Z",
- "status": "SUCCEEDED",
- "meta": {
- "origin": "WEB",
- "clientIp": "172.234.12.34",
- "userAgent": "Mozilla/5.0 (iPad)"
}, - "stats": {
- "durationMillis": 1000,
- "runTimeSecs": 45.718,
- "computeUnits": 0.012699444444444444
}, - "options": {
- "useCache": false,
- "betaPackages": false,
- "memoryMbytes": 1024,
- "diskMbytes": 2048
}, - "usage": {
- "ACTOR_COMPUTE_UNITS": 0.08
}, - "usageTotalUsd": 0.02,
- "usageUsd": {
- "ACTOR_COMPUTE_UNITS": 0.02
}, - "inputSchema": "{\\n \\\"title\\\": \\\"Schema for ... }",
- "readme": "# Magic Actor\\nThis Actor is magic.",
- "buildNumber": "0.1.1"
}
}
Abort build Deprecated
[DEPRECATED] API endpoints related to build of the Actor were moved
under new namespace actor-builds
. Aborts an
Actor build and returns an object that contains all the details about the
build.
Only builds that are starting or running are aborted. For builds with status
FINISHED
, FAILED
, ABORTING
and TIMED-OUT
this call does nothing.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
buildId required | string Example: 3KH8gEpp4d8uQSe8T Build ID. |
Responses
Response Schema: application/json
required | object (Build) | ||||||||||||||||||||||||||||||||
|
Response samples
- 200
{- "data": {
- "id": "HG7ML7M8z78YcAPEB",
- "actId": "janedoe~my-actor",
- "userId": "klmdEpoiojmdEMlk3",
- "startedAt": "2019-11-30T07:34:24.202Z",
- "finishedAt": "2019-12-12T09:30:12.202Z",
- "status": "ABORTED",
- "meta": {
- "origin": "WEB"
}, - "stats": {
- "durationMillis": 1000,
- "runTimeSecs": 5.718
}, - "options": {
- "useCache": false,
- "memoryMbytes": 1024,
- "diskMbytes": 2048
}, - "usage": {
- "ACTOR_COMPUTE_UNITS": 0.08
}, - "usageTotalUsd": 0.02,
- "usageUsd": {
- "ACTOR_COMPUTE_UNITS": 0.02
}
}
}
The API endpoints in this section allow you to manage your Apify Actors runs.
Some API endpoints return run objects. If a run object includes usage costs in dollars, note that these values are calculated based on your effective unit pricing at the time of the query. As a result, the dollar amounts should be treated as informational only and not as exact figures.
For more information about platform usage and resource calculations, see the Usage and Resources documentation.
Get list of runs
ClientsGets the list of runs of a specific Actor. The response is a list of
objects, where each object contains basic information about a single Actor run.
The endpoint supports pagination using the limit
and offset
parameters
and it will not return more than 1000 array elements.
By default, the records are sorted by the startedAt
field in ascending
order, therefore you can use pagination to incrementally fetch all records while
new ones are still being created. To sort the records in descending order, use
desc=1
parameter. You can also filter runs by status (available
statuses).
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
query Parameters
offset | number <double> Example: offset=10 Number of array elements that should be skipped at the start. The
default value is |
limit | number <double> Example: limit=99 Maximum number of array elements to return. The default value as well as
the maximum is |
desc | boolean Example: desc=true If |
status |
Responses
Response Schema: application/json
required | object (PaginationResponse) | ||||||||||||
|
Request samples
- JS client
- Apify CLI
import { ApifyClient } from 'apify-client'; const apifyClient = new ApifyClient({ token: '<TOKEN>', }); const { items } = await apifyClient .actor('<ACTOR ID>') .runs() .list(); console.log(items);
Response samples
- 200
{- "data": {
- "total": 2,
- "offset": 0,
- "limit": 1000,
- "desc": false,
- "count": 2,
- "items": [
- {
- "id": "HG7ML7M8z78YcAPEB",
- "actId": "HDSasDasz78YcAPEB",
- "actorTaskId": "KJHSKHausidyaJKHs",
- "status": "SUCCEEDED",
- "startedAt": "2019-11-30T07:34:24.202Z",
- "finishedAt": "2019-12-12T09:30:12.202Z",
- "buildId": "HG7ML7M8z78YcAPEB",
- "buildNumber": "0.0.2",
- "meta": {
- "origin": "WEB"
}, - "usageTotalUsd": 0.2,
- "defaultKeyValueStoreId": "sfAjeR4QmeJCQzTfe",
- "defaultDatasetId": "3ZojQDdFTsyE7Moy4",
- "defaultRequestQueueId": "so93g2shcDzK3pA85"
}, - {
- "id": "HG7ML7M8z78YcAPEB",
- "actId": "HDSasDasz78YcAPEB",
- "actorTaskId": "KJHSKHausidyaJKHs",
- "status": "FAILED",
- "startedAt": "2019-12-12T07:34:14.202Z",
- "finishedAt": "2019-12-13T08:36:13.202Z",
- "buildId": "u78dML7M8z78YcAPEB",
- "buildNumber": "0.2.2",
- "meta": {
- "origin": "DEVELOPMENT"
}, - "usageTotalUsd": 0.6,
- "defaultKeyValueStoreId": "sffsouqlseJCQzTfe",
- "defaultDatasetId": "CFGggdjQDsyE7Moyw",
- "defaultRequestQueueId": "soowucklrmDzKpA8x"
}
]
}
}
Run Actor
ClientsRuns an Actor and immediately returns without waiting for the run to finish.
The POST payload including its Content-Type
header is passed as INPUT
to
the Actor (usually application/json
).
The Actor is started with the default options; you can override them using various URL query parameters.
The response is the Run object as returned by the Get run API endpoint.
If you want to wait for the run to finish and receive the actual output of the Actor as the response, please use one of the Run Actor synchronously API endpoints instead.
To fetch the Actor run results that are typically stored in the default
dataset, you'll need to pass the ID received in the defaultDatasetId
field
received in the response JSON to the Get items
API endpoint.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
query Parameters
timeout | number <double> Example: timeout=60 Optional timeout for the run, in seconds. By default, the run uses a timeout specified in the default run configuration for the Actor. |
memory | number <double> Example: memory=256 Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses a memory limit specified in the default run configuration for the Actor. |
maxItems | number <double> Example: maxItems=1000 The maximum number of items that the Actor run should return. This is
useful for pay-per-result Actors, as it allows you to limit the number
of results that will be charged to your subscription. You can access the
maximum number of items in your Actor by using the
|
build | string Example: build=0.1.234 Specifies the Actor build to run. It can be either a build tag or build
number. By default, the run uses the build specified in the default run
configuration for the Actor (typically |
waitForFinish | number <double> Example: waitForFinish=60 The maximum number of seconds the server waits for the run to finish. By
default, it is |
webhooks | string Example: webhooks=dGhpcyBpcyBqdXN0IGV4YW1wbGUK... Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array of objects defining the webhooks. For more information, see Webhooks documentation. |
Request Body schema: application/jsonrequired
Responses
Location | any |
Response Schema: application/json
required | object (Run) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Request samples
- Payload
- JS client
- Apify CLI
{- "foo": "bar"
}
Response samples
- 201
{- "data": {
- "id": "HG7ML7M8z78YcAPEB",
- "actId": "HDSasDasz78YcAPEB",
- "userId": "7sT5jcggjjA9fNcxF",
- "actorTaskId": "KJHSKHausidyaJKHs",
- "startedAt": "2019-11-30T07:34:24.202Z",
- "finishedAt": "2019-12-12T09:30:12.202Z",
- "status": "RUNNING",
- "statusMessage": "Actor is running",
- "isStatusMessageTerminal": false,
- "meta": {
- "origin": "WEB",
- "clientIp": "172.234.12.34",
- "userAgent": "Mozilla/5.0 (iPad)"
}, - "stats": {
- "inputBodyLen": 240,
- "restartCount": 0,
- "resurrectCount": 2,
- "memAvgBytes": 267874071.9,
- "memMaxBytes": 404713472,
- "memCurrentBytes": 0,
- "cpuAvgUsage": 33.75321011075384,
- "cpuMaxUsage": 169.65073553494125,
- "cpuCurrentUsage": 0,
- "netRxBytes": 103508042,
- "netTxBytes": 4854600,
- "durationMillis": 248472,
- "runTimeSecs": 248.472,
- "metamorph": 0,
- "computeUnits": 0.13804
}, - "options": {
- "build": "latest",
- "timeoutSecs": 300,
- "memoryMbytes": 1024,
- "diskMbytes": 2048
}, - "buildId": "7sT5jcggjjA9fNcxF",
- "exitCode": 0,
- "defaultKeyValueStoreId": "eJNzqsbPiopwJcgGQ",
- "defaultDatasetId": "wmKPijuyDnPZAPRMk",
- "defaultRequestQueueId": "FL35cSF7jrxr3BY39",
- "buildNumber": "0.0.36",
- "isContainerServerReady": true,
- "gitBranchName": "master",
- "usage": {
- "ACTOR_COMPUTE_UNITS": 3,
- "DATASET_READS": 4,
- "DATASET_WRITES": 4,
- "KEY_VALUE_STORE_READS": 5,
- "KEY_VALUE_STORE_WRITES": 3,
- "KEY_VALUE_STORE_LISTS": 5,
- "REQUEST_QUEUE_READS": 2,
- "REQUEST_QUEUE_WRITES": 1,
- "DATA_TRANSFER_INTERNAL_GBYTES": 1,
- "DATA_TRANSFER_EXTERNAL_GBYTES?": 3,
- "PROXY_RESIDENTIAL_TRANSFER_GBYTES": 34,
- "PROXY_SERPS": 3
}, - "usageTotalUsd": 0.2654,
- "usageUsd": {
- "ACTOR_COMPUTE_UNITS": 0.072,
- "DATASET_READS": 0.0004,
- "DATASET_WRITES": 0.0002,
- "KEY_VALUE_STORE_READS": 0.0006,
- "KEY_VALUE_STORE_WRITES": 0.002,
- "KEY_VALUE_STORE_LISTS": 0.004,
- "REQUEST_QUEUE_READS": 0.005,
- "REQUEST_QUEUE_WRITES": 0.02,
- "DATA_TRANSFER_INTERNAL_GBYTES": 0.0004,
- "DATA_TRANSFER_EXTERNAL_GBYTES?": 0.0002,
- "PROXY_RESIDENTIAL_TRANSFER_GBYTES": 0.16,
- "PROXY_SERPS": 0.0006
}
}
}
With input
Runs a specific Actor and returns its output.
The POST payload including its Content-Type
header is passed as INPUT
to
the Actor (usually application/json
).
The HTTP response contains Actors OUTPUT
record from its default
key-value store.
The Actor is started with the default options; you can override them using various URL query parameters. If the Actor run exceeds 300 seconds, the HTTP response will have status 408 (Request Timeout).
Beware that it might be impossible to maintain an idle HTTP connection for a long period of time, due to client timeout or network conditions. Make sure your HTTP client is configured to have a long enough connection timeout. If the connection breaks, you will not receive any information about the run and its status.
To run the Actor asynchronously, use the Run Actor API endpoint instead.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
query Parameters
outputRecordKey | string Example: outputRecordKey=OUTPUT Key of the record from run's default key-value store to be returned
in the response. By default, it is |
timeout | number <double> Example: timeout=60 Optional timeout for the run, in seconds. By default, the run uses a timeout specified in the default run configuration for the Actor. |
memory | number <double> Example: memory=256 Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses a memory limit specified in the default run configuration for the Actor. |
maxItems | number <double> Example: maxItems=1000 The maximum number of items that the Actor run should return. This is
useful for pay-per-result Actors, as it allows you to limit the number
of results that will be charged to your subscription. You can access the
maximum number of items in your Actor by using the
|
build | string Example: build=0.1.234 Specifies the Actor build to run. It can be either a build tag or build
number. By default, the run uses the build specified in the default run
configuration for the Actor (typically |
webhooks | string Example: webhooks=dGhpcyBpcyBqdXN0IGV4YW1wbGUK... Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array of objects defining the webhooks. For more information, see Webhooks documentation. |
Request Body schema: application/jsonrequired
Responses
Response Schema: application/json
Response Schema: application/json
required | object | ||||
|
Response Schema: application/json
required | object | ||||
|
Request samples
- Payload
{- "foo": "bar"
}
Response samples
- 201
- 400
- 408
{- "bar": "foo"
}
Without input
Runs a specific Actor and returns its output. The run must finish in 300 seconds otherwise the API endpoint returns a timeout error. The Actor is not passed any input.
Beware that it might be impossible to maintain an idle HTTP connection for a long period of time, due to client timeout or network conditions. Make sure your HTTP client is configured to have a long enough connection timeout. If the connection breaks, you will not receive any information about the run and its status.
To run the Actor asynchronously, use the Run Actor API endpoint instead.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
query Parameters
outputRecordKey | string Example: outputRecordKey=OUTPUT Key of the record from run's default key-value store to be returned
in the response. By default, it is |
timeout | number <double> Example: timeout=60 Optional timeout for the run, in seconds. By default, the run uses a timeout specified in the default run configuration for the Actor. |
memory | number <double> Example: memory=256 Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses a memory limit specified in the default run configuration for the Actor. |
maxItems | number <double> Example: maxItems=1000 The maximum number of items that the Actor run should return. This is
useful for pay-per-result Actors, as it allows you to limit the number
of results that will be charged to your subscription. You can access the
maximum number of items in your Actor by using the
|
build | string Example: build=0.1.234 Specifies the Actor build to run. It can be either a build tag or build
number. By default, the run uses the build specified in the default run
configuration for the Actor (typically |
webhooks | string Example: webhooks=dGhpcyBpcyBqdXN0IGV4YW1wbGUK... Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array of objects defining the webhooks. For more information, see Webhooks documentation. |
Responses
Response Schema: application/json
Response Schema: application/json
required | object | ||||
|
Response Schema: application/json
required | object | ||||
|
Response samples
- 201
- 400
- 408
{- "foo": "bar"
}
Run Actor synchronously with input and get dataset items
Runs a specific Actor and returns its dataset items.
The POST payload including its Content-Type
header is passed as INPUT
to
the Actor (usually application/json
).
The HTTP response contains the Actors dataset items, while the format of
items depends on specifying dataset items' format
parameter.
You can send all the same options in parameters as the Get Dataset Items API endpoint.
The Actor is started with the default options; you can override them using URL query parameters. If the Actor run exceeds 300 seconds, the HTTP response will return the 408 status code (Request Timeout).
Beware that it might be impossible to maintain an idle HTTP connection for a long period of time, due to client timeout or network conditions. Make sure your HTTP client is configured to have a long enough connection timeout. If the connection breaks, you will not receive any information about the run and its status.
To run the Actor asynchronously, use the Run Actor API endpoint instead.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
query Parameters
timeout | number <double> Example: timeout=60 Optional timeout for the run, in seconds. By default, the run uses a timeout specified in the default run configuration for the Actor. |
memory | number <double> Example: memory=256 Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses a memory limit specified in the default run configuration for the Actor. |
maxItems | number <double> Example: maxItems=1000 The maximum number of items that the Actor run should return. This is
useful for pay-per-result Actors, as it allows you to limit the number
of results that will be charged to your subscription. You can access the
maximum number of items in your Actor by using the
|
build | string Example: build=0.1.234 Specifies the Actor build to run. It can be either a build tag or build
number. By default, the run uses the build specified in the default run
configuration for the Actor (typically |
webhooks | string Example: webhooks=dGhpcyBpcyBqdXN0IGV4YW1wbGUK... Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array of objects defining the webhooks. For more information, see Webhooks documentation. |
format | string Example: format=json Format of the results, possible values are: |
clean | boolean Example: clean=false If |
offset | number <double> Example: offset=0 Number of items that should be skipped at the start. The default value
is |
limit | number <double> Example: limit=99 Maximum number of items to return. By default there is no limit. |
fields | string Example: fields=myValue,myOtherValue A comma-separated list of fields which should be picked from the items,
only these fields will remain in the resulting record objects.
Note that the fields in the outputted items are sorted the same way as
they are specified in the |
omit | string Example: omit=myValue,myOtherValue A comma-separated list of fields which should be omitted from the items. |
unwind | string Example: unwind=myValue,myOtherValue A comma-separated list of fields which should be unwound, in order which
they should be processed. Each field should be either an array or an object.
If the field is an array then every element of
the array will become a separate record and merged with parent object.
If the unwound field is an object then it is merged with the parent object.
If the unwound field is missing or its value is neither an array nor an
object and therefore cannot be merged with a parent object then the item
gets preserved as it is.
Note that the unwound items ignore the |
flatten | string Example: flatten=myValue A comma-separated list of fields which should transform nested objects
into flat structures.
For example, with |
desc | boolean Example: desc=true By default, results are returned in the same order as they were stored.
To reverse the order, set this parameter to |
attachment | boolean Example: attachment=true If |
delimiter | string Example: delimiter=; A delimiter character for CSV files, only used if |
bom | boolean Example: bom=false All text responses are encoded in UTF-8 encoding. By default, the
|
xmlRoot | string Example: xmlRoot=items Overrides default root element name of |
xmlRow | string Example: xmlRow=item Overrides default element name that wraps each page or page function
result object in |
skipHeaderRow | boolean Example: skipHeaderRow=true If |
skipHidden | boolean Example: skipHidden=false If |
skipEmpty | boolean Example: skipEmpty=false If Note that if used, the results might contain less items than the limit value. |
simplified | boolean Example: simplified=false If |
skipFailedPages | boolean Example: skipFailedPages=false If |
Request Body schema: application/jsonrequired
Responses
X-Apify-Pagination-Offset | any |
X-Apify-Pagination-Limit | any |
X-Apify-Pagination-Count | any |
X-Apify-Pagination-Total | any |
Response Schema: application/json
Response Schema: application/json
required | object | ||||
|
Response Schema: application/json
required | object | ||||
|
Request samples
- Payload
{- "foo": "bar"
}
Response samples
- 201
- 400
- 408
[- {
- "myValue": "some value",
- "myOtherValue": "some other value"
}
]
Run Actor synchronously without input and get dataset items
Runs a specific Actor and returns its dataset items. The run must finish in 300 seconds otherwise the API endpoint returns a timeout error. The Actor is not passed any input.
It allows to send all possible options in parameters from Get Dataset Items API endpoint.
Beware that it might be impossible to maintain an idle HTTP connection for a long period of time, due to client timeout or network conditions. Make sure your HTTP client is configured to have a long enough connection timeout. If the connection breaks, you will not receive any information about the run and its status.
To run the Actor asynchronously, use the Run Actor API endpoint instead.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
query Parameters
timeout | number <double> Example: timeout=60 Optional timeout for the run, in seconds. By default, the run uses a timeout specified in the default run configuration for the Actor. |
memory | number <double> Example: memory=256 Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses a memory limit specified in the default run configuration for the Actor. |
maxItems | number <double> Example: maxItems=1000 The maximum number of items that the Actor run should return. This is
useful for pay-per-result Actors, as it allows you to limit the number
of results that will be charged to your subscription. You can access the
maximum number of items in your Actor by using the
|
build | string Example: build=0.1.234 Specifies the Actor build to run. It can be either a build tag or build
number. By default, the run uses the build specified in the default run
configuration for the Actor (typically |
webhooks | string Example: webhooks=dGhpcyBpcyBqdXN0IGV4YW1wbGUK... Specifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array of objects defining the webhooks. For more information, see Webhooks documentation. |
format | string Example: format=json Format of the results, possible values are: |
clean | boolean Example: clean=false If |
offset | number <double> Example: offset=0 Number of items that should be skipped at the start. The default value is |
limit | number <double> Example: limit=99 Maximum number of items to return. By default there is no limit. |
fields | string Example: fields=myValue,myOtherValue A comma-separated list of fields which should be picked from the items,
only these fields will remain in the resulting record objects.
Note that the fields in the outputted items are sorted the same way as
they are specified in the |
omit | string Example: omit=myValue,myOtherValue A comma-separated list of fields which should be omitted from the items. |
unwind | string Example: unwind=myValue,myOtherValue A comma-separated list of fields which should be unwound, in order which
they should be processed. Each field should be either an array or an object.
If the field is an array then every element of
the array will become a separate record and merged with parent object.
If the unwound field is an object then it is merged with the parent object
If the unwound field is missing or its value is neither an array nor an
object and therefore cannot be merged with a parent object then the item
gets preserved as it is.
Note that the unwound items ignore the |
flatten | string Example: flatten=myValue A comma-separated list of fields which should transform nested objects into flat structures.
For example, with |
desc | boolean Example: desc=true By default, results are returned in the same order as they were stored.
To reverse the order, set this parameter to |
attachment | boolean Example: attachment=true If |
delimiter | string Example: delimiter=; A delimiter character for CSV files, only used if |
bom | boolean Example: bom=false All text responses are encoded in UTF-8 encoding. By default, the |
xmlRoot | string Example: xmlRoot=items Overrides default root element name of |
xmlRow | string Example: xmlRow=item Overrides default element name that wraps each page or page function
result object in |
skipHeaderRow | boolean Example: skipHeaderRow=true If |
skipHidden | boolean Example: skipHidden=false If |
skipEmpty | boolean Example: skipEmpty=false If Note that if used, the results might contain less items than the limit value. |
simplified | boolean Example: simplified=false If |
skipFailedPages | boolean Example: skipFailedPages=false If |
Responses
X-Apify-Pagination-Offset | any |
X-Apify-Pagination-Limit | any |
X-Apify-Pagination-Count | any |
X-Apify-Pagination-Total | any |
Response Schema: application/json
Response Schema: application/json
required | object | ||||
|
Response Schema: application/json
required | object | ||||
|
Response samples
- 201
- 400
- 408
[- {
- "myValue": "some value",
- "myOtherValue": "some other value"
}
]
Resurrect run
[DEPRECATED] API endpoints related to run of the Actor were moved under
new namespace actor-runs
.Resurrects a finished
Actor run and returns an object that contains all the details about the
resurrected run.
Only finished runs, i.e. runs with status FINISHED
, FAILED
, ABORTED
and TIMED-OUT
can be resurrected.
Run status will be updated to RUNNING and its container will be restarted
with the same storages
(the same behaviour as when the run gets migrated to the new server).
For more information, see the Actor docs.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
runId required | string Example: 3KH8gEpp4d8uQSe8T Run ID. |
query Parameters
build | string Example: build=0.1.234 Specifies the Actor build to run. It can be either a build tag or build
number. By default, the run uses the build specified in the run that is
being resurrected (typically |
timeout | number <double> Example: timeout=60 Optional timeout for the run, in seconds. By default, the run uses a timeout specified in the run that is being resurrected. |
memory | number <double> Example: memory=256 Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses a memory limit specified in the run that is being resurrected. |
Responses
Response Schema: application/json
required | object (Run) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Response samples
- 200
{- "data": {
- "id": "HG7ML7M8z78YcAPEB",
- "actId": "HDSasDasz78YcAPEB",
- "userId": "7sT5jcggjjA9fNcxF",
- "actorTaskId": "KJHSKHausidyaJKHs",
- "startedAt": "2019-11-30T07:34:24.202Z",
- "finishedAt": "2019-12-12T09:30:12.202Z",
- "status": "RUNNING",
- "statusMessage": "Actor is running",
- "isStatusMessageTerminal": false,
- "meta": {
- "origin": "WEB",
- "clientIp": "172.234.12.34",
- "userAgent": "Mozilla/5.0 (iPad)"
}, - "stats": {
- "inputBodyLen": 240,
- "restartCount": 0,
- "resurrectCount": 2,
- "memAvgBytes": 267874071.9,
- "memMaxBytes": 404713472,
- "memCurrentBytes": 0,
- "cpuAvgUsage": 33.75321011075384,
- "cpuMaxUsage": 169.65073553494125,
- "cpuCurrentUsage": 0,
- "netRxBytes": 103508042,
- "netTxBytes": 4854600,
- "durationMillis": 248472,
- "runTimeSecs": 248.472,
- "metamorph": 0,
- "computeUnits": 0.13804
}, - "options": {
- "build": "latest",
- "timeoutSecs": 300,
- "memoryMbytes": 1024,
- "diskMbytes": 2048
}, - "buildId": "7sT5jcggjjA9fNcxF",
- "exitCode": 0,
- "defaultKeyValueStoreId": "eJNzqsbPiopwJcgGQ",
- "defaultDatasetId": "wmKPijuyDnPZAPRMk",
- "defaultRequestQueueId": "FL35cSF7jrxr3BY39",
- "buildNumber": "0.0.36",
- "isContainerServerReady": true,
- "gitBranchName": "master",
- "usage": {
- "ACTOR_COMPUTE_UNITS": 3,
- "DATASET_READS": 4,
- "DATASET_WRITES": 4,
- "KEY_VALUE_STORE_READS": 5,
- "KEY_VALUE_STORE_WRITES": 3,
- "KEY_VALUE_STORE_LISTS": 5,
- "REQUEST_QUEUE_READS": 2,
- "REQUEST_QUEUE_WRITES": 1,
- "DATA_TRANSFER_INTERNAL_GBYTES": 1,
- "DATA_TRANSFER_EXTERNAL_GBYTES?": 3,
- "PROXY_RESIDENTIAL_TRANSFER_GBYTES": 34,
- "PROXY_SERPS": 3
}, - "usageTotalUsd": 0.2654,
- "usageUsd": {
- "ACTOR_COMPUTE_UNITS": 0.072,
- "DATASET_READS": 0.0004,
- "DATASET_WRITES": 0.0002,
- "KEY_VALUE_STORE_READS": 0.0006,
- "KEY_VALUE_STORE_WRITES": 0.002,
- "KEY_VALUE_STORE_LISTS": 0.004,
- "REQUEST_QUEUE_READS": 0.005,
- "REQUEST_QUEUE_WRITES": 0.02,
- "DATA_TRANSFER_INTERNAL_GBYTES": 0.0004,
- "DATA_TRANSFER_EXTERNAL_GBYTES?": 0.0002,
- "PROXY_RESIDENTIAL_TRANSFER_GBYTES": 0.16,
- "PROXY_SERPS": 0.0006
}
}
}
Get last run
This is not a single endpoint, but an entire group of endpoints that lets you to retrieve and manage the last run of given Actor or any of its default storages. All the endpoints require an authentication token.
The endpoints accept the same HTTP methods and query parameters as the respective storage endpoints. The base path represents the last Actor run object is:
/v2/acts/{actorId}/runs/last{?token,status}
Using the status
query parameter you can ensure to only get a run with a certain status
(e.g. status=SUCCEEDED
). The output of this endpoint and other query parameters
are the same as in the Run object endpoint.
In order to access the default storages of the last Actor run, i.e. log, key-value store, dataset and request queue, use the following endpoints:
/v2/acts/{actorId}/runs/last/log{?token,status}
/v2/acts/{actorId}/runs/last/key-value-store{?token,status}
/v2/acts/{actorId}/runs/last/dataset{?token,status}
/v2/acts/{actorId}/runs/last/request-queue{?token,status}
These API endpoints have the same usage as the equivalent storage endpoints.
For example,
/v2/acts/{actorId}/runs/last/key-value-store
has the same HTTP method and parameters as the
Key-value store object endpoint.
Additionally, each of the above API endpoints supports all sub-endpoints of the original one:
Key-value store
/v2/acts/{actorId}/runs/last/key-value-store/keys{?token,status}
Key collection/v2/acts/{actorId}/runs/last/key-value-store/records/{recordKey}{?token,status}
Record
Dataset
/v2/acts/{actorId}/runs/last/dataset/items{?token,status}
Item collection
Request queue
/v2/acts/{actorId}/runs/last/request-queue/requests{?token,status}
Request collection/v2/acts/{actorId}/runs/last/request-queue/requests/{requestId}{?token,status}
Request collection/v2/acts/{actorId}/runs/last/request-queue/head{?token,status}
Queue head
For example, to download data from a dataset of the last succeeded Actor run in XML format, send HTTP GET request to the following URL:
https://api.apify.com/v2/acts/{actorId}/runs/last/dataset/items?token={yourApiToken}&format=xml&status=SUCCEEDED
In order to save new items to the dataset, send HTTP POST request with JSON payload to the same URL.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
query Parameters
status | string Example: status=SUCCEEDED Filter for the run status. |
Responses
Response Schema: application/json
required | object (Run) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Response samples
- 200
{- "data": {
- "id": "HG7ML7M8z78YcAPEB",
- "actId": "HDSasDasz78YcAPEB",
- "userId": "7sT5jcggjjA9fNcxF",
- "actorTaskId": "KJHSKHausidyaJKHs",
- "startedAt": "2019-11-30T07:34:24.202Z",
- "finishedAt": "2019-12-12T09:30:12.202Z",
- "status": "RUNNING",
- "statusMessage": "Actor is running",
- "isStatusMessageTerminal": false,
- "meta": {
- "origin": "WEB",
- "clientIp": "172.234.12.34",
- "userAgent": "Mozilla/5.0 (iPad)"
}, - "stats": {
- "inputBodyLen": 240,
- "restartCount": 0,
- "resurrectCount": 2,
- "memAvgBytes": 267874071.9,
- "memMaxBytes": 404713472,
- "memCurrentBytes": 0,
- "cpuAvgUsage": 33.75321011075384,
- "cpuMaxUsage": 169.65073553494125,
- "cpuCurrentUsage": 0,
- "netRxBytes": 103508042,
- "netTxBytes": 4854600,
- "durationMillis": 248472,
- "runTimeSecs": 248.472,
- "metamorph": 0,
- "computeUnits": 0.13804
}, - "options": {
- "build": "latest",
- "timeoutSecs": 300,
- "memoryMbytes": 1024,
- "diskMbytes": 2048
}, - "buildId": "7sT5jcggjjA9fNcxF",
- "exitCode": 0,
- "defaultKeyValueStoreId": "eJNzqsbPiopwJcgGQ",
- "defaultDatasetId": "wmKPijuyDnPZAPRMk",
- "defaultRequestQueueId": "FL35cSF7jrxr3BY39",
- "buildNumber": "0.0.36",
- "isContainerServerReady": true,
- "gitBranchName": "master",
- "usage": {
- "ACTOR_COMPUTE_UNITS": 3,
- "DATASET_READS": 4,
- "DATASET_WRITES": 4,
- "KEY_VALUE_STORE_READS": 5,
- "KEY_VALUE_STORE_WRITES": 3,
- "KEY_VALUE_STORE_LISTS": 5,
- "REQUEST_QUEUE_READS": 2,
- "REQUEST_QUEUE_WRITES": 1,
- "DATA_TRANSFER_INTERNAL_GBYTES": 1,
- "DATA_TRANSFER_EXTERNAL_GBYTES?": 3,
- "PROXY_RESIDENTIAL_TRANSFER_GBYTES": 34,
- "PROXY_SERPS": 3
}, - "usageTotalUsd": 0.2654,
- "usageUsd": {
- "ACTOR_COMPUTE_UNITS": 0.072,
- "DATASET_READS": 0.0004,
- "DATASET_WRITES": 0.0002,
- "KEY_VALUE_STORE_READS": 0.0006,
- "KEY_VALUE_STORE_WRITES": 0.002,
- "KEY_VALUE_STORE_LISTS": 0.004,
- "REQUEST_QUEUE_READS": 0.005,
- "REQUEST_QUEUE_WRITES": 0.02,
- "DATA_TRANSFER_INTERNAL_GBYTES": 0.0004,
- "DATA_TRANSFER_EXTERNAL_GBYTES?": 0.0002,
- "PROXY_RESIDENTIAL_TRANSFER_GBYTES": 0.16,
- "PROXY_SERPS": 0.0006
}
}
}
Get run Deprecated
[DEPRECATED] API endpoints related to run of the Actor were moved under
new namespace actor-runs
.
Gets an object that contains all the details about a specific run of an Actor.
By passing the optional waitForFinish
parameter the API endpoint will
synchronously wait for the run to finish.
This is useful to avoid periodic polling when waiting for Actor run to
complete.
This endpoint does not require the authentication token. Instead, calls are authenticated using a hard-to-guess ID of the run. However,
if you access the endpoint without the token, certain attributes, such as usageUsd
and usageTotalUsd
, will be hidden.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
runId required | string Example: 3KH8gEpp4d8uQSe8T Run ID. |
query Parameters
waitForFinish | number <double> Example: waitForFinish=60 The maximum number of seconds the server waits for the run to finish. By
default it is |
Responses
Response Schema: application/json
required | object (Run) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Response samples
- 200
{- "data": {
- "id": "HG7ML7M8z78YcAPEB",
- "actId": "HDSasDasz78YcAPEB",
- "userId": "7sT5jcggjjA9fNcxF",
- "actorTaskId": "KJHSKHausidyaJKHs",
- "startedAt": "2019-11-30T07:34:24.202Z",
- "finishedAt": "2019-12-12T09:30:12.202Z",
- "status": "RUNNING",
- "statusMessage": "Actor is running",
- "isStatusMessageTerminal": false,
- "meta": {
- "origin": "WEB",
- "clientIp": "172.234.12.34",
- "userAgent": "Mozilla/5.0 (iPad)"
}, - "stats": {
- "inputBodyLen": 240,
- "restartCount": 0,
- "resurrectCount": 2,
- "memAvgBytes": 267874071.9,
- "memMaxBytes": 404713472,
- "memCurrentBytes": 0,
- "cpuAvgUsage": 33.75321011075384,
- "cpuMaxUsage": 169.65073553494125,
- "cpuCurrentUsage": 0,
- "netRxBytes": 103508042,
- "netTxBytes": 4854600,
- "durationMillis": 248472,
- "runTimeSecs": 248.472,
- "metamorph": 0,
- "computeUnits": 0.13804
}, - "options": {
- "build": "latest",
- "timeoutSecs": 300,
- "memoryMbytes": 1024,
- "diskMbytes": 2048
}, - "buildId": "7sT5jcggjjA9fNcxF",
- "exitCode": 0,
- "defaultKeyValueStoreId": "eJNzqsbPiopwJcgGQ",
- "defaultDatasetId": "wmKPijuyDnPZAPRMk",
- "defaultRequestQueueId": "FL35cSF7jrxr3BY39",
- "buildNumber": "0.0.36",
- "isContainerServerReady": true,
- "gitBranchName": "master",
- "usage": {
- "ACTOR_COMPUTE_UNITS": 3,
- "DATASET_READS": 4,
- "DATASET_WRITES": 4,
- "KEY_VALUE_STORE_READS": 5,
- "KEY_VALUE_STORE_WRITES": 3,
- "KEY_VALUE_STORE_LISTS": 5,
- "REQUEST_QUEUE_READS": 2,
- "REQUEST_QUEUE_WRITES": 1,
- "DATA_TRANSFER_INTERNAL_GBYTES": 1,
- "DATA_TRANSFER_EXTERNAL_GBYTES?": 3,
- "PROXY_RESIDENTIAL_TRANSFER_GBYTES": 34,
- "PROXY_SERPS": 3
}, - "usageTotalUsd": 0.2654,
- "usageUsd": {
- "ACTOR_COMPUTE_UNITS": 0.072,
- "DATASET_READS": 0.0004,
- "DATASET_WRITES": 0.0002,
- "KEY_VALUE_STORE_READS": 0.0006,
- "KEY_VALUE_STORE_WRITES": 0.002,
- "KEY_VALUE_STORE_LISTS": 0.004,
- "REQUEST_QUEUE_READS": 0.005,
- "REQUEST_QUEUE_WRITES": 0.02,
- "DATA_TRANSFER_INTERNAL_GBYTES": 0.0004,
- "DATA_TRANSFER_EXTERNAL_GBYTES?": 0.0002,
- "PROXY_RESIDENTIAL_TRANSFER_GBYTES": 0.16,
- "PROXY_SERPS": 0.0006
}
}
}
Abort run Deprecated
[DEPRECATED] API endpoints related to run of the Actor were moved under
new namespace actor-runs
. Aborts an Actor run and
returns an object that contains all the details about the run.
Only runs that are starting or running are aborted. For runs with status
FINISHED
, FAILED
, ABORTING
and TIMED-OUT
this call does nothing.
Authorizations:
path Parameters
actorId required | string Example: janedoe~my-actor Actor ID or a tilde-separated owner's username and Actor name. |
runId required | string Example: 3KH8gEpp4d8uQSe8T Run ID. |
query Parameters
gracefully | boolean Example: gracefully=true If true passed, the Actor run will abort gracefully.
It will send |
Responses
Response Schema: application/json
required | object (Run) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Response samples
- 200
{- "data": {
- "id": "HG7ML7M8z78YcAPEB",
- "actId": "janedoe~my-actor",
- "userId": "BPWZBd7Z9c746JAng",
- "actorTaskId": "rANaydYhUxjsnA3oz",
- "startedAt": "2019-11-30T07:34:24.202Z",
- "finishedAt": "2019-12-12T09:30:12.202Z",
- "status": "ABORTED",
- "statusMessage": "Actor was aborted",
- "isStatusMessageTerminal": true,
- "meta": {
- "origin": "WEB",
- "clientIp": "172.234.12.34",
- "userAgent": "Mozilla/5.0 (iPad)"
}, - "stats": {
- "inputBodyLen": 240