JavaScript HTTP client libraries

Updated Nov 2026

JavaScript HTTP client libraries send requests to web servers and read the responses. Apps and AI agents use these libraries to call external APIs with features the built-in fetch lacks, such as retries and response caching.

Popularity

Undici has the most monthly downloads in this comparison, at 1.2B.

LibraryMonthly downloadsStarsLast releaseLicense
Undici
1.3B
7.7KNov 2026MIT
node-fetch
1.1B
8.8KJul 2023MIT
Gaxios
597.4M
3.2KNov 2026Apache-2.0
Axios
563.5M
109.4KNov 2026MIT
Got
205.1M
15.0KOct 2026MIT
make-fetch-happen
149.2M
208May 2026ISC
SuperAgent
126.0M
16.6KNov 2026MIT
ofetch
105.7M
5.4KNov 2025MIT
Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Features compared

LibraryNative retry APIBrowser runtimeThrows on HTTP errors by default
UndiciBuilt-inUnsupportedUnsupported
node-fetchUnsupportedUnsupportedUnsupported
GaxiosBuilt-inBuilt-inBuilt-in
AxiosUnsupportedBuilt-inBuilt-in
GotBuilt-inUnsupportedBuilt-in
make-fetch-happenBuilt-inUnsupportedUnsupported
SuperAgentBuilt-inBuilt-inBuilt-in
ofetchBuilt-inBuilt-inBuilt-in
Built-inNot supported

Libraries and code examples

Undici is an HTTP client written from scratch for Node.js, and the built-in fetch in Node.js runs on a bundled copy of it. Installing the package adds APIs the built-in version lacks: request, stream, and pipeline for lower-level calls, and ProxyAgent and MockAgent for proxies and tests. An Agent or Pool controls connection pooling, and setGlobalDispatcher applies one to every request. Undici's HTTP parser runs on WebAssembly, so requests fail in a Node.js setup that turns WebAssembly off.

Downloads / mo
1.3B
Stars
7.7K
Last release
8.12.4
License
MIT

Strengths

  • Controls reusable connection pools. Choose Agent or Pool when connection behavior needs explicit control.
  • Retries through dispatcher composition. Wrap a dispatcher in RetryAgent to retry eligible failed requests.

Limitations

  • Response bodies must be consumed. Read or cancel each response body so its connection can be reused.
  • Fetch bodies use web streams. Convert the response body when a Node stream is required.

Quickstart

From README.md
$ npm install undici
import { fetch } from 'undici';

const response = await fetch('https://example.com');
console.log(await response.text());

Undici examples

From open-source projects on GitHub

node-fetch brings the browser's Fetch API to Node.js, built on the native http module rather than a browser polyfill. A call to fetch(url) returns a promise of a Response, read with res.json() or res.text(). Request and response bodies are Node streams, and the library decodes gzip, deflate, and Brotli responses. Options add a redirect limit and a response size limit that the Fetch standard leaves out. The current major version is an ES module only, and the previous one still loads with require.

Downloads / mo
1.1B
Stars
8.8K
Last release
3.3.2
License
MIT

Limitations

  • ES module only. The current version can't be loaded with require; CommonJS projects stay on the previous major version.

Quickstart

From README.md
$ npm install node-fetch
import fetch from 'node-fetch';

const response = await fetch('https://github.com/');
const body = await response.text();

console.log(body);

node-fetch examples

From open-source projects on GitHub

Gaxios is an HTTP client from Google that offers an interface like Axios on top of node-fetch. request({ url }) sends a request and resolves to a response whose data field holds the parsed body. A Gaxios instance stores defaults such as a base URL and headers for every request it sends, and instance.fetch offers a Fetch-compatible call. The package is built for calls to Google APIs and services.

Downloads / mo
597.4M
Stars
3.2K
Last release
8.3.3
License
Apache-2.0

Quickstart

From README.md
$ npm install gaxios
import {request} from 'gaxios';
const res = await request({url: 'https://google.com/'});

Gaxios examples

From open-source projects on GitHub
request<T>(opts: GaxiosOptions): GaxiosPromise<T> {
    // ensure the user isn't passing in request-style options
    opts = this.configure(opts);
    validate(opts);
    return this.instance.request<T>(opts).catch(e => {
      throw this.processError(e);
    });
  }

Axios sends HTTP requests from the browser and from Node.js with the same promise-based API. Methods such as axios.get resolve to a response whose data field holds the parsed body, and objects passed as data serialize to JSON. Interceptors run code on every request or response to add logic or transform data. axios.create makes an instance with its own base URL, headers, and timeout. Requests can be cancelled, and a response with an error status rejects the promise.

Downloads / mo
563.5M
Stars
109.4K
Last release
1.21.1
License
MIT

