0

My students and I are trying to access child labor statistics data from the Sweat and Toil dataset, with the endpoints as described on https://developer.dol.gov/others/sweat-and-toil/, and using the format as described at https://developer.dol.gov/beginners-guide/#apiv2.

When trying (in Python) to do so with code like the following:

response = requests.get("https://data.dol.gov/SweatToilAllStatistics", headers={'X-API-KEY': 'KEYREMOVED'})

we get a 404. For some other data sets in Sweat and Toil (and other v2 datasets we've tried), we get a 403 with the following response:

{
    "status": "",
    "error": "Invalid API Key"
}

But when I use this exact same API key on some v1 API datasets, e.g.,

response = requests.get("http://api.dol.gov/V1/DOLAgency/Agencies/?KEY=KEYREMOVED") 

it works fine, so I actually don't think "Invalid API Key" is the true issue here. The same issue occurs when attempting this with curl. Any help anyone might be able to offer would be much appreciated. Thanks so much!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.