Help with https://thumbnails.roblox.com/v1/groups/icons

What I do:

let logoJson = await axios.get(`https://thumbnails.roblox.com/v1/groups/icons?groupIds=${groupData.data.id}&size=150x150&format=Png&isCircular=false`)
let logo = logoJson.data.data.imageUrl

What I receive:

{
  "data": [
    {
      "targetId": 10863499,
      "state": "Completed",
      "imageUrl": "https://t3.rbxcdn.com/51448bb0869fab02344c751342b4a9ee"
    }
  ]
}

My logo variable comes back as undefined.

data is an array of objects, not a single object. The first (and only) object in the array is the one you need, which has the imageUrl key. That means you can access the first object of data and get the imageUrl from it like this:

logoJson.data.data[0].imageUrl
1 Like

Thanks for this - I’ve never really known how arrays worked so this has helped me with a few other things too.

1 Like