Comments (3)
@krivard Do you have an example of how they are calling the API?
Assuming something like cURL to make requests, this is a cool example of using jq to format responses in CSV.
You'd pretty much pipe into jq with this bit of magic:
jq -r '.epidata | (map(keys) | add | unique) as $cols | map(. as $row | $cols | map($row[.])) as $rows | $cols, $rows[] | @csv'
An ex. against our API (truncated a wee bit):
❯ curl -s -X GET "https://delphi.cmu.edu/epidata/api.php?source=covidcast&cached=true&data_source=jhu-csse&signal=confirmed_incidence_num&geo_type=county&time_values=20200501&time_type=day&geo_value=*&as_of=20200509" | jq -r '.epidata | (map(keys) | add | unique) as $cols | map(. as $row | $cols | map($row[.])) as $rows | $cols, $rows[] | @csv'
"direction","geo_value","issue","lag","sample_size","stderr","time_value","value"
0,"01001",20200507,6,,,20200501,-2
0,"01003",20200507,6,,,20200501,1
0,"01005",20200507,6,,,20200501,3
0,"01007",20200507,6,,,20200501,0
0,"01009",20200507,6,,,20200501,2
0,"01011",20200507,6,,,20200501,1
0,"01013",20200507,6,,,20200501,12
0,"01015",20200507,6,,,20200501,-1
0,"01017",20200507,6,,,20200501,-5
0,"01019",20200507,6,,,20200501,0
0,"01021",20200507,6,,,20200501,-1
...
Redirected to a file and viewed in something fancy:
from delphi-epidata.
from delphi-epidata.
Fixed in #210
from delphi-epidata.
Related Issues (20)
- KCDC data is old (Oct 2020) HOT 1
- Inspect HHS dataset for revision inconsistencies and produce patches HOT 2
- Mention NHSN in `covid_hosp*` and `covidcast` `hhs` docs
- Update database drivers HOT 2
- Error when API request is made for an invalid region? HOT 1
- Replace misleading numeric values in `covid_hosp_facility`? HOT 2
- `covid_hosp_state_timeseries` doesn't return any data HOT 3
- `covid_hosp_facility` has entries with malformed `collection_week` dates HOT 1
- covid_hosp_facility data from Aug 7, 2023 is corrupted HOT 1
- fix uncaught user input processing in date util HOT 2
- Update deprecated github actions HOT 1
- Consider deprecation/removal of delphi_epidata.R client HOT 1
- "Date of last change" dates for some COVIDcast-signals pages should actively link to changelog HOT 1
- Missing from the Changelog's sources and signals is google-symptoms
- Move DB driver specification out of config and into code
- Log "Referer" header to help track tool usage HOT 1
- Some NY data missing from `fluview`
- Synchronize dependency versioning on automation servers HOT 1
- Document `covid_naat_pct_positive_7dav` in `dsew-cpr`
- API queries timing out at 1 min in the proxy HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from delphi-epidata.