Skip to content

axios vs got

Which should you use? A side-by-side look at what each one does, who it suits, what it costs, how hard it is to set up, and where each falls short.

axios

Open source · MIT

A promise-based HTTP client that works in both browsers and Node.js.

got

Open source · MIT

A Node.js library for making HTTP requests, with retries, timeouts, and JSON support.

The short answer

Choose axios if you need…

  • JavaScript developers calling REST or other HTTP APIs from a browser front end
  • Node.js developers who want one HTTP client API across client and server code
  • Teams that want a widely used, MIT-licensed library with a large community

Choose got if you need…

  • Node.js developers who call web APIs from server-side code
  • Projects that need built-in retries, advanced timeouts, or pagination helpers
  • Developers who want HTTP/2, caching, or Unix socket support in one library
  • Teams already using Got who want its plugins such as got-scraping or gh-got

Side-by-side

axiosgot
TypeLibraryLibrary
PriceFree and open sourceFree and open source
LicenceMITMIT
GitHub stars109k15k
Setup difficultyBeginnerBeginner
How you get itInstall with a package managerInstall with a package manager
Main languageJavaScriptTypeScript
Last code update4 days ago7 days ago

What each one is

axios

Axios is a JavaScript library for making HTTP requests, such as fetching data from a web API or sending form data to a server. It uses promises, so you can write asynchronous request code with async/await or .then() chains. The same API works in browser apps and in Node.js servers, which is why developers reach for it.

got

Got is a JavaScript library that lets Node.js programs send HTTP requests to web servers and APIs. It handles common chores such as JSON bodies, retries on failure, timeouts, redirects, and progress events so you write less boilerplate. The README also points readers to Ky, a related library by the same author, for most users who need browser support or a smaller package.

Best for

axios

  • JavaScript developers calling REST or other HTTP APIs from a browser front end
  • Node.js developers who want one HTTP client API across client and server code
  • Teams that want a widely used, MIT-licensed library with a large community

got

  • Node.js developers who call web APIs from server-side code
  • Projects that need built-in retries, advanced timeouts, or pagination helpers
  • Developers who want HTTP/2, caching, or Unix socket support in one library
  • Teams already using Got who want its plugins such as got-scraping or gh-got

Strengths

axios

  • Same API for browser and Node.js environments
  • Promise-based, which fits modern async/await code
  • MIT licensed with a very large user base (about 109k GitHub stars)

got

  • Feature-rich, with retries, timeouts, hooks, instances, and caching listed in the README
  • Documented with a quick start, options reference, and migration guides from Axios and Request
  • Actively maintained according to the README, with a large dependent count it reports

Not ideal for

axios

  • Developers who only need a built-in fetch call and want zero dependencies, since the browser and Node.js already offer fetch
  • Non-programmers looking for an end-user app; this is a code library, not a tool with a interface
  • Projects that need a non-JavaScript language; the README covers only JavaScript usage

got

  • Browser-only projects, since the comparison table marks browser support as unsupported; the README suggests Ky instead
  • Projects that use CommonJS, since the package is native ESM with no CommonJS export and the README suggests converting to ESM
  • Anyone needing Got v11 support, since the README says v11 is no longer maintained

Trade-offs

axios

  • The README notes a security-update notice for Axios v0, so version choice matters for maintenance
  • Adds an external dependency where built-in fetch might be enough
  • README is truncated here, so detailed API behavior is not fully confirmed from this source

got

  • Node.js only; the comparison table marks browser support as not available
  • Native ESM only, which may require converting older CommonJS projects
  • The README itself recommends Ky for many users, so Got may not be the first choice for simple needs

Getting started

axios

Install with npm

npm install axios
Step-by-step guide: how to use axios

got

Install the package from npm

npm install got
Step-by-step guide: how to use got

Frequently asked questions

What is the difference between axios and got?

axios: A promise-based HTTP client that works in both browsers and Node.js. got: A Node.js library for making HTTP requests, with retries, timeouts, and JSON support. axios suits javascript developers calling rest or other http apis from a browser front end, while got suits node.js developers who call web apis from server-side code.

Are axios and got free?

axios: Free and open source. got: Free and open source.

Is axios or got more popular?

axios has more GitHub stars (109k) than got (15k). Popularity isn't the same as fit — check which one matches your use case above.

What are other alternatives to axios and got?

Other options people compare them with include ky, superagent, window.fetch polyfill, cpp-httplib.

Keep comparing

Built from our catalogue entries for both products: open-source details come from each project's README (AI-assisted, refreshed weekly) and GitHub data; AI-tool details are editorial. Spotted something wrong? Let us know from either product's page.