Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 4 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

Axios

Send web requests from browser or Node.js.

HTTP clients and networkingNPM

GitHubWebsite

1. License

“Permission is hereby granted, free of charge, to any person obtaining a copy of this software”

MIT allows use in paid and closed-source apps.

github.com/axios/axios/blob/v1.x/LICENSE

From the package registry and GitHub, checked daily; card checked Nov 11, 2026. Tap a verdict to see its source.How we checkedReport an error

What Axios does

Axios is a free JavaScript library your app uses to talk to other servers, from the browser or from Node.js. You set the server address, sign-in header and time limit once, and every request reuses them. Failed requests come back as clear errors you can show to users.

What people build with it

One client for your backend

Your frontend calls your own server from many screens; one shared client adds the address, the sign-in token and a time limit to every call.

Friendly messages when calls fail

When an order is not found or the server is too slow, show a clear message instead of a blank page.

Stop an old search request

A search box sends a request on each key; cancel the previous one so an old answer never replaces a newer one.

Upload with a progress bar

A file upload form fills a progress bar while a photo or document goes up to your server.

Retry when the server hiccups

When your server briefly fails, try the same request again a few times, waiting a bit longer each time.

Safe calls to unknown servers

A server-side job fetches pages or files from addresses users give; set a size cap so one bad reply cannot fill the memory.

Axios popularity

91 / 100
Gid Score, #9 overall
15M
downloads a week, npm
109K
GitHub stars
470
agent projects use it
Axios: downloads per weeknpm, axios 150,124,651
Axios: GitHub starsaxios/axios 109,397

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How Axios is used

  • Axios is a dependency in 470 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (9.7% of the 4,867 JavaScript/TypeScript ones), #1 of 126 in http clients and networking.
  • Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 2,127; those are left out of every share on this page.
  • The most used alternative in our scan is undici (107 projects).
  • Projects that use it most often also use Tailwind CSS (61.1%), concurrently (27.9%), Vite (43.8%).
  • It is more common in projects set up for Junie (32.4%) than for Claude Code (6.9%).

By coding agent

245 projects, 10.0%
227 projects, 6.9%
221 projects, 7.3%
58 projects, 12.2%
44 projects, 9.4%
39 projects, 11.4%
26 projects, 9.3%
24 projects, 32.4%

Often used with

In 61.1% of its projects
In 27.9% of its projects
In 43.8% of its projects
In 69.6% of its projects
In 53.8% of its projects
In 19.8% of its projects
In 34.0% of its projects
In 47.9% of its projects

Axios in practice

Strengths

One hook point for requests, responses and errors

The site says the interceptor system lets you "control the request and response lifecycle". It also says you can modify requests, responses and errors there.

Types come in the package

The site says "axios declares types and has full support for TypeScript."

Config reads hardened against prototype pollution

v1.20.0 hardened how Axios reads behavioral configuration against "shared and foreign prototype pollution". It also normalized unsafe interceptor replacement objects.

Keep-alive sockets no longer pin response data

In Node.js, v1.20.0 stopped per-socket error listeners from holding on to request context. Before the fix, completed response data could stay in memory for the lifetime of pooled keep-alive sockets.

Watch out for

CancelToken is on the way out

The README's table of contents lists two cancellation sections. The <code>AbortController</code> section has no tag. The <code>CancelToken</code> section is tagged deprecated in its anchor.

A v0 security callout points to a sponsor

Both the website and the README carry a callout, "Get Security Updates for Axios v0", that links to herodevs.com. HeroDevs appears in the sponsor list. The sources do not explain how v0 is maintained.

413 and 422 have new names

v1.20.0 adds <code>ContentTooLarge</code> and <code>UnprocessableContent</code>. It keeps <code>PayloadTooLarge</code> and <code>UnprocessableEntity</code> as "backward-compatible deprecated aliases". The notes list this under "Breaking Changes &amp;amp; Deprecations".

More about Axios

Funding
  • GitHub Sponsors: https://github.com/axios
  • Open Collective: https://opencollective.com/axios
  • 19 GitHub sponsors

See all

Head to head
Packages around it
  • dotenv: Loads .env files
  • @solana/web3.js: Solana JavaScript SDK
  • tailwindcss: Utility-first CSS
  • ts-node: Run TypeScript in Node
  • @solana/spl-token: Solana token client
