Skip to content

Link to client instructions from API Keys Usage section #1192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/api/api_keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ If you choose to
[register for an API key](https://api.delphi.cmu.edu/epidata/admin/registration_form),
there are several ways to use your key to authenticate your requests:

### Using a client

* covidcast
* [R client](https://cmu-delphi.github.io/covidcast/covidcastR/reference/covidcast_signal.html#api-keys-1)
* [Python client](https://cmu-delphi.github.io/covidcast/covidcast-py/html/signals.html#covidcast.use_api_key)
* [epidatr](https://github.com/cmu-delphi/epidatr#api-keys)
* [delphi-epidata](https://cmu-delphi.github.io/delphi-epidata/api/client_libraries.html)

### Via request parameter

The request parameter “api_key” can be used to pass the API key to the server.
Expand Down
20 changes: 16 additions & 4 deletions docs/api/client_libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ parent: Other Endpoints (COVID-19 and Other Diseases)
nav_order: 1
---

# Epidata API Client Libraries.
# Epidata API Client Libraries

Epidata clients are available for
For anyone looking for COVIDCast data, please visit our [COVIDCast Libraries](covidcast_clients.md).

We are currently working on fully-featured Epidata clients for R and Python. They are not ready
for release yet, but you can track our development progress and help us test them out at:

* [epidatr](https://github.com/cmu-delphi/epidatr)
* [epidatpy](https://github.com/cmu-delphi/epidatpy)

In the meantime, minimalist Epidata clients remain available for
[JavaScript](https://github.com/cmu-delphi/delphi-epidata/blob/master/src/client/delphi_epidata.js),
[Python](https://github.com/cmu-delphi/delphi-epidata/blob/master/src/client/delphi_epidata.py),
and
Expand All @@ -15,10 +23,10 @@ The following samples show how to import the library and fetch Delphi's COVID-19
Surveillance Streams from Facebook Survey CLI for county 06001 and days
`20200401` and `20200405-20200414` (11 days total).

For anyone looking for COVIDCast data, please visit our [COVIDCast Libraries](covidcast_clients.md).

### JavaScript (in a web browser)

The minimalist JavaScript client does not currently support API keys. If you need API key support in JavaScript, contact [email protected].

````html
<!-- Imports -->
<script src="delphi_epidata.js"></script>
Expand All @@ -45,6 +53,8 @@ in the same directory as your Python script.
````python
# Import
from delphi_epidata import Epidata
# [Optional] configure your API key, if desired
#Epidata.auth = ('epidata', <your API key>)
# Fetch data
res = Epidata.covidcast('fb-survey', 'smoothed_cli', 'day', 'county', [20200401, Epidata.range(20200405, 20200414)], '06001')
print(res['result'], res['message'], len(res['epidata']))
Expand All @@ -54,6 +64,8 @@ print(res['result'], res['message'], len(res['epidata']))


````R
# [Optional] configure your API key, if desired
#option('epidata.auth', <your API key>)
# Import
source('delphi_epidata.R')
# Fetch data
Expand Down