Query Parameter
A value added to a URL to filter, search, sort, or control a request.
What is it?
A query parameter is information added to the end of a URL.
It helps control what data the request asks for.
Simple Definition:
A query parameter changes or filters a request.
Think of it like...
Think of a search form.
The endpoint identifies what type of data you want.
The query parameters describe how you want that data filtered.
What does it do?
Query parameters commonly help with:
Where is it used?
Query parameters are commonly used in:
Example
GET /api/orders?status=completedBreak down:
GET /api/orders?status=completed&page=2Multiple query parameters are usually separated with &.
How it connects
Example:
Do Not Confuse
Query Parameter
Usually controls filtering or optional request behavior.
Example:/api/orders?status=completed
Path Parameter
Usually identifies a specific resource inside the URL path.
Example:/api/orders/1001
Topic Glossary
| ENGLISH TERM | 中文 | SIMPLE ENGLISH | 中文小白理解 |
|---|---|---|---|
| Query Parameter | 查询参数 | A value added to a URL to control or filter a request. | 加在 URL 后面用来筛选或控制请求的参数。 |
| Parameter | 参数 | A value passed into a request. | 发送给系统、用来影响请求处理方式的数据。 |
| Query String | 查询字符串 | The part of a URL after ?. | URL 中 ? 后面的一整段查询参数。 |
| Filter | 筛选 | Limiting results based on a condition. | 根据某个条件只返回符合要求的数据。 |
| Search | 搜索 | Finding data that matches a value. | 根据输入内容查找符合条件的数据。 |
| Sort | 排序 | Changing the order of returned data. | 改变返回数据的排列顺序。 |
| Pagination | 分页 | Returning data in smaller pages. | 把大量数据分成多页返回。 |
| Endpoint | 接口地址 | The API address before the query parameters. | 查询参数前面的 API 访问地址。 |
? | 查询开始符 | The character that starts the query string. | URL 中表示查询参数开始的符号。 |
& | 参数分隔符 | The character used to separate multiple query parameters. | URL 中用来分隔多个查询参数的符号。 |
What to Remember
Query parameters are added after the URL path.
They commonly filter, search, sort, or control results.
Query parameters are usually optional.