Request parameters
Query parameters help you to filter and request for a specific data from an APÌ endpoint.
You can use query parameters in two ways:
- Append Query parameters at the end of the URL
- Use the "Parameters" tab
Adding parameters in the URL
To add a parameter in the URL, append ?
at the end of the URL and add a parameter in key=value
format.
You can add multiple parameters by separating them using &
.
For example, the below URL is filtered to get the data of the first three pokemon
https://jsonplaceholder.typicode.com/comments?postId=1&id=3
For which you will get a similar response:
[
{
"postId": 1,
"id": 3,
"name": "odio adipisci rerum aut animi",
"email": "Nikita@garfield.biz",
"body": "quia molestiae reprehenderit quasi aspernatur\naut expedita occaecati aliquam eveniet laudantium\nomnis quibusdam delectus saepe quia accusamus maiores nam est\ncum et ducimus et vero voluptates excepturi deleniti ratione"
}
]
Using the Parameters tab
Additionaly, you can add the parameters as a key-value pair in the parameters tab, and these will be appended to the URL automatically when you send the request.
Try using the parameters tab to see if you get the same response as adding parameters in the URL.
Table of Contents