🌐
HTTP10M+/wkMIT

got

Got is a human-friendly and powerful HTTP request library for Node.js that provides an extensive feature set beyond basic request/response handling. Got support

Installation

npm
npm install got
yarn
yarn add got
pnpm
pnpm add got

Import

ESM
import got from 'got';

Quick Example

usage
const data = await got('https://api.example.com/data').json();
console.log(data);

const response = await got.post('https://api.example.com/submit', {
  json: { name: 'test' },
});

About got

Got is a human-friendly and powerful HTTP request library for Node.js that provides an extensive feature set beyond basic request/response handling. Got supports automatic retries with customizable strategies, HTTP/2 support, progress events for uploads and downloads, Unix domain socket connections, pagination helpers for API endpoints, and RFC-compliant caching using a Keyv-compatible cache backend. The library handles redirects, cookies, timeouts (including separate connect, socket, and response timeouts), and response decompression automatically. Got's API supports both promise-based and stream-based patterns, making it suitable for both simple JSON API calls and complex streaming scenarios like downloading large files. The library includes built-in support for creating reusable instances with pre-configured defaults, hooks for request lifecycle events (beforeRequest, afterResponse, beforeRetry), and automatic request body serialization. Got is ESM-only since version 12, reflecting the Node.js ecosystem's shift toward ES modules. It is particularly well-suited for applications that need robust HTTP handling with retries, timeouts, and caching built in rather than implemented manually.

Quick Facts

Packagegot
CategoryHTTP
Weekly Downloads10M+
LicenseMIT
Installnpm install got

Related Packages

Browse npm Packages by Category

Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.