Logo
⚠️ Unsaved
[M]:

Install Axios & Fetch Data from API

[1]:
!npm install axios

import axios from "axios";
const response = await axios.get("https://jsonplaceholder.typicode.com/todos/1");

console.log(JSON.stringify(response.data, null, 2));
$ npm install axios

up to date in 504ms

28 packages are looking for funding
  run `npm fund` for details
{
  "userId": 1,
  "id": 1,
  "title": "delectus aut autem",
  "completed": false
}
Sign in to save your work and access it from anywhere