explaingit

sindresorhus/got

Analysis updated 2026-06-24

14,903TypeScriptAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

Got is a Node.js HTTP and HTTPS request library for JavaScript and TypeScript with retries, timeouts, streams, pagination, HTTP/2, caching, and proxy support.

Mindmap

mindmap
  root((got))
    Inputs
      URLs
      Request options
      JSON payloads
    Outputs
      Parsed responses
      Streams
      Errors with metadata
    Use Cases
      Call REST APIs
      Scrape pages
      Stream file downloads
      Build API clients
    Tech Stack
      Node
      TypeScript
      ESM
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Call JSON REST APIs from Node with automatic retries and typed responses

USE CASE 2

Stream large file downloads with progress events and HTTP/2 support

USE CASE 3

Paginate through API results using the built-in pagination API

USE CASE 4

Build a reusable API client with hooks, plugins, and shared instances

What is it built with?

NodeTypeScriptESM

How does it compare?

sindresorhus/gottriggerdotdev/trigger.devairbnb/react-sketchapp
Stars14,90314,91514,879
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasymoderatemoderate
Complexity2/53/53/5
Audiencedeveloperdeveloperdesigner

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Got is ESM-only and Node-only, CommonJS projects must convert to ESM, and browser code should use Ky instead.

MIT: free to use, modify, and redistribute in commercial or private projects with attribution.

In plain English

Got is a Node.js library for making HTTP and HTTPS requests from JavaScript or TypeScript code. The README tagline calls it a human-friendly and powerful HTTP request library, which means it gives developers a tidy way to fetch web pages, call APIs, post JSON, stream files, and handle the surrounding details like retries, timeouts, and errors. Up front the README is unusually candid: the maintainers tell most readers to use Ky from the same author instead, because Ky works in browsers too and is built on the standard Fetch API. Got still gets a lot of use, but it is Node.js only and is shipped as a native ES module package, so projects still using CommonJS need to convert to ESM before installing it. Version 11 of Got is no longer maintained. The README shows a short example: import got, call got.post with a URL and a json option, then chain a .json() call on the returned promise to parse the response. By default Got retries failed requests automatically, and that behavior can be turned off through an options setting. The documentation index lists what Got can do: a promise API, a stream API, a pagination API, advanced HTTPS options, HTTP/2 support, detailed timeout and retry handling, errors with metadata, hooks, reusable instances, progress events, plugins, RFC-compliant caching, proxy support, Unix domain socket connections, integration with Node's diagnostics channel, and TypeScript types. The README also lists community plugins built on Got (for AWS, GitHub, GitLab, GraphQL, web scraping, and SSRF protection), migration guides from Request, Axios, and the built-in Node HTTP module, and a feature comparison table against other Node HTTP clients.

Copy-paste prompts

Prompt 1
Fetch a JSON API in Node with Got and parse the response into a TypeScript type
Prompt 2
Stream a large file download with Got and report progress every 100ms
Prompt 3
Configure Got with custom retry logic, a 5 second timeout, and an HTTPS proxy
Prompt 4
Migrate an existing Axios client to Got using the migration guide

Frequently asked questions

What is got?

Got is a Node.js HTTP and HTTPS request library for JavaScript and TypeScript with retries, timeouts, streams, pagination, HTTP/2, caching, and proxy support.

What language is got written in?

Mainly TypeScript. The stack also includes Node, TypeScript, ESM.

What license does got use?

MIT: free to use, modify, and redistribute in commercial or private projects with attribution.

How hard is got to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is got for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.