# Query Parameter

> A name and value added after a ? in a web address, like ?page=2.

**Field:** Infrastructure  
**Category:** Networking  
**Also known as:** Query String, URL Parameter, Query Params

## Think of it like

Think of it like the extra notes on an order. Size large, no onions.

## Definition

A query parameter is a name and a value added to the end of a web address. It comes after a question mark. In /search?q=shoes&page=2, q and page are query parameters. Each pair is joined with an equals sign, and pairs are split by an ampersand. They are used to search, filter, sort and pick a page. Anyone can see them, so they must never hold secrets.

## Example

Jack filters a shop by colour. The address becomes /shoes?colour=red&size=9, and the server sends back only red shoes in size 9.

## Example code

```url
https://example.com/search?q=shoes&page=2
```

Two query parameters: q is shoes and page is 2.

## Why it matters

They turn a page you filtered or searched into an address. You can share it, save it and load it again.

## Common mistake

Forgetting to encode spaces and symbols. A search for rock & roll breaks unless the & is written as %26.

## Three principles

- **After the question mark.** At the end of the address.
- **Name equals value.** Split by &.
- **Public.** Never put secrets there.

## Related terms

- [Uniform Resource Locator (URL)](https://learn.benibix.com/term/general/url)
- [GET Request](https://learn.benibix.com/term/infrastructure/get-request)
- [HTTP Request](https://learn.benibix.com/term/infrastructure/http-request)
- [Pagination](https://learn.benibix.com/term/development/pagination)

## Told apart from

- [Query Parameter vs Request Body](https://learn.benibix.com/compare/query-parameter-vs-request-body): A query parameter goes in the address, after the question mark. Anyone can see it there. A request body goes inside the request, after the headers. Short filters go in the address; passwords, forms and files go in the body.

## Taught in

- [HTTP Methods: GET vs POST](https://learn.benibix.com/learn/infrastructure-networking/http-methods-get-vs-post): Computer Networking, 10/13

---

Source: https://learn.benibix.com/term/infrastructure/query-parameter
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
