I’m working with the Giphy API and having trouble accessing specific values from the JSON response. When I make a request to get GIF data, I receive a response but can’t seem to extract the bitly_gif_url field properly.
Here’s what I’m trying:
$.ajax({
url: giphyEndpoint,
method: 'GET',
success: function(response) {
$.each(response, function(i) {
console.log(response[i].bitly_gif_url);
});
}
});
The console keeps showing undefined instead of the actual URL. I’ve tried several different approaches to navigate through the response object but nothing seems to work. The API returns data successfully, I just can’t access the nested properties correctly. Any ideas on what I might be doing wrong?