Skip to content

Commit a72a585

Browse files
sgratzlkrivard
andauthored
docs: Apply suggestions from code review
Co-authored-by: Katie Mazaitis <[email protected]>
1 parent 0bafa31 commit a72a585

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

docs/api/covidcast.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ sources and signals.
9292
## Constructing API Queries
9393

9494
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/`.
9796

9897
See [this documentation](README.md) for details on specifying epiweeks, dates,
9998
and lists.
@@ -185,23 +184,23 @@ API calls.
185184

186185
### Alternative Response Formats
187186

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.
189188

190189
#### JSON List Response
191190

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.
193192

194193
#### CSV File Response
195194

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`.
197196

198197
#### JSON New Lines Response
199198

200199
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.
201200

202201
### Limit Returned Fields
203202

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.
205204

206205

207206
## Example URLs

docs/api/covidcast_meta.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ geographic levels at which they are reported.
1313

1414
## The API
1515

16-
The base URL is: https://api.covidcast.cmu.edu/epidata/
16+
The base URL is: https://api.covidcast.cmu.edu/epidata/covidcast_meta/
1717

1818
See [this documentation](README.md) for details on specifying epiweeks, dates, and lists.
1919

docs/new_endpoint_tutorial.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ the following:
6464

6565
# update the server
6666

67-
1. create a new file in `/src/server/endpoints/` e.g., `fluview_meta.py` or copy and existing one.
68-
2. edit the created file `Blueprint("fluview_meta", __name__)` such that the first argument should match the target endpoint name
69-
3. edit the existing `/src/server/endpoints/__init__.py`, add the newly created file to the imports at the top and to the list of endpoints below.
67+
1. create a new file in `/src/server/endpoints/` e.g., `fluview_meta.py`, or copy an existing one.
68+
2. edit the created file `Blueprint("fluview_meta", __name__)` such that the first argument matches the target endpoint name
69+
3. edit the existing `/src/server/endpoints/__init__.py` to add the newly-created file to the imports (top) and to the list of endpoints (below).
7070

7171

7272
# update the client libraries
@@ -330,7 +330,7 @@ created in this tutorial.
330330

331331
Once it's approved, commit the code. Within a short amount of time (usually ~30
332332
seconds), the API will begin serving your new endpoint. Go ahead and give it a
333-
try: https://delphi.midas.cs.cmu.edu/epidata/fluview_meta/
333+
try: https://delphi.cmu.edu/epidata/fluview_meta/
334334

335335
```
336336
{

0 commit comments

Comments
 (0)