Strengths

  • Works in browsers and Node. Use browser and server adapters through the same request interface.
  • Intercepts requests and responses. Add shared request configuration and response handling through interceptors.

Limitations

  • Retry policies need an integration. Add axios-retry when transient request failures should trigger retries.
  • Timeouts are disabled by default. Set a timeout explicitly when requests must stop waiting.

Quickstart

From README.md
$ npm install axios
import axios from 'axios';

const response = await axios.get('https://httpbin.org/get');
console.log(response.data);

Axios examples

From open-source projects on GitHub

Got is an HTTP request library for Node.js with promise and stream interfaces. got.post(url, { json }) sends a JSON body, and .json() on the returned promise parses the response. Failed requests retry by default, and options cover timeouts, caching, proxies, and Unix sockets. The package is an ES module only. Its README points browser code to Ky, a Fetch-based client from the same authors.

Downloads / mo
205.1M
Stars
15.0K
Last release
16.2.0
License
MIT

Strengths

  • Provides promise and stream APIs. Choose parsed responses or streaming transfers for Node applications.
  • Includes configurable retry behavior. Set eligible methods, failure codes, and retry delays.

Limitations

  • Requires ES module imports. Convert CommonJS integration code before importing current Got.
  • POST is excluded from retries. Configure retry.methods explicitly when repeating a POST request is safe.

Quickstart

From readme.md
$ npm install got
import got from 'got';

const {data} = await got.post('https://httpbin.org/anything', {
	json: {
		hello: 'world'
	}
}).json();

console.log(data);
//=> {"hello": "world"}

Got examples

From open-source projects on GitHub

make-fetch-happen

make-fetch-happen is a Node.js Fetch client that adds an HTTP cache, retries, request pooling, and proxy support to minipass-fetch. Setting cachePath stores responses on disk and follows HTTP caching rules, including Cache-Control, ETag, and conditional requests. Retries follow HTTP semantics, and a cached copy can answer when the network fails. fetch.defaults returns a fetch function with preset options.

Downloads / mo
149.2M
Stars
208
Last release
16.0.1
License
ISC

Quickstart

From README.md
$ npm install --save make-fetch-happen
const fetch = require('make-fetch-happen');

fetch('https://example.com')
  .then(response => response.text())
  .then(console.log);

make-fetch-happen examples

From open-source projects on GitHub

SuperAgent sends HTTP requests with a chained API that runs the same way in Node.js and in the browser. Methods such as .post, .send, and .set build the request, which goes out on .end with a callback or when awaited as a promise. An object passed to .send becomes a JSON request body. The browser build also loads from a script tag through jsDelivr or unpkg.

Downloads / mo
126.0M
Stars
16.6K
Last release
10.4.2
License
MIT

Quickstart

From index.md
$ npm install superagent
const request = require('superagent');

request.get('https://httpbin.org/get')
  .then(response => console.log(response.body));

SuperAgent examples

From open-source projects on GitHub

ofetch wraps the Fetch API with defaults for JSON and errors, and runs in Node.js, browsers, and workers. ofetch('/api/users') parses a JSON response on its own, and an object passed as body goes out as JSON with matching headers. A response with an error status throws a FetchError that carries the parsed error body. Failed requests retry once by default, except for POST, PUT, PATCH, and DELETE, which retry only when configured.

Downloads / mo
105.7M
Stars
5.4K
Last release
1.5.1
License
MIT

Limitations

  • No retries for writes. POST, PUT, PATCH, and DELETE requests don't retry unless retry is set.

Quickstart

From README.md
$ npm i ofetch
import { ofetch } from 'ofetch';

const html = await ofetch('https://example.com');
console.log(html);

ofetch examples

From open-source projects on GitHub

FAQ

In Node.js with no extra package, use the built-in fetch, which runs on Undici. For one API across the browser and Node.js with interceptors and instances, use Axios. For Node.js with retries and streams, use Got, and for Fetch with JSON parsing and retries in any runtime, use ofetch.

node-fetch brings the browser's Fetch API to Node.js. Node.js now ships a built-in fetch powered by Undici, so current Node.js versions can call fetch without a package. node-fetch adds Node streams for request and response bodies and options such as a response size limit.

Axios parses JSON responses, rejects the promise on an error status, and supports interceptors and preconfigured instances. Fetch is built into browsers and Node.js, returns a response whose body needs a separate json() call, and resolves even when the server returns an error status.

Axios has no retry option of its own, and the axios-retry package adds one. Got, ofetch, and SuperAgent retry failed requests without an extra package.

Pass timeout in milliseconds in the request config, or on an instance made with axios.create. Axios sets no timeout by default.

Got runs only in Node.js, retries failed requests by default, and offers a stream interface. Axios runs in browsers and Node.js with one API and needs the axios-retry package for retries.

For coding agents

Found your HTTP client library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official