Developer's Guide

New API (v3) coming Summer 2018.
  • API Details

  • Get Help

  • API Key (Token) Creation Process

    • Visit https://devtools.dol.gov/developer
    • Go to the login page and enter your username and password
    • Click on the My Tokens link
    • Click "Create New Token"
    • Provide a Shared Secret, Application Name, and a Description
    • The token value will be auto-generated and added to your tokens list.
  • Accessing the API

    • API.DOL.GOV

      The API is exposed as an OData producer, with the addition of request authorizations. We are providing SDK's for some platforms that abstract the OData and request signing process and provides you with an easy to use method call. Please visit the SDKs Page to learn more about the DOL Data SDKs.

      Example Assume that you want to read data from the agencies table found in the dataset named DOLAgency. The request URL is:

      http://api.dol.gov/V1/DOLAgency/Agencies

      Your API Key (Token) is d9c6c290-da4c-424e-a378-fb4bd027b58z

      note: This token is only an example. It is not usable.s

      Your direct link to Agency data using the input above is:

      http://api.dol.gov/V1/DOLAgency/Agencies/?KEY=d9c6c290-da4c-424e-a378-fb4bd027b58z

    • DATA.DOL.GOV

      The API is exposed as a RESTful interface. We require you to authenticate by placing your token in the header. We are providing SDK's for some platforms in order to provide you with an easy to use method call. Please visit the SDKs Page to learn more about the DOL Data SDKs.

      Example Assume that you want to read data from the incidents table found in the OSHA Enforcement dataset. The request URL is:

      https://data.dol.gov/get/inspection

      Your API Key (Token) is d9c6c290-da4c-424e-a378-fb4bd027b58z

      Your authentication header would contain the key/value of:

      X-API-KEY: d9c6c290-da4c-424e-a378-fb4bd027b58z

  • Result Format

    • API.DOL.GOV

      By default, the DOL V1 (api.dol.gov) API's responses are in XML format. To receive the data in JSON, send an "Accept" header with "application/json."

    • DATA.DOL.GOV

      Data.dol.gov sends responses by default in JSON format. To customize the return format, simply add /format/xml or /format/json to the request URL. For example:

      https://data.dol.gov/get/inspection/format/xml

  • Next Steps

    Following the steps above will return the first 100 records. To retrieve more or to be more selective in the data that is returned, read on about accessing the API using HTTP requests.

    How to Customize Your Request

EXPERIENCED DEVELOPER'S GUIDE

New API (v3) coming Summer 2018.