# Query Parameter

*noun*

say it: **“KWEER-ee puh-RAM-ih-ter”** **/ˈkwɪri pəˈræmɪtər/**

In FastAPI, a route function's parameter that isn't in the path, read from the part of the address after the ?, such as ?players=4.

## What is **Query Parameter**?

Function parameters that aren't in the path become **query parameters** (`?q=pasta&page=2`). Give a default to make them optional.

```python
@app.get('/search')
def search(q: str, page: int = 1):
    return find_recipes(q, page)
```

## In a sentence

- “Giving the **query parameter** a default of 1 made page optional.”
- “The shelf API filters games with a **query parameter**: /games?players=4.”

Level: Apprentice · [More FastAPI terms at this level](https://www.ask-codey.com/glossary?category=fastapi&level=2)

Updated: November 19, 2026

## In other subjects

- [Query Parameter in Angular](https://www.ask-codey.com/glossary/query-parameter-angular)

Source: https://www.ask-codey.com/glossary/query-parameter
