JSON to TypeScript API - Generate Interfaces from JSON
Infers field types from the provided JSON: strings become string, numbers become number, booleans become boolean, null becomes null, arrays recurse into T[], nested objects become inline interfaces. Keys with special characters are quoted. Cycles are broken with Record<string, unknown>.
Code examples
curl -X POST https://api.botoi.com/v1/schema/json-to-typescript \
-H "Content-Type: application/json" \
-d '{"json":{"id":1,"name":"Ada","active":true,"tags":["admin"]},"name":"User"}'When to use this API
Generate types from third-party API responses
Paste a sample response from the Stripe or GitHub API, generate the interface, and drop it into your codebase. No manual typing of 30-field JSON structures.
Scaffold types for new endpoints
When designing an endpoint, sketch the response as JSON, convert to TypeScript, and use the interface as the starting point for both server types and SDK types.
Migrate from untyped to typed
For each fixture JSON file in your test suite, generate a corresponding interface. Replaces tribal-knowledge shape docs with machine-checked types.
Frequently asked questions
What is inferred for null values?
How are arrays with mixed types handled?
Will it generate optional fields?
How are cycles handled?
Can I generate multiple interfaces?
Get your API key
Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.