Keys / Apify

APIFY_TOKEN

The Apify API token your app runs Actors and reads datasets with. Inside an Actor run, Apify sets APIFY_TOKEN to a short-lived run token.

Expires
you choose, or never
API
none; Console only

Get it

Create one on console.apify.com/settings/integrations. The steps aren't recorded yet.

Set it

APIFY_TOKEN=...

The Apify SDKs for JavaScript and Python read it from this variable. The API clients don't; your app passes the token in. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. On Settings > API & Integrations, rotate the token and keep the old one active for 24 hours.
  2. Deploy the new token everywhere that reads APIFY_TOKEN within those 24 hours.
  3. Check that everything works with the new token before the old one stops.

Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.

Sources, checked 2026-11-16