api response schema extractor

    1

    Generate JSON Schema, TypeScript interfaces, and Python TypedDicts from live API responses or local JSON files.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    api response schema extractor

    Example session with this skill installed

    Extract schema and types from user_profile.json. Use 'UserProfile' as the root name.

    • Read your context and instructions
    • Compiled the api response schema

    I have extracted the schema and type definitions from user_profile.json. Based on the single sample provided, all detected fields are currently marked as required. For better accuracy regarding optional fields, I recommend merging multiple response samples in the future.

    UserProfile Definitions

    JSON Schema

    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "title": "UserProfile",
      "type": "object",
      "properties": {
        "id": { "type": "integer" },
        "username": { "type": "string" },
        "email": { "type": "string" },
        "settings": {
          "type": "object",
          "properties": {
            "notifications": { "type": "boolean" },
            "theme": { "type": "string" }
          },
          "required": ["notifications", "theme"]
        }
      },
      "required": ["id", "username", "email", "settings"]
    }
    

    TypeScript Interface

    export interface UserProfile {
      id: number;
      username: string;
      email: string;
      settings: {
        notifications: boolean;
        theme: string;
      };
    }
    

    Python TypedDict

    from typing import TypedDict
    
    class UserProfileSettings(TypedDict):
        notifications: bool
        theme: str
    
    class UserProfile(TypedDict):
        id: int
        username: str
        email: str
        settings: UserProfileSettings
    

    Next steps

    1. Add descriptions to the JSON Schema properties to document field purposes.
    2. Run with --merge using additional samples to identify which fields (like theme) might be optional.
    3. Use the --save UserProfile flag to write these definitions directly to your source tree.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Manual type definitions are tedious and error-prone when dealing with undocumented APIs. This skill automates the extraction of JSON Schema, TypeScript interfaces, and Python TypedDicts directly from live endpoints or local JSON files.

    What it does

    • Infer schemas by analyzing real JSON responses from URLs or local storage.
    • Generate multiple types including JSON Schema (Draft 7), TypeScript interfaces, and Python TypedDicts in a single pass.
    • Detect optional fields by merging multiple response samples to identify which keys are inconsistent across datasets.
    • Support complex structures including deeply nested objects, mixed-type arrays, and scalar types.
    • Handle authentication by passing custom headers like Bearer tokens for live API requests.

    How it works

    1. Provide source data via a live URL, a single JSON file, or a directory of multiple JSON files.
    2. Execute extraction using the --merge flag if multiple files are provided to improve optional-field accuracy.
    3. Customize output by specifying the root type name and selecting which language definitions to generate.
    4. Export results to the console or save them directly to files for immediate integration into your codebase.

    Frameworks & tools

    This tool is built for Python 3.8+ environments. It generates code compatible with TypeScript (modern interfaces) and Python (TypedDict with support for typing_extensions on older versions).

    Why this beats prompting it yourself

    LLMs often hallucinate types or miss nested nullability when prompted with raw JSON. This skill uses deterministic logic to map types and enforces strict optional-field detection through multi-sample merging that a single prompt cannot reliably replicate.

    Use cases

    • Generate types for a third-party API that has no official SDK or documentation.
    • Update internal type definitions after an upstream API response structure changes.
    • Create validation schemas for incoming webhooks based on captured payloads.
    • Scaffold data models for a new service by using sample JSON as the source of truth.

    Known limitations

    Does not support $ref or allOf keywords as output is fully inline. Accuracy of optional fields depends on the variety of samples provided during the merge process.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.

    Requires Python 3.8+. No support for $ref or allOf; all outputs are inlined. Requires manual filling of generated description fields.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 3 days ago

    • Free with an Agensi account

    Software
    Python

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Network Access
    Listed3 days ago

    What's inside

    Frequently Asked Questions

    This skill eliminates the manual labor of hand-coding types for undocumented APIs by using deterministic logic to generate accurate JSON Schema, TypeScript interfaces, and Python TypedDicts from raw JSON data. Unlike manual prompting, it uses multi-sample merging to accurately identify optional versus required fields.

    The skill requires a Python 3.8+ environment and is designed to integrate seamlessly with AI agents capable of executing Python scripts or CLI tools. It is ideal for developers using agents to build API integrations or data processing pipelines.

    Yes, the skill includes a header-handling feature that allows you to pass authentication tokens, such as Bearer or API keys, directly to live endpoints during the extraction process.

    By providing a directory of multiple JSON samples and using the `--merge` flag, the skill compares keys across all files to detect which fields are consistently present and which are intermittent, marking the latter as optional in the generated code.

    Upon purchase, you receive the full skill package including the extraction engine, documentation for CLI and programmatic usage, and example datasets to help you get started immediately.

    The tool currently generates fully inline definitions and does not support circular references or complex schema keywords like `$ref` or `allOf`. It is optimized for clean, flat-to-nested type definitions used in standard web development.

    New in APIs & Backend

    Free