Building your query

If there are several possible options, then we need to be clear about what we want. This can be tricky if you don't know what the available options are ahead of time, but luckily most APIs have helpful documentation. Sometimes that's a selection of examples as code snippets, or sometimes you may get a reference list of values that you can call on.

For our milk analogy, the options might look something like this:

my-corner-shop API documentation
-------------------------
milk options
- size
-- 500ml, 1 litre or 2 litres
- type
-- skimmed, semi-skimmed or whole

Here's how we can tell the computer we have some extra conditions for our request.

https://my-corner-shop.com/milk?size=1

The '?' means "I have some extra query conditions ...", and 'size=1' at the end adds a filter; "1 litre, please".
If you have more than one filter to apply, you can join them with an ampersand '&' so it looks like this:

https://my-corner-shop.com/milk?size=1&type=semiskimmed