From the course: Introduction to Web APIs

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Solution: Explore the Giphy API

Solution: Explore the Giphy API - REST Tutorial

From the course: Introduction to Web APIs

Solution: Explore the Giphy API

(upbeat music) - [Instructor] All right. I hope you enjoyed playing around with getting some random GIFs. Let's walk through how I approach this. As I said, I wanted to get some random sea otter GIFs, so I changed the value of the tag parameter to C plus otter. When I go back to the browser, I now get random sea otter GIFs. Now, I also wanted to add the title property as a caption to this page as well. So let's expand the response object. Then expand the data object. And I want to look for the title property, and I see it here in the data object. So I'm going to go back into my code and add this in. I'm going to create a variable for this GIF title. I'm going to call this var gifTitle, and that's equal to JSON data, and then the data object, and then the title property. Now I need to create an HTML element for this title. I'm going to call this caption, so var caption. That's going to equal to document.createElement,…

Contents