got
Simplified HTTP/HTTPS requests
Last updated 10 years ago by floatdrop .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install got 
SYNC missed versions from official npm registry.


Got


Sindre's open source work is supported by the community.
Special thanks to:






Strapi
Strapi is the leading open-source headless CMS.
It’s 100% JavaScript, fully customizable, and developer-first.



SerpApi
API to get search engine results with ease.
SerpApi
API to get search engine results with ease.





Fame Helsinki Fame Helsinki






Human-friendly and powerful HTTP request library for Node.js

Downloads Install size

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 upon Fetch.


Support questions should be asked here.

Install

npm install got

Warning: 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.

Take a peek

A quick start guide is available.

JSON mode

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.

Highlights

Documentation

By default, Got will retry on failure. To disable this option, set options.retry.limit to 0.

Main API

Timeouts and retries

Advanced creation

Cache, Proxy and UNIX sockets

Integration


Migration guides

Got plugins

  • got4aws - Got convenience wrapper to interact with AWS v4 signed APIs
  • gh-got - Got convenience wrapper to interact with the GitHub API
  • gl-got - Got convenience wrapper to interact with the GitLab API
  • gotql - Got convenience wrapper to interact with GraphQL using JSON-parsed queries instead of strings
  • got-fetch - Got with a fetch interface
  • got-scraping - Got wrapper specifically designed for web scraping purposes
  • got-ssrf - Got wrapper to protect server-side requests against SSRF attacks

Comparison

got node-fetch ky axios superagent
HTTP/2 support :heavy_check_mark:¹ :x: :x: :x: :heavy_check_mark:**
Browser support :x: :heavy_check_mark:* :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
Promise API :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
Stream API :heavy_check_mark: Node.js only :x: :x: :heavy_check_mark:
Pagination API :heavy_check_mark: :x: :x: :x: :x:
Request cancelation :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
RFC compliant caching :heavy_check_mark: :x: :x: :x: :x:
Cookies (out-of-the-box) :heavy_check_mark: :x: :x: :x: :x:
Follows redirects :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
Retries on failure :heavy_check_mark: :x: :heavy_check_mark: :x: :heavy_check_mark:
Progress events :heavy_check_mark: :x: :heavy_check_mark:*** Browser only :heavy_check_mark:
Handles gzip/deflate :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
Advanced timeouts :heavy_check_mark: :x: :x: :x: :x:
Timings :heavy_check_mark: :x: :x: :x: :x:
Errors with metadata :heavy_check_mark: :x: :heavy_check_mark: :heavy_check_mark: :x:
JSON mode :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
Custom defaults :heavy_check_mark: :x: :heavy_check_mark: :heavy_check_mark: :x:
Composable :heavy_check_mark: :x: :x: :x: :heavy_check_mark:
Hooks :heavy_check_mark: :x: :heavy_check_mark: :heavy_check_mark: :x:
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.
*** Currently, only DownloadProgress event is supported, UploadProgress event is not supported.
¹ Requires Node.js 15.10.0 or above.
:sparkle: Almost-stable feature, but the API may change. Don't hesitate to try it out!
:grey_question: Feature in early stage of development. Very experimental.

Click here to see the install size of the Got dependencies.

Maintainers

Sindre Sorhus Szymon Marczak
Sindre Sorhus Szymon Marczak

These amazing companies are using Got


Segment is a happy user of Got! Got powers the main backend API that our app talks to. It's used by our in-house RPC client that we use to communicate with all microservices.

Vadim Demedes

Antora, a static site generator for creating documentation sites, uses Got to download the UI bundle. In Antora, the UI bundle (aka theme) is maintained as a separate project. That project exports the UI as a zip file we call the UI bundle. The main site generator downloads that UI from a URL using Got and streams it to vinyl-zip to extract the files. Those files go on to be used to create the HTML pages and supporting assets.

Dan Allen

GetVoIP is happily using Got in production. One of the unique capabilities of Got is the ability to handle Unix sockets which enables us to build a full control interfaces for our docker stack.

Daniel Kalen

We're using Got inside of Exoframe to handle all the communication between CLI and server. Exoframe is a self-hosted tool that allows simple one-command deployments using Docker.

Tim Ermilov

Karaoke Mugen uses Got to fetch content updates from its online server.

Axel Terizaki

Renovate uses Got, gh-got and gl-got to send millions of queries per day to GitHub, GitLab, npmjs, PyPi, Packagist, Docker Hub, Terraform, CircleCI, and more.

Rhys Arkins

Resistbot uses Got to communicate from the API frontend where all correspondence ingresses to the officials lookup database in back.

Chris Erickson

Natural Cycles is using Got to communicate with all kinds of 3rd-party REST APIs (over 9000!).

