PACKAGE · HTTP CLIENT

got

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

WEEKLY DOWNLOADS 17.0M
STARS 14.9K
FORKS 988
OPEN ISSUES 0
INSTALL SIZE 1.6 MB
UNPACKED SIZE 354.9 kB
LAST UPDATED 5mo ago
DOWNLOAD TRENDS

got downloads — last 12 months

Download trends for got1 download series from Jun 2025 to May 2026. Use left and right arrow keys to inspect monthly values.037.0M74.0M111.0M148.0MJun 2025SepDecMarMay 2026
got
ABOUT GOT

Got is a high-level HTTP client library for Node.js, designed to simplify making network requests by providing a more human-friendly API than the built-in `http` or `https` modules. It abstracts away common complexities such as request/response handling, error management, and stream manipulation.

The library emphasizes developer experience and powerful features, making it suitable for a wide range of Node.js applications requiring custom HTTP interactions. Its design draws inspiration from browser-based fetch APIs while extending them with Node.js-specific capabilities and robust error handling.

Got utilizes a promise-based approach for asynchronous operations and supports an extensive feature set including request options, response parsing, interceptors for modifying requests and responses globally, and automatic pagination. Its fluent API allows for chaining options and actions, offering a declarative way to configure complex requests.

This package integrates seamlessly into typical Node.js workflows, whether building RESTful APIs, consuming third-party services, or performing background data fetching. It works well within various application architectures, from simple scripts to complex microservices, and integrates with standard Node.js stream processing.

With 32.8 million weekly downloads and 14.9K GitHub stars, `got` demonstrates significant community adoption and maturity. The library is actively maintained, and the provided information indicates a recent update, though the specific date requires careful consideration for production use.

A potential consideration for developers is its unpacked size of 354.9 kB, which might be a factor in highly size-constrained environments. While it offers a comprehensive feature set, developers seeking an extremely minimal HTTP client for very basic tasks might explore lighter alternatives.

WHEN TO USE
  • When building server-side applications that need to interact with RESTful APIs or other HTTP services.
  • When requiring advanced features like request retry logic, timeouts, and custom redirects using the `retry` and `timeout` options.
  • When needing to handle complex response types, including JSON parsing automatically with `responseType: 'json'`.
  • When implementing API clients that benefit from interceptors for pre-request modification or post-response error handling via `beforeRequest`, `afterResponse`, and `onError` hooks.
  • When leveraging streaming capabilities for large request bodies or efficient response handling with `isStream: true`.
  • When migrating from older HTTP libraries and seeking a modern, promise-based API.
WHEN NOT TO USE
  • If your application primarily interacts with GraphQL endpoints, as specialized GraphQL clients offer more targeted features and optimizations.
  • If you only need to make very simple GET requests and are concerned about the library's size, consider using Node.js's built-in `https` module or a lighter HTTP client.
  • When working in an environment with extremely strict memory or bundle size constraints where 354.9 kB is prohibitive.
  • If your primary requirement is to replicate browser `fetch` exactly, although `got` shares similarities, nuances may exist. The browser's native `fetch` may be more appropriate in such specific cases.
  • For simple file uploads or downloads that can be managed efficiently using Node.js streams directly with `fs` and `http`/`https` modules without additional abstraction.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

COMPARISONS 6
got vs ofetch ★ 5.3K · 9.0M/wk got vs undici ★ 7.6K · 60.2M/wk got vs node-fetch ★ 8.9K · 73.5M/wk got vs ky ★ 16.9K · 2.9M/wk got vs superagent ★ 16.6K · 9.8M/wk got vs axios ★ 109.1K · 55.4M/wk