Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

142
Views
How to get Json data array and object using fetch api in Reactjs

am new in ReactJs ,I have try to get data in Array inside of object data. but am unable to get data object.I fetch successfully 'data' array but not able to get inside of 'item.name and description'. Please give the solution step by step.

JSON data

    {
   "lastUpdate":0,
   "lanuage":"en",
   "data":[
      {
         "itemId":"8f90647f-fafe-47a5-8204-8197e07432da",
         "lastUpdate":1636440002,
         "item":{
            "name":"Hacivat Bundle",
            "description":"",
            "type":"bundle",
            "rarity":"epic",
            "series":null,
            "cost":"???",
            "upcoming":true,
            "images":{
               "icon":"https://dropin-bucket.mativecdn.com/cosmetics/br/8f90647f-fafe-47a5-8204-8197e07432da_kv88w8kp/icon.png",
               "featured":null,
               "background":"https://dropin-bucket.mativecdn.com/cosmetics/br/8f90647f-fafe-47a5-8204-8197e07432da_kv88w8kp/icon.png",
               "information":"https://dropin-bucket.mativecdn.com/cosmetics/br/8f90647f-fafe-47a5-8204-8197e07432da_kv88w8kp/icon.png"
            },
            "backpack":{
               
            },
            "obtained":"",
            "obtained_type":"none",
            "ratings":{
               "avgStars":3.49,
               "totalPoints":192,
               "numberVotes":55
            },
            "costmeticId":"8f90647f-fafe-47a5-8204-8197e07432da_kv88w8kp"
         }
      },
    ]
  }

Source code

    function Shop() {
  useEffect(() => {
    fetchitems();
  }, []);

  const [items, setItems] = useState([]);
  const fetchitems = async () => {
    const data = await fetch("https://fortnite-api.theapinetwork.com/upcoming/get"
    );
    const itemsdata = await data.json();
    console.log(itemsdata.data);
    setItems(itemsdata.data);
  };



  return (
    <div>
      {items.map(item => (
        <h1>{item.name}</h1>
      ))}
    </div>
  );

}

export default Shop;
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!