5

I am trying got download OSHA data via API. I have registered my email and got key. When i sent request its throwing invalid API KEY.

https://data.dol.gov/get/accident?KEY=REMOVED

What should we give for "Application Name" when creating Tokens ?

https://data.dol.gov/get/violation_gen_duty_std?KEY=REMOVED

I gave 'violation_gen_duty_std" for the above one.

Any help appreciated . API Details are found at http://developer.dol.gov/health-and-safety/dol-osha-enforcement/#osha_inspection

philshem
  • 17,647
  • 7
  • 68
  • 170
Abhi
  • 171
  • 5

2 Answers2

4

Looks like you got it right in your answer. The "data.dol.gov" URLs use the newer Department of Labor API (v2), which sends the Key in the http headers.

See the data.dol.gov tab for more information at:

http://developer.dol.gov/beginners-guide/

As far as the application name goes when creating a Key/token, you can use whatever you would like -- generally it is the name of your software application, project, product, etc.

Neil Neyman
  • 271
  • 1
  • 5
2
import com.sun.jersey.api.client.WebResource; 

   WebResource webResource = client.resource("https://data.dol.gov/get/inspection/limit/0");
    webResource.header("X-API-KEY", "REMOVED");
philshem
  • 17,647
  • 7
  • 68
  • 170
Abhi
  • 171
  • 5