
got
A Node.js library for making HTTP requests, with retries, timeouts, and JSON support.
- Stars
- 15k
- Forks
- 1k
- Licence
- MIT
- Language
- TypeScript
- Last update
- 7 days ago
- Type
- Library
What it is
Got is a JavaScript library that lets Node.js programs send HTTP requests to web servers and APIs. It handles common chores such as JSON bodies, retries on failure, timeouts, redirects, and progress events so you write less boilerplate. The README also points readers to Ky, a related library by the same author, for most users who need browser support or a smaller package.
- Send a POST request with a JSON body and read the JSON response
- Make API calls that retry automatically when requests fail
- Stream large responses and track download or upload progress
- Paginate through results from an API using the pagination API
- Route requests through a proxy or Unix domain socket
Great for
- Node.js developers who call web APIs from server-side code
- Projects that need built-in retries, advanced timeouts, or pagination helpers
- Developers who want HTTP/2, caching, or Unix socket support in one library
- Teams already using Got who want its plugins such as got-scraping or gh-got
Not ideal for
- Browser-only projects, since the comparison table marks browser support as unsupported; the README suggests Ky instead
- Projects that use CommonJS, since the package is native ESM with no CommonJS export and the README suggests converting to ESM
- Anyone needing Got v11 support, since the README says v11 is no longer maintained
How to get it
- 1
Install with a package manager
You'll need: Node.js
Install the package from npm
npm install got - 2
Run it
- Install the package with npm install got in a project that uses ES modules.
- Create a file that uses import got from 'got'.
- Call got.post or got.get with a URL and options.
- Run the file with Node.js and read the printed response.
- 3
Get the most out of it
- Use the json option and .json() method to send and parse JSON without manual stringifying
- Set options.retry.limit to 0 if you want to turn off the default retry behavior
- Read the Tips page in the documentation for proxy, AWS, and testing examples
- Use instances or hooks to share default settings across many requests
- Explore the plugins listed in the README, such as gh-got for GitHub API calls
Downloads
Strengths
- Feature-rich, with retries, timeouts, hooks, instances, and caching listed in the README
- Documented with a quick start, options reference, and migration guides from Axios and Request
- Actively maintained according to the README, with a large dependent count it reports
Trade-offs
- Node.js only; the comparison table marks browser support as not available
- Native ESM only, which may require converting older CommonJS projects
- The README itself recommends Ky for many users, so Got may not be the first choice for simple needs
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| got (this) | 15k | Library | beginner | 7 days ago | Node.js developers who call web APIs from server-side code |
| ky | 17.1k | Library | beginner | 28 days ago | JavaScript or TypeScript developers who already use fetch and want less boilerplate |
| axios | 109k | Library | beginner | 4 days ago | JavaScript developers calling REST or other HTTP APIs from a browser front end |
| superagent | 16.6k | Library | beginner | 1 months ago | JavaScript developers who want one HTTP client API that works in both Node.js and browsers |
| cpp-httplib | 17k | Library | beginner | 6 days ago | C++ developers who need a simple embedded HTTP server or client without a large framework |
| yaak | 19.4k | App | beginner | 4 days ago | Developers who want a desktop client for REST, GraphQL, gRPC, WebSocket or SSE in one place |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.