More in HTTP clients and networking

Alternatives

Axios This page

MITGid 9115M/wk

Ky

Pick ky when you want a tiny client built on the browser's own fetch and do not need upload progress or Node's older http module.

Got

Pick got when the code runs only in Node.js and you want built-in retries, hooks and streams.

undici

Pick undici when the code runs only on a Node.js server and request speed matters most.

MITGid 76355M/wk

node-fetch

Bring the Fetch API to Node.js for making HTTP requests.

MITGid 75301M/wk

Compare Axios with another tool

Get started

Tell your AI assistant

“Use axios (pin axios@1.21.1 with a lockfile) and make one axios.create() client with our baseURL and a timeout, add the auth header in a request interceptor, cancel stale requests with AbortController, and handle errors by e.code and e.response.status.”

  1. Install it into your project.

    npm install axios

    From github.com/axios/axios/blob/v1.x/README.md

  2. Import it. With require, only the default export is there.

    import axios, { isCancel, AxiosError } from 'axios';
    // const axios = require('axios');
    

    From github.com/axios/axios/blob/v1.x/README.md

  3. Make one instance with your server address and a time limit, and use it everywhere.

    const instance = axios.create({
      baseURL: 'https://some-domain.com/api/',
      timeout: 1000,
      headers: { 'X-Custom-Header': 'foobar' },
    });
    

    From github.com/axios/axios/blob/v1.x/README.md

Rules for your agent

Paste into AGENTS.md or CLAUDE.md
## Axios
- The README's table of contents tags the `CancelToken` and "Concurrency" sections as deprecated. For cancellation, it lists an `AbortController` section; do not add new code that uses the deprecated APIs.
- When global defaults, instance defaults and per-request config overlap, check the README's "Config order of precedence" section rather than guessing which one wins.
- For HTTP 413 and 422, use `ContentTooLarge` and `UnprocessableContent`. Since v1.20.0, `PayloadTooLarge` and `UnprocessableEntity` are deprecated aliases.
- In browser code on v1.20.0+, expect navigation-canceled XHR requests to reject with `ECONNABORTED`, not to resolve with status 0.
- On v1.20.0+, invalid DNS lookup and `httpVersion` failures surface as `AxiosError.ERR_BAD_OPTION_VALUE`.
- Before upgrading to v1.20.0, read PR #11141 for its documented compatibility effects on Fetch redirects, HTTP/2 DNS and proxy handling, `NO_PROXY` matching and data URIs.

Mistakes to avoid

axios.get(url) with no timeout in production code
Set timeout on the instance (axios.create({ timeout: 5000 })) and handle ECONNABORTED and ETIMEDOUT

Without a timeout a stalled request never ends; in our run with the fetch adapter the timeout came back as ETIMEDOUT, while the docs name ECONNABORTED as the usual code, so check both.

new axios.CancelToken(...) / source.cancel() in new code
Pass { signal: controller.signal } from an AbortController and test with axios.isCancel(e)

CancelToken is deprecated; AbortController is the supported way since 0.22.0, and our demo cancel ended with ERR_CANCELED.

axios.all([...]) and axios.spread(...)
Promise.all([...]) with array destructuring

The concurrency helpers are deprecated.

const { isCancel } = require('axios')
const axios = require('axios'); axios.isCancel(e) — or use import { isCancel } from 'axios'

With require only the default export is available.

"axios": "^1.x" with no lockfile, or a CDN script without a version
Pin the exact version in a lockfile and run npm audit signatures in CI

The axios docs tell users to check release provenance with npm audit signatures and to treat a missing attestation on an attested version as a possible supply-chain incident.

Questions

Does it work in both the browser and Node.js?

Yes. It uses XMLHttpRequest in the browser, the http module in Node.js, and can switch to fetch.

Why does a 404 or 500 land in catch?

Axios treats any status outside 200-299 as an error. Change that with validateStatus.

How do I cancel a request?

Pass an AbortController signal and call abort(). The older CancelToken is deprecated.

Does it retry failed requests by itself?

No. The docs show how to add retries with a response interceptor.

Can I use it in a paid product?

Yes, it is MIT licensed; keep its license notice in copies you ship.