Kirill Groshkov

Microlink is a cloud browser as an API service that uses Got widely as the main HTTP client, serving ~22M requests a month, every time a network call needs to be performed.

Kiko Beats

We’re using Got at Radity. Thanks for such an amazing work!

Mirzayev Farid

Got has been a crucial component of Apify's scraping for years. We use it to extract data from billions of web pages every month, and we really appreciate the powerful API and extensibility, which allowed us to build our own specialized HTTP client on top of Got. The support has always been stellar too.

Ondra Urban

Current Tags

  • 14.4.4                                ...           latest (11 days ago)
  • 11.8.6                                ...           version-11 (2 years ago)

178 Versions

  • 14.4.4                                ...           11 days ago
  • 14.4.3                                ...           a month ago
  • 14.4.2                                ...           4 months ago
  • 14.4.1                                ...           5 months ago
  • 14.4.0                                ...           5 months ago
  • 14.3.0                                ...           6 months ago
  • 14.2.1                                ...           8 months ago
  • 14.2.0                                ...           9 months ago
  • 14.1.0                                ...           10 months ago
  • 14.0.0                                ...           a year ago
  • 13.0.0                                ...           a year ago
  • 12.6.1                                ...           a year ago
  • 12.6.0                                ...           2 years ago
  • 11.8.6                                ...           2 years ago
  • 12.5.3                                ...           2 years ago
  • 12.5.2                                ...           2 years ago
  • 12.5.1                                ...           2 years ago
  • 12.5.0                                ...           2 years ago
  • 12.4.1                                ...           2 years ago
  • 12.4.0                                ...           2 years ago
  • 12.3.1                                ...           2 years ago
  • 12.3.0                                ...           2 years ago
  • 12.2.0                                ...           2 years ago
  • 12.1.0                                ...           2 years ago
  • 11.8.5                                ...           2 years ago
  • 12.0.4                                ...           3 years ago
  • 12.0.3                                ...           3 years ago
  • 12.0.2                                ...           3 years ago
  • 12.0.1                                ...           3 years ago
  • 12.0.0                                ...           3 years ago
  • 11.8.3                                ...           3 years ago
  • 12.0.0-beta.4                                ...           3 years ago
  • 12.0.0-beta.3                                ...           3 years ago
  • 12.0.0-beta.2                                ...           3 years ago
  • 12.0.0-beta.1                                ...           3 years ago
  • 11.8.2                                ...           4 years ago
  • 11.8.1                                ...           4 years ago
  • 11.8.0                                ...           4 years ago
  • 11.7.0                                ...           4 years ago
  • 11.6.2                                ...           4 years ago
  • 11.6.1                                ...           4 years ago
  • 11.6.0                                ...           4 years ago
  • 11.5.2                                ...           4 years ago
  • 11.5.1                                ...           4 years ago
  • 11.5.0                                ...           4 years ago
  • 11.4.0                                ...           4 years ago
  • 11.3.0                                ...           4 years ago
  • 11.2.0                                ...           4 years ago
  • 11.1.4                                ...           4 years ago
  • 11.1.3                                ...           5 years ago
  • 11.1.2                                ...           5 years ago
  • 11.1.1                                ...           5 years ago
  • 11.1.0                                ...           5 years ago
  • 11.0.3                                ...           5 years ago
  • 11.0.2                                ...           5 years ago
  • 11.0.1                                ...           5 years ago
  • 11.0.0                                ...           5 years ago
  • 11.0.0-beta.1                                ...           5 years ago
  • 10.7.0                                ...           5 years ago
  • 10.6.0                                ...           5 years ago
  • 10.5.7                                ...           5 years ago
  • 10.5.6                                ...           5 years ago
  • 10.5.5                                ...           5 years ago
  • 10.5.4                                ...           5 years ago
  • 10.5.3                                ...           5 years ago
  • 10.5.2                                ...           5 years ago
  • 10.5.1                                ...           5 years ago
  • 10.5.0                                ...           5 years ago
  • 10.4.0                                ...           5 years ago
  • 10.3.0                                ...           5 years ago
  • 10.2.2                                ...           5 years ago
  • 10.2.1                                ...           5 years ago
  • 10.2.0                                ...           5 years ago
  • 10.1.0                                ...           5 years ago
  • 10.0.4                                ...           5 years ago
  • 10.0.3                                ...           5 years ago
  • 10.0.2                                ...           5 years ago
  • 10.0.1                                ...           5 years ago
  • 10.0.0                                ...           5 years ago
  • 10.0.0-beta.3                                ...           5 years ago
  • 10.0.0-beta.2                                ...           5 years ago
  • 10.0.0-beta.1                                ...           5 years ago
  • 10.0.0-alpha.3.2                                ...           5 years ago
  • 10.0.0-alpha.3.1                                ...           5 years ago
  • 10.0.0-alpha.2.2                                ...           5 years ago
  • 10.0.0-alpha.2.1                                ...           5 years ago
  • 10.0.0-alpha.2                                ...           5 years ago
  • 10.0.0-alpha.1.1                                ...           5 years ago
  • 9.6.0                                ...           6 years ago
  • 9.5.1                                ...           6 years ago
  • 9.5.0                                ...           6 years ago
  • 9.4.0                                ...           6 years ago
  • 9.3.2                                ...           6 years ago
  • 9.3.1                                ...           6 years ago
  • 9.3.0                                ...           6 years ago
  • 9.2.2                                ...           6 years ago
  • 9.2.1                                ...           6 years ago
  • 9.2.0                                ...           6 years ago
  • 9.1.0                                ...           6 years ago
  • 9.0.0                                ...           6 years ago
  • 8.3.2                                ...           6 years ago
  • 8.3.1                                ...           7 years ago
  • 8.3.0                                ...           7 years ago
  • 8.2.0                                ...           7 years ago
  • 8.1.0                                ...           7 years ago
  • 8.0.3                                ...           7 years ago
  • 8.0.2                                ...           7 years ago
  • 8.0.1                                ...           7 years ago
  • 8.0.0                                ...           7 years ago
  • 7.1.0                                ...           7 years ago
  • 7.0.0                                ...           7 years ago
  • 6.7.1                                ...           8 years ago
  • 6.7.0                                ...           8 years ago
  • 6.6.3                                ...           8 years ago
  • 6.6.2                                ...           8 years ago
  • 5.7.1                                ...           8 years ago
  • 6.6.1                                ...           8 years ago
  • 6.6.0                                ...           8 years ago
  • 5.7.0                                ...           8 years ago
  • 6.5.0                                ...           8 years ago
  • 6.3.0                                ...           9 years ago
  • 5.6.0                                ...           9 years ago
  • 5.5.1                                ...           9 years ago
  • 5.5.0                                ...           9 years ago
  • 6.2.0                                ...           9 years ago
  • 5.4.2                                ...           9 years ago
  • 6.1.2                                ...           9 years ago
  • 6.1.1                                ...           9 years ago
  • 5.4.1                                ...           9 years ago
  • 6.1.0                                ...           9 years ago
  • 5.4.0                                ...           9 years ago
  • 6.0.2                                ...           9 years ago
  • 5.3.2                                ...           9 years ago
  • 5.3.1                                ...           9 years ago
  • 6.0.1                                ...           9 years ago
  • 6.0.0                                ...           9 years ago
  • 5.3.0                                ...           9 years ago
  • 5.2.1                                ...           9 years ago
  • 6.0.0-rc1                                ...           9 years ago
  • 5.2.0                                ...           9 years ago
  • 5.1.0                                ...           9 years ago
  • 5.0.0                                ...           9 years ago
  • 4.2.0                                ...           9 years ago
  • 4.1.1                                ...           9 years ago
  • 4.1.0                                ...           9 years ago
  • 4.0.0                                ...           9 years ago
  • 3.3.1                                ...           9 years ago
  • 3.3.0                                ...           9 years ago
  • 3.2.0                                ...           10 years ago
  • 3.1.0                                ...           10 years ago
  • 3.0.0                                ...           10 years ago
  • 2.9.2                                ...           10 years ago
  • 2.9.1                                ...           10 years ago
  • 2.9.0                                ...           10 years ago
  • 2.8.1                                ...           10 years ago
  • 2.8.0                                ...           10 years ago
  • 2.7.2                                ...           10 years ago
  • 2.7.1                                ...           10 years ago
  • 2.7.0                                ...           10 years ago
  • 2.6.0                                ...           10 years ago
  • 2.5.0                                ...           10 years ago
  • 2.4.0                                ...           10 years ago
  • 2.3.2                                ...           10 years ago
  • 2.3.1                                ...           10 years ago
  • 2.3.0                                ...           10 years ago
  • 2.2.0                                ...           10 years ago
  • 2.1.0                                ...           10 years ago
  • 2.0.0                                ...           10 years ago
  • 1.2.2                                ...           10 years ago
  • 1.2.1                                ...           10 years ago
  • 1.2.0                                ...           10 years ago
  • 1.1.0                                ...           10 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
  • 0.3.0                                ...           11 years ago
  • 0.2.0                                ...           11 years ago
  • 0.1.1                                ...           11 years ago
  • 0.1.0                                ...           11 years ago

© 2010 - cnpmjs.org x YWFE | Home | YWFE