Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
lmk
Regular Visitor

Trying to Call an API from the Dept of Labor that filters Dates

How do I filter this table https://dataportal.dol.gov/datasets/10236 by all records after a certain date using a DOL API query.  {"field": "YOUR_FIELD","operator": "gt","value": "YOUR_VALUE"} If I put load_dt in the "value" and the Date, for example 2024-10-12. the query won't work.  What am I doing wrong?

4 REPLIES 4
lmk
Regular Visitor

Yes. I have an API key.  I don't know the proper format for filtering by date in the API call. 

Hi @lmk,

You can take a look at the PDF document 'Conditional Filtering ' part and it shows how the filter condition defines and usages:

dol-api-user-guide.pdf

Sample query:

https://apiprod.dol.gov/v4/get/agency/dataset/json?limit=10&offset=0&sort=asc&sort_by=Date
&filter_object={"and":[{"field":"dataset_id","operator":"eq","value":"10236"}, {"field":"date","operator":"eq","value":"2024-10-12"}]}&X-API-KEY= 
xxxxxxxx

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
v-shex-msft
Community Support
Community Support

Hi @lmk,

I check the document and find it include a login-in/registration function to get access tokens, and the other type of operation all required this in following rest api usages.

Spoiler
Getting Started
To use our APIs, you need to register for an account at https://dataportal.dol.gov/registration and
complete our questionnaire to get an API key. Once you register, there may be a slight delay while the
system incorporates your credentials, and you may need to wait for a few minutes and/or refresh your
screen before an API key is generated in your account. Your API key will look like a mixture of numbers,
letters, and special characters. You can create additional keys (up to 5) if you need to use them for
different purposes, client applications, or automation.
Your API key is what grants you access to the DOL API and is a required parameter for all metadata
and data requests. You can always find, manage, and create new keys by signing into the open data
portal and going to https://dataportal.dol.gov/api-keys. The sharing of your API key(s) with others,
including on public code repositories or other public forums is strictly prohibited and may result in
the termination of your API service.

DOL API User Guide - dataportal.dol.gov
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
lbendlin
Super User
Super User

That API key requires registration.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.