Axios 1.20: The HTTP Client That Keeps Its Promise API, and Its Trade-Offs
Promise based HTTP client for the browser and node.js
At a glance
- What is it?
- Axios is a widely used Promise-based HTTP client for browsers and Node.js. This review covers its core mechanism, setup, real limitations, and where it fits against alternatives like fetch.
- Who is it for?
- Adopt Axios if you need a battle-tested, Promise-based HTTP client with broad browser support, interceptors, and a consistent API across Node and the browser. Skip it if you are on a modern runtime where native fetch suffices, or if you want to minimize dependencies.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 1 day ago.
- What is it written in?
- Mainly JavaScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
The Problem Axios Solves: HTTP Without the Boilerplate
Axios solves a specific annoyance: making HTTP requests in JavaScript without repeating the same setup code. In a browser, you have XMLHttpRequest and, more recently, fetch. In Node.js, you have http and https modules. Each has its own quirks. Axios wraps these into a single Promise-based interface. The project's own description calls it a 'Promise based HTTP client for the browser and node.js'. That is the core value. It is for developers who want one API for both environments, with features like request and response interception, automatic JSON transformation, and cancellation. It is not for people who want the absolute smallest bundle or who are happy to write their own fetch wrappers. Axios is a convenience layer, and it has been around long enough that many teams treat it as the default choice.
How Axios Works: The Adapter and the Promise Chain
Axios does not reinvent HTTP. It builds on existing transports. In the browser, it uses XMLHttpRequest under the hood. In Node.js, it uses the http and https modules. This is visible in the repository layout, which includes separate adapters for each environment. The key mechanism is the adapter pattern. You call axios.get('/api') or axios.post('/data', payload). Axios then picks the right adapter based on the environment, makes the actual network call, and returns a Promise. That Promise resolves with a response object that has data, status, headers, config, and request properties. The rejection path gives you an error object with a response property if the server replied with a non-2xx status. This uniform shape is what makes Axios predictable. Interceptors sit between your call and the adapter. They let you modify request config before it is sent and transform the response before it reaches your code. The documentation shows this as a chain: request interceptors, then the adapter, then response interceptors. This is a simple, linear flow, and it is the reason Axios is easy to reason about.
Getting Started: Install, Import, and First Request
Installation is a single command. The README does not show it, but the package is on npm, so you would run npm install axios. The standard import is const axios = require('axios') in CommonJS or import axios from 'axios' in ES modules. A minimal request looks like this: axios.get('/user?ID=12345').then(function (response) { console.log(response.data); }).catch(function (error) { console.log(error); }). That is the classic pattern. You can also use async/await. The config object is where the power lies. You can set baseURL, timeout, headers, params, and transformRequest. For example, axios.create({ baseURL: 'https://api.example.com', timeout: 1000 }) returns an instance with those defaults. The README does not list all config keys, but the docs at axios-http.com cover them. The repository has a v1.x branch, and the latest release is v1.20.0, which suggests the API has been stable for a long time. You can also use axios.all for concurrent requests, though Promise.all is the modern equivalent.
A Real Limitation: The Browser Dependency and the Bundle Size
Axios is not a zero-cost abstraction. In the browser, it relies on XMLHttpRequest, which is older than fetch. That has implications. For one, streaming responses is not as natural as with fetch's ReadableStream. Axios does support progress events, but the underlying XHR model is less flexible for things like server-sent events or large binary streams. Another limitation is bundle size. Axios is not tiny. The package includes adapters for both environments, plus utility functions. If you are building a small front-end and only need GET requests, you are paying for features you do not use. The README does not give byte counts, but the repository structure shows multiple files that all get bundled. This is a case where the wrong tool is a minimal API client. If your only job is to fetch JSON from a single endpoint, native fetch is lighter and built into every modern browser and Node.js 18 and later. Axios shines when you need interceptors, cancellation, or consistent error handling across many requests, not for a one-off call.
The Alternative: Native fetch and Its Different Approach
The direct alternative is the Fetch API, which is now standard in browsers and Node.js (since version 18). Fetch is Promise-based too, but it takes a different approach. It is a lower-level API. You get a Response object and must call res.json() or res.text() yourself. Error handling is different: fetch only rejects on network failure, not on HTTP error status. You have to check res.ok and throw your own error. Axios, by contrast, rejects on non-2xx status by default. That is a real difference in behavior. Fetch also has no built-in interceptors or request cancellation via AbortController, which is more verbose than Axios's CancelToken (though Axios also supports AbortController in recent versions). The trade-off is that fetch is native, has zero install cost, and is actively maintained by the platform. Axios is a third-party dependency that you must update. For teams that want a consistent API across many projects and do not mind the dependency, Axios is convenient. For teams that prefer platform primitives and are comfortable writing a small wrapper, fetch is the leaner choice.
Maintenance and Upgrade Cost: What the Release History Shows
The repository shows an active maintenance cadence. The latest release is v1.20.0, pushed on 2026-08-24. Before that, v1.19.0 came on 2026-07-26, and v1.18.1 on 2026-06-21. That is roughly one release per month. This is a project that is still being updated. The default branch is v1.x, which means the maintainers are committed to the 1.x line. For users, this means upgrades are frequent but likely minor. The README does not detail breaking changes, but the version number staying at 1.x suggests API stability. The license is MIT, which is permissive and allows commercial use. The maintenance cost for you is the need to track these releases, read changelogs, and test your code against new versions. There is also the sponsor situation. The README is full of sponsor blocks, including 'Platinum sponsors' and 'Gold sponsors'. That is a sign of a project that relies on corporate funding. It is not a negative, but it means the project's direction can be influenced by sponsors. You should verify that the features you depend on are not deprecated in the next minor release.
When Axios Is the Wrong Tool: Cases That Expose Its Limits
Axios is the wrong tool in several specific scenarios. First, if you are building a library that will be bundled for many users, adding Axios as a dependency increases the payload. A library author might prefer to use fetch and let the consumer decide. Second, if you need to handle streaming responses, such as large file downloads with progress, Axios works but fetch's ReadableStream is more direct. Third, if you are running in an environment where XMLHttpRequest is not available, such as a service worker, you must rely on the Node adapter, which may not behave the same. The README does not mention these edge cases, but they follow from the architecture. Another failure mode is error handling. Axios's default rejection on HTTP errors can be surprising if you expect a resolved promise with a status code. Some developers find this convenient, others fight it. The documentation is clear about it, but it is a design choice that you must accept. If you prefer a more functional style, a library like ky (built on fetch) might suit you better. Ky has a similar API but uses fetch under the hood and is smaller. That is a real alternative, though the README does not compare them.
Editorial conclusion
Adopt Axios if you need a battle-tested, Promise-based HTTP client with broad browser support, interceptors, and a consistent API across Node and the browser. Skip it if you are on a modern runtime where native fetch suffices, or if you want to minimize dependencies. Before adopting, verify that the version you pin (e.g., 1.20.0) matches your Node.js version and that you are comfortable with the ongoing maintenance cadence, which shows regular releases but also a long history of API stability.
Community notes