Sindre's open source work is supported by the community.
Special thanks to:
Human-friendly and powerful HTTP request library for Node.js
See how Got compares to other HTTP libraries
You probably want Ky instead, by the same people. It's smaller, works in the browser too, and is more stable since it's built on Fetch. Or fetch-extras for simple needs.
Support questions should be asked here.
npm install gotWarning: This package is native ESM and no longer provides a CommonJS export. If your project uses CommonJS, you will have to convert to ESM. Please don't open issues for questions regarding CommonJS / ESM.
Got v11 is no longer maintained and we will not accept any backport requests.
A quick start guide is available.
Got has a dedicated option for handling JSON payload.
Furthermore, the promise exposes a .json<T>() function that returns Promise<T>.
import got from 'got';
const {data} = await got.post('https://httpbin.org/anything', {
json: {
hello: 'world'
}
}).json();
console.log(data);
//=> {"hello": "world"}For advanced JSON usage, check out the parseJson and stringifyJson options.
For more useful tips like this, visit the Tips page.
By default, Got will retry on failure. To disable this option, set options.retry.limit to 0.
got4aws- Got convenience wrapper to interact with AWS v4 signed APIsgh-got- Got convenience wrapper to interact with the GitHub APIgl-got- Got convenience wrapper to interact with the GitLab APIgotql- Got convenience wrapper to interact with GraphQL using JSON-parsed queries instead of stringsgot-fetch- Got with afetchinterfacegot-scraping- Got wrapper specifically designed for web scraping purposesgot-ssrf- Got wrapper to protect server-side requests against SSRF attacks
got |
node-fetch |
ky |
axios |
superagent |
|
|---|---|---|---|---|---|
| HTTP/2 support | βοΈ | β | βοΈ | β | βοΈ** |
| Browser support | β | βοΈ* | βοΈ | βοΈ | βοΈ |
| Promise API | βοΈ | βοΈ | βοΈ | βοΈ | βοΈ |
| Stream API | βοΈ | Node.js only | β | β | βοΈ |
| Pagination API | βοΈ | β | β | β | β |
| Request aborting | βοΈ | βοΈ | βοΈ | βοΈ | βοΈ |
| RFC 7234 caching | βοΈ | β | β | β | β |
| Cookies (out-of-the-box) | βοΈ | β | β | β | β |
| Follows redirects | βοΈ | βοΈ | βοΈ | βοΈ | βοΈ |
| Retries on failure | βοΈ | β | βοΈ | β | βοΈ |
| Progress events | βοΈ | β | βοΈ | Browser only | βοΈ |
| Handles gzip/deflate | βοΈ | βοΈ | βοΈ | βοΈ | βοΈ |
| Advanced timeouts | βοΈ | β | β | β | β |
| Timings | βοΈ | β | β | β | β |
| Errors with metadata | βοΈ | β | βοΈ | βοΈ | β |
| JSON mode | βοΈ | βοΈ | βοΈ | βοΈ | βοΈ |
| Custom defaults | βοΈ | β | βοΈ | βοΈ | β |
| Composable | βοΈ | β | β | β | βοΈ |
| Hooks | βοΈ | β | βοΈ | βοΈ | β |
| Issues open | |||||
| Issues closed | |||||
| Downloads | |||||
| Coverage | TBD | ||||
| Build | |||||
| Bugs | |||||
| Dependents | |||||
| Install size | |||||
| GitHub stars | |||||
| TypeScript support | |||||
| Last commit |
* It's almost API compatible with the browser fetch API.
** Need to switch the protocol manually. Doesn't accept PUSH streams and doesn't reuse HTTP/2 sessions.
βοΈ Almost-stable feature, but the API may change. Don't hesitate to try it out!
β Feature in early stage of development. Very experimental.
Click here to see the install size of the Got dependencies.
![]() |
![]() |
|---|---|
| Sindre Sorhus | Szymon Marczak |

