Skip to main content

actor.json

Learn how to write the main Actor config in the .actor/actor.json file.


Your main Actor configuration is in the actor/actor.json file at the root of your Actor's directory. This file links your local development project to an Actor on the Apify platform. It should include details like the Actor's name, version, build tag, and environment variables. Make sure to commit this file to your Git repository.

For example, the .actor/actor.json file can look like this:

{
"actorSpecification": 1, // always 1
"name": "name-of-my-scraper",
"version": "0.0",
"buildTag": "latest",
"minMemoryMbytes": 256,
"maxMemoryMbytes": 4096,
"environmentVariables": {
"MYSQL_USER": "my_username",
"MYSQL_PASSWORD": "@mySecretPassword"
},
"usesStandbyMode": false,
"dockerfile": "./Dockerfile",
"readme": "./ACTOR.md",
"input": "./input_schema.json",
"storages": {
"dataset": "./dataset_schema.json"
}
}

Reference

Deployment metadata

Actor name, version, buildTag, and environmentVariables are currently only used when you deploy your Actor using the Apify CLI and not when deployed, for example, via GitHub integration. There, it serves for informative purposes only.

PropertyTypeDescription
actorSpecificationRequiredThe version of the Actor specification. This property must be set to 1, which is the only version available.
nameRequiredThe name of the Actor.
versionRequiredThe version of the Actor, specified in the format [Number].[Number], e.g., 0.1, 0.3, 1.0, 1.3, etc.
buildTagOptionalThe tag name to be applied to a successful build of the Actor. If not specified, defaults to latest. Refer to the builds for more information.
environmentVariablesOptionalA map of environment variables to be used during local development. These variables will also be applied to the Actor when deployed on the Apify platform. For more details, see the environment variables section of Apify CLI documentation.
dockerfileOptionalThe path to the Dockerfile to be used for building the Actor on the platform. If not specified, the system will search for Dockerfiles in the .actor/Dockerfile and Dockerfile paths, in that order. Refer to the Dockerfile section for more information.
dockerContextDirOptionalThe path to the directory to be used as the Docker context when building the Actor. The path is relative to the location of the actor.json file. This property is useful for monorepos containing multiple Actors. Refer to the Actor monorepos section for more details.
readmeOptionalThe path to the README file to be used on the platform. If not specified, the system will look for README files in the .actor/README.md and README.md paths, in that order of preference. Check out Apify Academy article on writing a quality README files guidance.
inputOptionalYou can embed your input schema object directly in actor.json under the input field. You can also provide a path to a custom input schema. If not provided, the input schema at .actor/INPUT_SCHEMA.json or INPUT_SCHEMA.json is used, in this order of preference.
changelogOptionalThe path to the CHANGELOG file displayed in the Information tab of the Actor in Apify Console next to Readme. If not provided, the CHANGELOG at .actor/CHANGELOG.md or CHANGELOG.md is used, in this order of preference. Your Actor doesn't need to have a CHANGELOG but it is a good practice to keep it updated for published Actors.
storages.datasetOptionalYou can define the schema of the items in your dataset under the storages.dataset field. This can be either an embedded object or a path to a JSON schema file. Read more about Actor output schemas.
minMemoryMbytesOptionalSpecifies the minimum amount of memory in megabytes required by the Actor to run. Requires an integer value. If both minMemoryMbytes and maxMemoryMbytes are set, then minMemoryMbytes must be equal or lower than maxMemoryMbytes. Refer to the Usage and resoursces for more details about memory allocation.
maxMemoryMbytesOptionalSpecifies the maximum amount of memory in megabytes required by the Actor to run. It can be used to control the costs of run, especially when developing pay per result Actors. Requires an integer value. Refer to the Usage and resoursces for more details about memory allocation.
usesStandbyModeOptionalBoolean specifying whether the Actor will have Standby mode enabled.