Open davidkellerman opened 5 years ago
The inspection data should be working now. we are working with the database team to fix the accident dataset issues.
Hmm. I wonder if there's more than one problem. I'm still getting the same error with the get/inspection
request.
I just came across the same error as @davidkellerman, at least with regards to the accident table. It looks like the API calls to the accident table are actually being routed to the accident abstract table.
For example, using the example from the API documentation:
curl -k -H "X-API-KEY: ..." https://data.dol.gov/get/accident/format/json/limit/1/offset/5/columns/summary_nr:event_desc:event_time
gives the error "Not Acceptable. Check suggested format." However, if I drop the filtering requests curl -k -H "X-API-KEY: ..." https://data.dol.gov/get/accident/format/json/limit/1/offset/5
I get back a valid response:
{ "SUMMARY_NR": "220965826", "LINE_NR": "2", "ABSTRACT_TEXT": "in a ship\u0019s hull. The employee became overheated while working within the ", "LOAD_DT": "26-MAR-18 03.59.55.000000 PM -04:00", "RNUM": "6" }
This is the record format for the accident abstract table. This explains why the request filtering on columns doesn't work as these columns don't exist in the abstract table.
Any update on this request? Still seems to be an issue for inspections.
@jvarugh just wanted to confirm if you are enquiring about filtering by date or date_column filter?
@giridhar
Both I guess. I'm running a very similar request to the OP.
GET Request:
https://data.dol.gov/get/inspection/limit/200/offset/0/date_column/open_date/start_date/2020-01-01
GET Response::
{ "status": "0", "error": "Not Acceptable. Check suggested format." }
Seems like no matter what date_column value (open_date in this case), the response is always the same.
I am using the documentation here: https://developer.dol.gov/accessing-the-apis-using-http-requests/#apiv2
@jvarugh We are aware of date filters not working as desired and we are diligently working on an improvement of API capabilities. While it is not ideal, you may leverage other filters to limit results and then filter by date outside of the API call once you have the full set of data. As these capabilities are ready for release, announcements will be posted via our developer website. Thank you.
@giridhar
That is our current workaround, but that requires us to pull 4 million+ records (which took several days) to obtain only ~30,000 for 2020, or ~400K since 2015.
Will you update this ticket when there is a fix for this?
The website/DOL subscriptions are for all things DOL related, not specifically API related.
Thanks,
The issue is that, despite of the documentation, this column is a string, not a date
try with /filter_column/CASE_MOD_DATE=10-DEC-13
to get that specific date
5 years after this issue reported, I see this problem still exists, but a data source error:
GET https://data.dol.gov/get/inspection/date_column/open_date/start_date/2024-01-01
{ "error": { "status": "", "message": "Data Source Not Available" }, "response": "503" }
@ewaldccc, the APIv2 will be going away in a couple of months. Please check out the new APIv4 service at https://dataportal.dol.gov/.
This command is getting a "Not Acceptable. Check suggested format." error:
I also tried a bunch of variants, trimming out filtering options, all with the same result.
As a reality check, I also tried the examples at the bottom of the ACCESSING THE API USING HTTP REQUESTS page:
They, too, get the same "Not Acceptable. Check suggested format." error.
Help! I'm baffled.