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 the response with parameters

Filter the response with parameters - REST Tutorial

From the course: Introduction to Web APIs

Filter the response with parameters

- [Instructor] The base URL allows us to connect to the API and get a response full of data, but we can filter that data using parameters. You really can think of parameters just like filters use all the time on websites. The API's documentation should provide you with the parameters or options available to you. Typically, the options allow you to narrowly specify the data you get or organize the way you get the data. Let's look at the H+Sports documentation to see the parameters and what they do. The first parameter here is quantity or QTY. It says we can use any integer value to reduce the number of products we get in our response. We can also set how the products are ordered. ID is the default that we've seen, but it could be name or description or by price. There's an ID parameter so we can select a very specific product. We can sort the products by ascending or descending order. And there's also page and format…

Contents