socdataR / wonderapi

Assists in making queries to CDC Wonder API
https://socdatar.github.io/wonderapi/
23 stars 14 forks source link

Updated XML defaults and edited vignettes #21

Closed brendensm closed 8 months ago

brendensm commented 8 months ago

The following commits:

jtr13 commented 8 months ago

Thanks so much, this is awesome! I got stuck on updating the default query lists -- did you get them directly from the CDC?

brendensm commented 8 months ago

Yes! I downloaded the query list right from the web interface. I'm not sure what changes specifically did it, but I made sure our lists matched each one I downloaded.

jtr13 commented 8 months ago

Could you share the link to the query lists? I worked with default query lists that someone at the CDC emailed me, and they kept getting out of date really quickly.

There are still problems with the order of the group by variables and the limiting parameters in general. When I get a chance I'll open a new issue.

brendensm commented 8 months ago

When I emailed the folks at wonder, they directly me to submit a query through the interface for an example XML request. Here is their language:

"To download example XML query parameters for any specific request, after the results to your query are display in the Results tab, then click the “API Options” button below the tabs, to open a dialog that offers you the specific request and results in XML format. You can use the “request” file as a template for posting the query via the API."

For this, I went to each natality data base and submitted a blank request, only grouping by year. Then I downloaded the XML per the email's instructions.

jtr13 commented 8 months ago

This is amazing... I wonder if it's always been there or it's a new option.

brendensm commented 8 months ago

I'm not sure, but I'm glad I emailed! It makes life much easier.

jtr13 commented 8 months ago

I made some updates to a function send_query() that I was mostly using for testing but might be very helpful esp if queries with getData() aren't working properly. It makes the query request directly from the exported .xml file. See the readme or Intro vignette. If you do check it out, feedback welcome.