You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/covidcast.md
+5-6Lines changed: 5 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -92,8 +92,7 @@ sources and signals.
92
92
## Constructing API Queries
93
93
94
94
The COVIDcast API is based on HTTP GET queries and returns data in JSON form.
95
-
The base URL is `https://api.covidcast.cmu.edu/epidata/`. The covidcast
96
-
endpoint is `https://api.covidcast.cmu.edu/epidata/covidcast/`.
95
+
The base URL is `https://api.covidcast.cmu.edu/epidata/covidcast/`.
97
96
98
97
See [this documentation](README.md) for details on specifying epiweeks, dates,
99
98
and lists.
@@ -185,23 +184,23 @@ API calls.
185
184
186
185
### Alternative Response Formats
187
186
188
-
In addition to the default EpiData Response format, users can customize the response format using the `format=`parameters.
187
+
In addition to the default EpiData Response format, users can customize the response format using the `format=`parameter.
189
188
190
189
#### JSON List Response
191
190
192
-
When setting the format parameter to `format=json`, it will return a plain list of the `epidata` response objects without the `result` and `message` wrapper. The status of the query is returned via HTML status codes. For example, a status code of 400 indicates that the request has wrong or missing parameter. The returned value is a JSON message with details.
191
+
When setting the format parameter to `format=json`, it will return a plain list of the `epidata` response objects without the `result` and `message` wrapper. The status of the query is returned via HTTP status codes. For example, a status code of 200 means the query succeeded, while 400 indicates that the query has a missing, misspelled, or otherwise invalid parameter. For all status codes != 200, the returned JSON includes details about what part of the query couldn't be interpreted.
193
192
194
193
#### CSV File Response
195
194
196
-
When setting the format parameter to `format=csv`, it will return a CSV file with same columns as the response objects. Similar to the JSON list response status codes are used.
195
+
When setting the format parameter to `format=csv`, it will return a CSV file with same columns as the response objects. HTTP status codes are used to communicate success/failure, similar to `format=json`.
197
196
198
197
#### JSON New Lines Response
199
198
200
199
When setting the format parameter to `format=jsonl`, it will return each row as an JSON file separated by a single new line character `\n`. This format is useful for incremental streaming of the results. Similar to the JSON list response status codes are used.
201
200
202
201
### Limit Returned Fields
203
202
204
-
The `fields` parameter can be used to limit the number of returned fields in each returned row. This is useful in web application to reduce the amount of data that is downloaded. The `format` parameter supports two syntaxes. On the one hand, when listing field names only those field names will be returned. For example, `fields=geo_value,value` will return only those selected fields. On the other hand, when listing field names with a preceding dash, it will be interpreted to exclude those fields. For example, `fields=-direction` will not return the `direction` field.
203
+
The `fields` parameter can be used to limit which fields are included in each returned row. This is useful in web applications to reduce the amount of data transmitted. The `fields` parameter supports two syntaxes: allow and deny. Using allowlist syntax, only the listed fields will be returned. For example, `fields=geo_value,value` will drop all fields from the returned data except for `geo_value` and `value`. To use denylist syntax instead, prefix each field name with a dash (-) to exclude it from the results. For example, `fields=-direction` will include all fields in the returned data except for the `direction` field.
0 commit comments