← All libraries

Axios

JavaScript
↗ Official site

Utilities & helpers

Make HTTP requests (fetch data from APIs) easily.

What it does

Axios is a library for making HTTP requests — fetching data from an API, sending form data, uploading files. It's the friendly, feature-rich alternative to the browser's built-in fetch.

When to use it

Use this when you need to call external APIs and want better error handling than raw fetch.

Real example

You want to fetch your user's profile from an API and show a loading state while waiting. Prompt: 'Use Axios to GET /api/user with the auth token in an Authorization header. Show a loading spinner while the request is pending. On success, render the user name. On error, show a friendly error message.'

Good to know

In many cases, the built-in fetch API is enough. Axios shines when you need request interceptors, automatic JSON parsing, or better error handling.

Alternatives

fetch (built-in) ky

Install

$ npm install axios

Use cases

API callsHTTP requestsdata fetching

Language

JavaScript

Category

Utilities & helpers

More in Utilities & helpers

Other tools in the same category