Problem
INPUT_SCHEMA.json is the most tedious part of publishing an Apify Actor. Developers typically:
- Write their Actor code with hardcoded or
process.env-style inputs
- Manually inspect the code to figure out what inputs exist
- Hand-write
INPUT_SCHEMA.json from scratch, often getting field types or required flags wrong
- Iterate because
apify validate-schema or the platform build rejects it
This friction prevents many Actors from ever getting published with a proper schema.
Proposal
Add a new command that reads your Actor code and generates a draft INPUT_SCHEMA.json:
apify actor generate-schema
What it does
- Reads
src/main.js (or main.py, src/main.ts, etc.) from the current Actor directory
- Extracts input references:
input.url, Actor.getInput(), process.env.APIFY_*, argparse args, etc.
- Sends the relevant code snippets to an LLM with a schema generation prompt
- Writes a draft
.actor/INPUT_SCHEMA.json
- Runs
apify validate-schema on the result and reports any issues
Example
$ apify actor generate-schema
Reading src/main.js...
Found input references:
input.startUrl (string, used in fetch call)
input.maxPages (number, default 10)
input.proxyConfig (object, passed to ProxyConfiguration)
Generating INPUT_SCHEMA.json...
✓ Written to .actor/INPUT_SCHEMA.json
Validating...
✓ Schema is valid
Review .actor/INPUT_SCHEMA.json and adjust descriptions before pushing.
Generated schema (example)
{
"title": "My Actor",
"description": "Auto-generated schema — review before publishing",
"type": "object",
"schemaVersion": 1,
"properties": {
"startUrl": {
"title": "Start URL",
"type": "string",
"description": "The URL to start scraping from",
"editor": "textfield"
},
"maxPages": {
"title": "Max pages",
"type": "integer",
"description": "Maximum number of pages to scrape",
"default": 10
}
},
"required": ["startUrl"]
}
Why it matters
Open questions
- Which LLM / API to call (Apify-hosted vs user brings API key)?
- Support for Python (
Actor.get_input(), typer, argparse)?
- Should it update an existing schema or only create from scratch?
Related
Problem
INPUT_SCHEMA.jsonis the most tedious part of publishing an Apify Actor. Developers typically:process.env-style inputsINPUT_SCHEMA.jsonfrom scratch, often getting field types or required flags wrongapify validate-schemaor the platform build rejects itThis friction prevents many Actors from ever getting published with a proper schema.
Proposal
Add a new command that reads your Actor code and generates a draft
INPUT_SCHEMA.json:What it does
src/main.js(ormain.py,src/main.ts, etc.) from the current Actor directoryinput.url,Actor.getInput(),process.env.APIFY_*, argparse args, etc..actor/INPUT_SCHEMA.jsonapify validate-schemaon the result and reports any issuesExample
$ apify actor generate-schema Reading src/main.js... Found input references: input.startUrl (string, used in fetch call) input.maxPages (number, default 10) input.proxyConfig (object, passed to ProxyConfiguration) Generating INPUT_SCHEMA.json... ✓ Written to .actor/INPUT_SCHEMA.json Validating... ✓ Schema is valid Review .actor/INPUT_SCHEMA.json and adjust descriptions before pushing.Generated schema (example)
{ "title": "My Actor", "description": "Auto-generated schema — review before publishing", "type": "object", "schemaVersion": 1, "properties": { "startUrl": { "title": "Start URL", "type": "string", "description": "The URL to start scraping from", "editor": "textfield" }, "maxPages": { "title": "Max pages", "type": "integer", "description": "Maximum number of pages to scrape", "default": 10 } }, "required": ["startUrl"] }Why it matters
apify create --from-url(feat: apify create --from-url <website> — AI generates Actor scaffold from a target URL #1440) andapify actors expose-as-mcp(feat: expose any Actor as an MCP tool — apify actors expose-as-mcp #1439)Open questions
Actor.get_input(),typer,argparse)?Related
apify create --from-url(AI scaffold generation)apify validate-schemapasses schemas the platform rejects (validation gap)