From the course: Introduction to Web APIs
Unlock the full course today
Join today to access over 23,400 courses taught by industry experts.
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,…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Authentication with an API key4m 42s
-
(Locked)
Make a request to the Giphy API4m 13s
-
(Locked)
Filter response with parameters2m 9s
-
(Locked)
Access data in the response2m 2s
-
(Locked)
Use the response data in HTML1m 15s
-
(Locked)
Challenge: Explore the Giphy API1m 24s
-
(Locked)
Solution: Explore the Giphy API1m 50s
-
(Locked)
-
-
-