- Review this guide completely
- Setup you development environment
- Familiarize yourself with the documentation style guide
- Git
- Node.js 22 (see .nvmrc file)
- GitHub access
- pnpm 10 package manager (pinned via
packageManagerinpackage.json;corepack enablepicks it up automatically)
- Clone the repository
- Run
pnpm install - Start development server:
pnpm start
This will be enough to work on Platform, Academy and OpenAPI. If you want to work on the entire documentation set, you need to join them using nginx.
-
Clone all the repositories
-
Run
pnpm start:devinstead ofpnpm startfrom the main repository -
Run
pnpm start -- --port <number>to start Docusaurus instance on specific port, refer to the table for each repository portRepository Port apify-docs 3000 apify-client-js 3001 apify-client-python 3002 apify-sdk-js 3003 apify-sdk-python 3004 apify-cli 3005 -
To serve them together, setup the nginx server with the following configuration:
server { listen 80; server_name docs.apify.loc; location / { proxy_pass http://localhost:3000; } location /api/client/js { proxy_pass http://localhost:3001; } location /api/client/python { proxy_pass http://localhost:3002; } location /sdk/js { proxy_pass http://localhost:3003; } location /sdk/python { proxy_pass http://localhost:3004; } location /cli { proxy_pass http://localhost:3005; } }
-
Add a record to
/etc/hosts, which maps thedocs.apify.locto a localhost:127.0.0.1 docs.apify.loc
You should be able to open https://docs.apify.loc in your browser and run all the repositories jointly as one project.
The style guide lives in standards/, which is the single source of truth for both people and AI assistants. Rules aren't repeated here, so there's nothing to keep in sync:
standards/style-guide.md- Voice and tone, headings, text formatting, links, numbers, grammar, Apify terminologystandards/page-structure.md- Frontmatter, admonitions, code blocks and code tabs, images, lists, file namingstandards/quality-standards.md- Checklist to run through before opening a pull request
Most of these rules run in CI through Vale. Run vale "<file>" on what you changed before opening a pull request.
AGENTS.md points at the same files rather than restating them, so change a rule in standards/, not in AGENTS.md or here.
This project uses an agent-agnostic approach: standards and workflows live at the repo root, with thin adapter files for each AI tool.
standards/- Writing, formatting, terminology, and quality rules.agents/skills/- Documentation skills with processes, references, and scripts (AgentSkills spec)AGENTS.md- Condensed summary + pointers (alsoCLAUDE.mdvia symlink)
.agents/skills/- Skill definitions following the AgentSkills spec (discoverable by Codex, Gemini CLI, OpenCode, Cursor, and others).claude/skills/- Symlinks to.agents/skills/for Claude Code discovery
.cursor/rules/- Thin pointers tostandards/for Cursor
- Any AI assistant can follow
AGENTS.mdand readstandards/directly - Skills-compatible agents (Claude Code, Codex, Gemini CLI, OpenCode, Cursor): discover skills from
.agents/skills/ - Claude Code users: use
/doc-write,/api-doc,/tutorial,/review-docsskills - Cursor users: rules auto-load via glob patterns on
sources/**/*.mdfiles
- uses
@apify/docs-themepackage - automatic synchronization via CI
- Theme updates trigger rebuilds across all projects
Content lives in the following locations:
- Main content like Platform documentation & Academy:
/sourcesdirectory - API reference: Generated from OpenAPI specs within
/apify-apidirectory - SDK docs: separate repositories
- Client docs: separate repositories
- CLI docs: separate repositories
The API reference documentation at docs.apify.com/api/v2 is built from our OpenAPI specification. The source of truth lives in the /apify-api/openapi directory.
We use the following tools for API documentation:
- OpenAPI 3.1.2 - API specification format
- Redocly CLI - Linting and validation of OpenAPI specs
docusaurus-plugin-openapi-docs- Generates MDX docs from OpenAPIdocusaurus-theme-openapi-docs- Renders API reference with interactive explorer
pnpm start- Starts docs preview server including API referencepnpm openapi:lint:redocly- Validates OpenAPI spec with Redocly CLIpnpm api:rebuild- Regenerates API docs from OpenAPI specs
- Navigate to
apify-api/openapi/components/schemas - Create a new file named after your schema
- Define the schema structure
- Reference schema using
$refin other files
Example schema
type: object
properties:
id:
description: The resource ID
readOnly: true
allOf:
-$ref: ./ResourceId.yaml- Navigate to
apify-api/openapi/paths - Create YAML file following the URL structure replacing
/with@ - Place path parameters in curly braces (e.g., {queueId})
- Add path reference to openapi.yaml
Example addition to openapi.yaml file:
'/requests-queues':
$ref: './paths/request-queues/request-queues.yaml'
'/requests-queues/{queueId}':
$ref: './paths/request-queues/request-queues@{queueId}.yaml'Example YAML file request-queues@{queueId}.yaml in the paths/request-queues folder :
get:
tags:
- Request Queues
summary: Get a Request Queue
operationId: requestQueues_get
description: |
You can have a markdown description here.
parameters:
responses:
'200':
'401':
x-code-samples:
- lang: PHP
source:
$ref: ../code_samples/PHP/customers/get.phpOperation IDs must follow this format:
- Generated from path structure and HTTP method
- Use camelCase for object names
- Single object for paths with {id}, plural otherwise
- Underscore separator between object name and action
- Method name in lowercase at the end
Examples:
/requests-queuesGET ->requestQueues_get/requests-queues/{queueId}PUT ->requestQueue_put/actors/{actorId}/runsPOST ->actors_runs_post
- Navigate to the
openapi/code_samplesfolder - Navigate to the
<language>sub-folder - Navigate to the
pathfolder, and add ref to the code sample
Add languages by adding new folders at the appropriate path level.
- Make your changes following the guidelines above
- Test locally using provided pnpm commands
- Submit a pull request to the
masterbranch - Ensure all CI checks pass
-
Basic setup
pnpm install pnpm start
-
Full setup with nginx:
- Clone all documentation repositories
- Configure nginx server
- Update hosts file
- Use
pnpm start:dev
-
Markdown:
pnpm lint:md # Checks for any issues using markdownlint pnpm lint:md:fix # Applies fixes
-
Code:
pnpm lint:code # Checks .js & .ts files pnpm lint:code:fix # Applies fixes
-
Prose:
Vale checks prose against the rules in
standards/, using the apify/vale-rules package pinned in.vale.ini.Installing it locally is optional. The Vale action runs on every pull request and annotates changed files. It only fails on errors, though, so a local run tells you more:
vale sync # first time only, downloads the rule packages vale "path/to/file.md" # everything, including warnings and suggestions
To allow a word the spelling rules reject, add it to
.github/styles/config/vocabularies/Docs/accept.txt.
-
Broken links: Periodic GitHub Action checks broken links by lychee. If the Action fails, we manually fix the issues.
-
API paths:
pnpm test:api-pathschecks that every/v2/...route written insources/exists in the bundled OpenAPI spec and isn't markeddeprecated, so the docs can't teach a route the contract doesn't define or has already superseded. It runs in the OpenAPI checksvalidatejob on every pull request. Build the bundle first (pnpm openapi:build:json) when running it locally. Two common failures: the legacy/v2/acts/prefix, which still responds but is absent from the published contract; and the Actor-scoped single-run and single-build routes such as/v2/actors/{actorId}/runs/{runId}, which are deprecated in favor of/v2/actor-runs/{runId}and/v2/actor-builds/{buildId}. Note that the run and build collection routes (/v2/actors/{actorId}/runs) are current - only the singular forms moved. -
Academy exercises: At the end of each lesson in the academy courses, there are exercises that target real-world websites. Each exercise includes a solution, stored as a separate file containing executable code. These files are included in the docs using the
!!raw-loadersyntax. Each course has a Bats test file namedtest.bats. The tests run each solution as a standalone program and verify that it produces output matching the expected results. A periodic GitHub Action runs all these tests usingpnpm test:academy. If the Action fails, we rework the exercises.
- Title follows Conventional Commits - CI enforces it
- Description is one or two sentences: what changed and why. Skip boilerplate headings (
## Summary,## Changes) and bullet lists that restate the diff - the diff is the record of what changed, the description explains the why..github/pull_request_template.mdrepeats this as a reminder in the PR form - All CI checks pass
- Automatic deployment on merge to
master - Builds deploy to appropriate subdomains
- Updates trigger theme synchronization