From the course: Introduction to Web APIs

Unlock the full course today

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

Filter response with parameters

Filter response with parameters - REST Tutorial

From the course: Introduction to Web APIs

Filter response with parameters

- [Instructor] Okay, time to get more specific. Let's get random GIFs of something we're really interested in. For me, that's going to be squirrels. Some see them as pest, some, me, see them as adorable little acrobats. Let's look at the documentation for the random endpoint. It describes the parameters available for this endpoint. Again, the documentation for any API should clearly explain the available parameters, what they do, and examples of how to use them. We have the API key, the tag, and rating, and the docs do a good job of showing how to use them. We're not going to be using the ID parameter. Then the documentation also shows us an example of a successful response that we saw earlier and we see how we get the data object and the med object. Okay, let's go into our code and add the tag parameter so we can filter the type of random GIFs we get. Remember, we already had the question mark to denote parameters,…

Contents