# MediaQuery
A querystring-based filtering language used to select subsets of media. When provided as an object, properties are serialized as a querystring using form style with explode.
Only the defined properties below are allowed. The object serializes to a querystring format like: `type=4&sourceType=2&sort=duration:desc,index`
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Type` | [MediaType](../../Models/Components/MediaType.md) | :heavy_minus_sign: | The type of media to retrieve or filter by.
1 = movie
2 = show
3 = season
4 = episode
5 = artist
6 = album
7 = track
8 = photo_album
9 = photo
E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries
| 2 |
| `SourceType` | *long* | :heavy_minus_sign: | Change the default level to which fields refer (used with type for hierarchical queries) | |
| `Sort` | *string* | :heavy_minus_sign: | Field(s) to sort by, with optional modifiers. Use comma to separate multiple fields, and :desc or :nullsLast for modifiers (e.g., "duration:desc,index") | |
| `Group` | *string* | :heavy_minus_sign: | Field to group results by (similar to SQL GROUP BY) | |
| `Limit` | *long* | :heavy_minus_sign: | Maximum number of results to return | |