apify-generate-output-schema

Generate dataset, output, and key-value store schemas for Apify Actors from source code.

Updated Jun 18, 2026
One-click install
npx skills add https://github.com/apify/apify-grok-build-plugin --skill apify-generate-output-schema-apify
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: apify-generate-output-schema
Source: https://github.com/apify/apify-grok-build-plugin/tree/main/skills/apify-generate-output-schema
Command: npx skills add https://github.com/apify/apify-grok-build-plugin --skill apify-generate-output-schema-apify

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Apify Actors need output schema files so the Apify Console knows how to display run results, but writing dataset_schema.json, output_schema.json, and key_value_store_schema.json by hand is error-prone and requires deep knowledge of Apify-specific JSON Schema conventions. ## Core Features & Use Cases - Source Code Analysis: Scans the Actor's code for pushData/setValue calls and existing TypeScript interfaces or Python type definitions to derive every output field. - Schema Generation: Produces dataset_schema.json with field definitions and display views, output_schema.json with result templates, and key_value_store_schema.json with collections when the Actor uses the key-value store. - Configuration Wiring: Updates actor.json to reference the generated schema files and migrates inline storage definitions. - Use Case: You built an Actor that scrapes product listings and pushes results to a dataset. Run this Skill to generate a complete dataset schema with anonymized examples, nullable fields, and an overview view, then validate it against the checklist before committing. ## Quick Start Analyze my Actor's source code and generate the dataset, output, and key-value store schema files, then update actor.json to reference them.

Frequently Asked Questions about apify-generate-output-schema

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a dataset_schema.json for an Apify Actor?▼

Analyze the Actor's source code for Actor.pushData or push_data calls and existing type definitions, then create dataset_schema.json with every output field in fields.properties. Each field needs a type, description, nullable set to true, and an anonymized example.

What files does an Apify Actor output schema include?▼

An Actor output schema typically includes dataset_schema.json for dataset fields and views, output_schema.json pointing to result storage URLs, and key_value_store_schema.json if the Actor writes to the key-value store. All are referenced from actor.json.

Does the Apify dataset schema support TypeScript types?▼

Yes, when the Actor defines output interfaces or types in TypeScript, the schema fields should be derived directly from those definitions rather than re-analyzing pushData calls. The type definition is treated as the canonical source of field names and types.

Why does my Apify schema validation fail with nullable fields?▼

AJV rejects a nullable property without a type on the same field, so every field must declare both. Also ensure the top-level fields object and every nested object include required as an empty array and additionalProperties set to true.

When should I create a key_value_store_schema.json?▼

Create it only when the Actor calls Actor.setValue or set_value beyond the default INPUT key. Group fixed keys into collections using key, and dynamic prefixed keys using keyPrefix, optionally restricting contentTypes.