Analysis updated 2026-06-24
Make API calls from a browser or Node.js/Bun/Deno app without writing boilerplate fetch code each time
Retry failed HTTP requests automatically with a single configuration option on a ky instance
Validate API responses against a Zod or Valibot schema right when you parse the JSON response
Share a base URL and default headers across all requests by creating a named ky instance
| sindresorhus/ky | lyswhut/lx-music-mobile | graphql/graphiql | |
|---|---|---|---|
| Stars | 16,849 | 16,840 | 16,827 |
| Language | TypeScript | TypeScript | TypeScript |
| Setup difficulty | easy | moderate | moderate |
| Complexity | 2/5 | 3/5 | 3/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Ky is a small JavaScript library for making HTTP requests, the kind of calls a web app or script makes to fetch data from an API or send data to a server. It is built on top of the Fetch API, which is the modern, browser-native way to do this, and it works in modern browsers as well as in the Node.js, Bun, and Deno server runtimes. The whole package has no dependencies of its own, so adding it does not pull in a tree of extra code. The point of Ky is to smooth over the rough edges of plain fetch. With raw fetch, you have to write boilerplate every time: set headers, serialize JSON yourself, check the response status, and throw your own error class. Ky wraps all of that into a friendlier shape. There are method shortcuts like ky.post and ky.get, a json option that handles serialization and the correct header automatically, and any response outside the 200-299 success range is treated as an error and thrown for you. It also retries failed requests, supports timeouts, exposes upload and download progress, lets you set a base URL for an instance, and offers hooks for customizing behavior at various points in a request. Responses can be validated against a Standard Schema (with libraries like Zod or Valibot) directly when you call .json(), and the TypeScript types are sharper than fetch's, for instance.json() defaults to unknown instead of any. You would reach for Ky whenever you need to talk to an HTTP API from JavaScript or TypeScript and want a cleaner experience than raw fetch without committing to a heavier client. It is written in TypeScript and installed via npm, or imported from a CDN for Deno. The full README is longer than what was provided.
Small JavaScript/TypeScript library that wraps the browser's fetch API to make HTTP requests cleaner, handles JSON serialization, error throwing, retries, timeouts, and upload/download progress automatically.
Mainly TypeScript. The stack also includes TypeScript, JavaScript, Fetch API.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.