dol_get_dataset
Fetch records from a specific U.S. Department of Labor dataset using agency abbreviation and endpoint, with optional limit, offset, and equality filters. Requires a free DOL API key.
Instructions
Fetch records from ONE US DOL dataset (apiprod.dol.gov /v4/get/{agency}/{endpoint}/json). ★REQUIRES a free DOL_API_KEY: the DOL DATA endpoint has NO keyless tier — without the key this tool THROWS an honest config error (get one at https://dataportal.dol.gov/registration; dol_list_datasets stays keyless). Input: agency (required — the agencyAbbr from dol_list_datasets, e.g. 'WHD'/'OSHA'/'ILAB'; rides the PATH, ^[A-Za-z0-9_]+$), table (required — the dataset's apiUrl endpoint from dol_list_datasets; rides the PATH, ^[A-Za-z0-9_]+$), optional limit (def 10, max 100), offset, filterField+filterValue (paired equality filter), fields (best-effort column selection). Returns { records:[…verbatim dataset rows…] } + honest _meta. HONESTY: records are surfaced VERBATIM (field names/values preserved as-is — genuine 0 stays 0, missing field stays null; never coerced or fabricated). totalAvailable is a real count ONLY when the response carries one, else null (honest unknown — returned is NEVER passed off as the total). A full page → hasMore; page forward to confirm. Missing/invalid key (401/403) → invalid_input carrying DOL_API_KEY guidance (never empty); 400 → invalid_input; genuine empty → honest empty; 429 → rate_limited THROWS (Retry-After honored); 5xx/timeout → upstream_unavailable THROWS; 200 non-JSON / no row array → schema_drift. Key rides ONLY in the X-API-KEY request header — never URL/_meta.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max records to return (default 10, max 100). Offset-paginated. | |
| table | Yes | The dataset endpoint — the `apiUrl` field from dol_list_datasets (the DOL 'api_url', NOT the tablename), e.g. 'Child_Labor_Report__2016_to_2022'. Rides in the request PATH. Validated ^[A-Za-z0-9_]+$. Required. | |
| agency | Yes | The agency abbreviation (the `agencyAbbr` from dol_list_datasets), e.g. 'WHD', 'OSHA', 'ILAB'. Rides in the request PATH. Validated ^[A-Za-z0-9_]+$. Required. | |
| fields | No | Optional: best-effort column selection (a subset of field names to return). Not documented for v4; the API ignores or 400s an unsupported selection (surfaced honestly). | |
| offset | No | Row offset for pagination (default 0). Page with _meta.pagination.nextOffset. | |
| filterField | No | Optional: a dataset field name to filter on (paired with filterValue → a DOL filter_object equality filter). Supply BOTH or NEITHER. | |
| filterValue | No | Optional: the value the filterField must equal. Supply BOTH filterField and filterValue, or NEITHER. |