- Home
- Skills
- APIs & Backend
- api response schema extractor
api response schema extractor
Generate JSON Schema, TypeScript interfaces, and Python TypedDicts from live API responses or local JSON files.
Free
Works with the AI Agents you already use
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
- Add descriptions to the JSON Schema properties to document field purposes.
- Run with
--mergeusing additional samples to identify which fields (liketheme) might be optional. - Use the
--save UserProfileflag 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
- Provide source data via a live URL, a single JSON file, or a directory of multiple JSON files.
- Execute extraction using the
--mergeflag if multiple files are provided to improve optional-field accuracy. - Customize output by specifying the root type name and selecting which language definitions to generate.
- 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
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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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