For further actions, you may consider blocking this person and/or reporting abuse
Read next
![ogbotemi2000 profile image](https://media.dev.to/cdn-cgi/image/width=100,height=100,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1696301%2F26537e31-938b-40b8-8077-b4a2a68aed0a.png)
CC-Shoes: An innovative ecommerce website for buying and personalizing sneakers with an engaging menu design
ogbotemi-2000 -
![shemanto_sharkar profile image](https://media.dev.to/cdn-cgi/image/width=100,height=100,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1640772%2Fb2082ea1-7820-424f-9e77-3e5d7d3e087e.jpg)
My Web Development Journey Day-2: CSS 🎨
Bidut Sharkar Shemanto -
![palomino profile image](https://media.dev.to/cdn-cgi/image/width=100,height=100,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1022880%2F107a5146-e292-4c7e-baa5-3a15110efbd3.jpeg)
POST only? Let's end this absurd API design debate
Palomino -
![wplake profile image](https://media.dev.to/cdn-cgi/image/width=100,height=100,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F997170%2Face983dc-0150-4c41-9246-8e8b3f851029.jpg)
Month in WordPress: June 2024
WPLake -
Top comments (3)
Hey Deni, I think I understand your question but not entirely sure. Adding some code snippets or examples to your post would help us help you.
I'm guessing you don't need to loop through the endpoint itself and need to loop through the data it returns? If so, you'll have to see what the structure of the data returned. It's most likely an array, but it's hard to say without knowing the endpoint or what you're doing.
Generally though, the data comes back as JSON, either already as an array or an object of objects. The first step (usually) is to figure out what sort of data you're getting and go from there.
Hi Andy, yes the data comes back as JSON and it's an object of objects from which I need just a part of it not all the data.
You should be able to access that data and set it as a variable then. Here is an example:
It's up to you whether or not you want to store the entire data returned, which might make it easier for you in the long run: