In this lesson, we'll focus on how to fetch random GIFs and stickers.

The random endpoint

We can often be unsure about what exactly we want to write in our online conversations. Other times, we know what goes with the context but can't find the right word or phrase for it. GIPHY's random endpoint comes in handy here. It allows us to add some randomness to our conversations because it returns a random GIF or sticker that’s related to the word or phrase (tag) we enter. If we don't give a tag, then the GIF or sticker that’s returned is completely random. This can make things even more interesting!

The random endpoint takes the optional string request parameter, tag, along with the GIPHY API key. GIFs and stickers are then filtered to best match the tag, and are returned in a single JSON response.

Get hands-on with 1200+ tech skills courses.