PACKAGE · HTTP CLIENT

axios

Promise based HTTP client for the browser and node.js

WEEKLY DOWNLOADS 98.0M
STARS 109.2K
FORKS 11.8K
OPEN ISSUES 66
GZIP SIZE 18.8 kB
UNPACKED SIZE 1.9 MB
DEPENDENCIES 1
LAST UPDATED 5mo ago
DOWNLOAD TRENDS

axios downloads — last 12 months

Download trends for axios1 download series from Aug 2025 to Jul 2026. Use left and right arrow keys to inspect monthly values.0123.9M247.9M371.8M495.7MAug 2025NovFebMayJul 2026
axios
ABOUT AXIOS

Axios is a promise-based HTTP client designed to function seamlessly in both the browser and Node.js environments. It addresses the common need for a reliable and feature-rich way to make asynchronous network requests, simplifying complex interactions with remote APIs and servers. By abstracting the underlying XMLHttpRequest or http APIs, Axios provides a consistent interface for developers, reducing boilerplate code and potential for errors.

The core philosophy behind Axios is to offer a developer-friendly experience with a focus on modern JavaScript features like Promises and async/await. It caters to a broad audience, from frontend developers building interactive user interfaces to backend developers constructing microservices or integrating with third-party APIs. Its extensive feature set and predictable behavior make it a go-to choice for handling HTTP communications.

Key API patterns in Axios include interceptors for requests and responses, allowing for global transformations or handling of data before it's sent or received. Developers can leverage its powerful features like automatic JSON data transformation, cancellation of requests via controllers, and built-in protection against XSRF attacks. The clear structure for handling request configurations and error management also contributes to its ease of use.

Axios integrates smoothly into various development workflows and frameworks. It's commonly used with popular frontend frameworks like React, Vue, and Angular, as well as server-side environments using Node.js. Its commonality means it works well with build tools and module bundlers, fitting into established project architectures without significant friction. This broad compatibility ensures it can be adopted in a wide range of application stacks.

With a substantial community backing evidenced by 109.2K GitHub stars and 91.8M weekly downloads, Axios is a mature and stable library. Its unpacked size of 1.9 MB and gzipped bundle size of 18.8 kB represent a reasonable trade-off for its comprehensive capabilities, making it suitable for applications where bundle size is a consideration but not the absolute primary constraint. The library is actively maintained, with recent updates reflecting ongoing development.

While generally robust, developers should be aware that Axios's abstraction might obscure some low-level details of network requests, which could be a consideration for highly specialized network debugging. Its extensive feature set, while powerful, might introduce a slight overhead compared to extremely minimal, purpose-built HTTP libraries if only the most basic GET requests are ever needed.

WHEN TO USE
  • When making cross-origin requests from a web browser to a backend API.
  • When building Node.js applications that require fetching data from external services or other microservices.
  • When needing to intercept outgoing requests to add authentication headers or modify request bodies globally.
  • When requiring interceptors for incoming responses to handle authentication tokens or manage common error states.
  • When implementing request cancellation for user interactions, such as cancelling a search request if the user types new input.
  • When working with APIs that return JSON and requiring automatic data transformation on both request and response.
  • When protective measures against Cross-Site Request Forgery (XSRF) are necessary within an application.
WHEN NOT TO USE
  • If only simple, single GET requests are needed and the added features of Axios are not utilized, a lighter alternative might be more appropriate.
  • If strict control over low-level HTTP client behavior is paramount and abstraction layers are undesirable, a native browser or Node.js http module could be considered.
  • When developing for extremely resource-constrained environments where even an 18.8 kB gzipped bundle size is prohibitive, a more minimalist fetch API wrapper might be preferred.
  • If the sole requirement is to consume simple JSON data without the need for interceptors or request configuration.
  • When an application is built using a framework that provides a built-in, optimized HTTP client, leveraging that first might be more idiomatic.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

COMPARISONS 6
axios vs node-fetch ★ 8.9K · 149.0M/wk axios vs got ★ 14.9K · 32.4M/wk axios vs ky ★ 17.0K · 6.0M/wk axios vs undici ★ 7.7K · 128.8M/wk axios vs ofetch ★ 5.3K · 21.5M/wk axios vs superagent ★ 16.6K · 19.1M/wk