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/LICENSE3. Used by agents' projects
Dependency in 470 public GitHub projects set up for AI coding agents that we scanned (7.5%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
nodejs.org/llms.txtFrom 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
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
Often used with
Axios in practice
Strengths
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.
The site says "axios declares types and has full support for TypeScript."
v1.20.0 hardened how Axios reads behavioral configuration against "shared and foreign prototype pollution". It also normalized unsafe interceptor replacement objects.
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
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.
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.
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; Deprecations".
More about Axios
Funding
- GitHub Sponsors: https://github.com/axios
- Open Collective: https://opencollective.com/axios
- 19 GitHub sponsors
Head to head
- Axios vs undici used together in 21 projects
- Axios vs node-fetch used together in 36 projects
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
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.
Pick got when the code runs only in Node.js and you want built-in retries, hooks and streams.
Pick undici when the code runs only on a Node.js server and request speed matters most.
Bring the Fetch API to Node.js for making HTTP requests.
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.”
Import it. With require, only the default export is there.
import axios, { isCancel, AxiosError } from 'axios'; // const axios = require('axios');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' }, });
Rules for your agent
## 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
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.
CancelToken is deprecated; AbortController is the supported way since 0.22.0, and our demo cancel ended with ERR_CANCELED.
The concurrency helpers are deprecated.
With require only the default export is available.
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.