Skip to content

Commit 2b6089e

Browse files
committed
core web vitals filters change
1 parent 9a27fcb commit 2b6089e

File tree

2 files changed

+49
-2
lines changed

2 files changed

+49
-2
lines changed

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,53 @@ curl --request GET \
110110

111111
```
112112

113+
### `GET /cwv`
114+
115+
#### Parameters
116+
117+
The following parameters can be used to filter the data:
118+
119+
- `geo` (`required`): A string representing the geographic location.
120+
- `technology` (`required`): A string representing the technology name.
121+
- `rank` (`required`): An string representing the rank.
122+
- `start` (optional): A string representing the start date in the format `YYYY-MM-DD`.
123+
- `end` (optional): A string representing the end date in the format `YYYY-MM-DD`.
124+
125+
#### Response
126+
127+
```bash
128+
curl --request GET \
129+
--url 'https://dev-gw-2vzgiib6.uk.gateway.dev/v1/cwv?start=2023-01-01&end=2023-09-01&geo=Uruguay&technology=DomainFactory&rank=ALL'
130+
131+
```
132+
133+
```json
134+
[
135+
{
136+
"geo": "Uruguay",
137+
"date": "2023-06-01",
138+
"rank": "ALL",
139+
"technology": "DomainFactory",
140+
"vitals": [
141+
{
142+
"mobile": {
143+
"good_number": 1,
144+
"tested": 4
145+
},
146+
"desktop": {
147+
"good_number": 0,
148+
"tested": 2
149+
},
150+
"name": "overall"
151+
},
152+
...
153+
]
154+
}
155+
]
156+
157+
```
158+
159+
113160
### `GET /technologies`
114161

115162
#### Parameters

functions/cwvtech/libs/queries.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ def list_data(params):
1414
query = query.where('date', '>=', params['start'])
1515
if 'end' in params:
1616
query = query.where('date', '<=', params['end'])
17+
1718
if 'geo' in params:
1819
query = query.where('geo', '==', params['geo'])
1920
if 'technology' in params:
20-
params_array = json.loads(params['technology'])
21-
query = query.where('technology', 'in', params_array)
21+
query = query.where('technology', '==', params['technology'])
2222
if 'rank' in params:
2323
query = query.where('rank', '==', params['rank'])
2424

0 commit comments

Comments
 (0)