Skip to content

JavaScript : how to display list from this api data

I’m currently working on a project where I take an API from a site, and display it on my webpage.

  "data": [{
  "routeCategoryDesc":"SUPPLIER TO PLANT",

How to fetch this data to show in html only text?


You can do it this way:

const parsed = JSON.parse(json); // json is that json text
const data =; // To get data key from json
data.forEach(cur => {
  console.log(cur); // This will print objects in data array one by one

That’s it!