Skip to content
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

healthdata.gov Data API is down #3

Open
ledell opened this issue Dec 29, 2014 · 3 comments
Open

healthdata.gov Data API is down #3

ledell opened this issue Dec 29, 2014 · 3 comments
Assignees

Comments

@ledell
Copy link
Member

ledell commented Dec 29, 2014

The healthdata.gov Data API seems to be offline/broken, so the rHealthDataGov R package is not working at this time. I will try to get in touch with the people who run the API to see what the problem is.

To test the API from the command line, you can run a command like this:

curl http://hub.Healthdata.gov/api/action/datastore_search --data-urlencode '
{
  "resource_id": "391792b5-9c0a-48a1-918f-2ee63caa1c54",
  "filters": {
    "addr_city": "SAN FRANCISCO"
  }
}'

This currently returns the following error:

    <html>
    <head>
    <title>Server Error</title>

    </head>
    <body>
    <h1>Server Error</h1>
    An internal server error occurred

    </body>
    </html>

In the R package, the error looks like this:

> library(rHealthDataGov)
> df <- fetch_healthdata(resource="hosp", filter=list(addr_city="SAN FRANCISCO"))
Error in .quick_fetch(jsontext) : 
@ledell ledell self-assigned this Dec 29, 2014
@abiyug
Copy link

abiyug commented Nov 26, 2016

Had the broken API issue been resolved?

@ledell
Copy link
Member Author

ledell commented Nov 26, 2016

@abiyug It doesn't seem to be working. Using the example from their own docs, there is a new error message (since the last time I checked) about the URL moving to https, but that URL doesn't work either. Example:

curl http://hub.Healthdata.gov/api/action/datastore_search --data-urlencode '
{
  "resource_id": "391792b5-9c0a-48a1-918f-2ee63caa1c54",
  "filters": {
    "addr_postalcode": 11803
  }
}'

Returns:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://hub.healthdata.gov/api/action/datastore_search">here</a>.</p>
</body></html>

Now try with https, which also returns an error:

curl https://hub.Healthdata.gov/api/action/datastore_search --data-urlencode '
{
  "resource_id": "391792b5-9c0a-48a1-918f-2ee63caa1c54",
  "filters": {
    "addr_postalcode": 11803
  }
}'

Returns:

curl: (60) SSL certificate problem: Invalid certificate chain
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

I've tried bugging the healthdata.gov folks on Twitter and I think I sent someone from heathdata.gov an email at one point, but they seem to not care that their API is broken... :-( If you have better luck getting in touch with them, please let me know!

@abiyug
Copy link

abiyug commented Nov 27, 2016

Two things:

  1. The base URL you are using "https://hub.Healthdata.gov/api/action/datastore_search" doesn't seem to exist anymore. I see the following message back when sending a get request:
<- HTTP/1.1 301 Moved Permanently
<- Accept-Ranges: bytes

It might be case of identifying the correct base URL, where this was moved to.

  1. Where did you register your api key for the "healthdata.gov"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants