Homeglossary

What Are Query Parameters?

Query parameters are the key-value pairs that come after a question mark in a web address, used to pass extra information to the server, like which items to filter, how to sort them, or what to search for. They matter because they let one page or endpoint return many different results without needing a separate address for every version.

The fastest way to learn them is to build with them.

How query parameters work

A query parameter is written as a key and a value joined by an equals sign, added to the end of a URL after a question mark, like ?category=shoes. To pass more than one, you join them with an ampersand: ?category=shoes&size=10. The server reads these pairs and adjusts what it sends back, so the same base address can return filtered, sorted, or searched results depending on the parameters attached. Because they sit in the URL itself, they are also easy to share and bookmark, and they are best kept to non-sensitive values since the whole address is often logged.

Query parameters examples

Imagine an app with a page that lists products. Instead of building a separate page for every category, you use one page and change the query parameters: /products?category=shoes shows shoes, and /products?category=shoes&sort=price shows shoes ordered by price. The page stays the same; the parameters tell the server which slice of data to return, so one address quietly powers dozens of views.

Frequently Asked Questions

Your Questions, Answered

This will automatically populate, don't change

Don't change this element unless you know what you are doing

Start Building
on Emergent today
Start Building