Instantly generate TypeScript interfaces from JSON.

Generate TypeScript interfaces with runtime validation
code from JSON, JSON Schema, and GraphQL queries.

Generate TypeScript NowInstall VSCode Extension

Run quicktype from the command line.

Install quicktype with npm
$ npm install -g quicktype$ npm install -g quicktype
Generate TypeScript for a simple JSON sample$ echo '[1, 2, 3.14]' | quicktype --lang ts
$ echo '[1, 2, 3.14]' \    | quicktype --lang ts
Generate TypeScript for a sample JSON file
$ quicktype person.json -o Person.ts$ quicktype person.json -o Person.ts
Generate TypeScript with runtime typechecks for a Bitcoin API$ quicktype https://blockchain.info/latestblock -o LatestBlock.ts
$ quicktype -o LatestBlock.ts \    https://blockchain.info/latestblock
Generate TypeScript from a directory of samples
$ ls spotify-api-samples$ ls spotify-api-samples
album.json artist.json track.json$ quicktype spotify-api-samples -o SpotifyClient.ts
$ quicktype -o SpotifyClient.ts \    spotify-api-samples
Generate TypeScript from a Postman Collection$ quicktype ImgurAPI_postman_collection.json -l postman -o Imgur.ts
$ quicktype -o Imgur.ts \    -l postman \    ImgurAPI_postman_collection.json

A better way to work with APIs.

The old way

Find a client library
A good one is golden, however most are outdated or simply unavailable in your app’s programming language.
Write your own client library
Takes a lot of effort and must be updated when the API changes. You should be focused on your app, anyway.
Read API data as dynamic, untyped values
This is an unpleasant way to program and leaves your app vulnerable to API changes.

With quicktype

Generate your client libraries
Given sample API responses, quicktype will generate an easy-to-use client library in your app’s language.
Spend more time on your app
quicktype can regenerate types when APIs change, so you can simply update affected app code, if any.
Access strongly typed API data with help
Get more out of your editor or IDE (autocomplete, refactoring) when working with typed API data.