Both the following URL API calls return the same record despite using the Offset filter:



Am I querying correctly?

  • And probably both are "Invalid API key"? This site is not a DOL service desk. Try to report bug on Github. Probably your issue is related to this one. – Stanislav Kralin Sep 13 '17 at 9:11
  • No, I have a valid key and I get results back. – Jeff Sep 13 '17 at 15:26
  • 1
    Unfortunately, I can't help you, it seems that DOL blocks API requests from Russia or from Tor nodes. – Stanislav Kralin Sep 14 '17 at 7:47
  • 1
    @albert, yes. Perhaps I'm missing something, but the response to all my requests is 403 Forbidden "Invalid API key". I have obtained an API key about a week ago at developer.dol.gov. I'm not sure that the reason of the error is my location, but some US government sites really block foreign visitors, as far as I remember. – Stanislav Kralin Sep 15 '17 at 5:59
  • 1
    @albert, I'm just adding "X-API-KEY: e57b9016-431d-4b79-9712-1905d8a77fe8" header to the requests in the question (this is my real API key, feel free to use it). I'm getting connection timeout both from home and office, and I'm getting "403 Forbidden" when using Tor. – Stanislav Kralin Sep 15 '17 at 15:42

I see that the O is capitalized in offset. so try this and it should work.

curl -H "X-API-KEY: MYKEY" https://data.dol.gov/get/vets4212dataset/format/json/limit/1/offset/30/date_column/EndingPeriod/start_date/2015-07-01/end_date/2015-07-01/orderby/asc [ { "ReportID": "1956243", "ReportType": "4212", "FilingCycle": "2015", "EndingPeriod": "2015-07-01", "FormType": "Single Establishment", "OrgType": "Prime Contractor", "CoName": "Stealth Software Technologies Inc", "CoAddress": "12100 Wilshire Blvd", "CoCity": "Los Angeles", "CoCounty": "Los Angeles", "CoState": "CA", "CoZip": "90025", "HlName": "", "HlAddress": "", "HlCity": "", .... truncated } ]%

curl -H "X-API-KEY: MYKEY" https://data.dol.gov/get/vets4212dataset/format/json/limit/1/offset/20/date_column/EndingPeriod/start_date/2015-07-01/end_date/2015-07-01/orderby/asc [ { "ReportID": "1954920", "ReportType": "4212", "FilingCycle": "2015", "EndingPeriod": "2015-07-01", "FormType": "Single Establishment", "OrgType": "Prime Contractor", "CoName": "Impact Research and Technology LLC", "CoAddress": "3510 E Desert Broom Way ", "CoCity": "Phoenix", "CoCounty": "Maricopa", "CoState": "AZ", "CoZip": "85044", "HlName": "", "HlAddress": "", .... truncated } ]%

  • Should the ReportID's all be different. Or rather what's the unique key? – Jeff Oct 2 '17 at 19:36
  • Really, what I'm trying to do is download all records for a starting period. how do I do that. – Jeff Oct 2 '17 at 19:40
  • The current API has a limitation that would allow you to get about 200 records max .. so you would have to programmatically get the data by changing the offset and keeping the limit set to 200. – Giridhar Bandi Oct 2 '17 at 20:00
  • Great, thanks! Might want to update the docs here because 'Offset' is used instead of 'offset'. – Jeff Oct 2 '17 at 20:11

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.