Open SomervilleTom opened 3 years ago
You need to url encode the '$' as '%24':
wget "https://data.cdc.gov/resource/8xkx-amqh.json?%24select=date"
That should work. In a browser address bar you might not have to do that. If your query includes spaces, those should be replaced with +, and other characters may need to be url encoded too.
Jeesh, I thought I had tried that (I experimented with many variants of URL encoding the query string).
Worked like a charm, thank you.
I apparently spoke to soon. While the query worked, it answered with only the data for today. I expected to get data for each (like the full URL).
Here's the query I used:
wget "https://data.cdc.gov/resource/8xkx-amqh.csv?%24select=date%2Cfips%2Crecip_state%2Crecip_county%2Cseries_complete_yes"
Here is the query that I've been using (that delivers all rows).
wget "https://data.cdc.gov/api/views/8xkx-amqh/rows.csv?accessType=DOWNLOAD"
I was expecting the today's query to answer the same number of rows but with only the specified fields.
While I've read through the documentation for socrata several times, I apparently missed the section(s) that explain this behavior.
API Docs: https://dev.socrata.com/foundry/data.cdc.gov/8xkx-amqh
I want to run a simple query once each day, collecting only a few columns.
I've tried (using wget) an example that collects just the date:
wget "https://data.cdc.gov/resource/8xkx-amqh.json?$select=date"
The result is a 400: