Scoped Query Filters
This system uses URL query parameters to pass structured filters to the backend. It groups criteria by entity (like odds) to ensure your queries remain organized and easy to parse.
1. URL Pattern
To apply filters, use the following syntax:
?filter[entity]=key:value1,value2;key2:value
Delimiter Rules:
:(Colon): Connects a filter key to its values.,(Comma): Separates multiple values for the same key (LogicalOR).;(Semicolon): Separates different filter keys (LogicalAND).
2. Detailed Example
Query:
?filter[odds]=bookmakers:2;markets:1,2,3,6,203;is_live:0
Breakdown:
- Entity:
odds - Filter 1:
bookmakersis set to2. - Filter 2:
marketsincludes IDs1,2,3,6, and203. - Filter 3:
is_liveis set to0(False).
Logical Interpretation:
- Odds must satisfy all of the following:
- Belong to bookmaker 2.
- Be in markets 1, 2, 3, 6, or 203.
- Be not live (inPlay) (
is_live=0).