Updated thanks to comments by Brock Adams and user43888.
There are two methods to achieve this:
Method 1: inefficient, but future-proof as it only depends on the SE API.
- Query the SE API for all Meta.SE users, in groups of 100 (maximum allowed ID)
- Get an access token and an API key, to be able to run the above call nearly 4000 times (equivalent to the total number of Meta.SE users, as of writing)
- filter those with
is_employee set to
true, and store them in
I have written a complete script that fetches the employee list by this method (you'll need to get an access token and API key yourself). However, note that this a lot of time depending on your internet speed. On my slow internet (4 Mbps), it took nearly twenty minutes to run through all the user IDs.
With a generous caching level (employee changes shouldn't be very sudden), you should run the above the tasks once a week. Also, keep checking the above current employee list daily, and in case of changes, run the above tasks again.
Method 2: efficient, but not necessarily future-proof, as it depends on a Google Apps Script page (which depends on SE API)
A simpler way is to simply fetch the data from an existing Google Apps Script, maintained by user43888, which already tracks the employee list, as well as their changes and deletions. I have also written the script to do so, here it is. This takes less than a minute at the maximum to generate all user ids. As described by user43888 themselves, the GA Script works as:
Once a a week, it scrapes of all MetaSE users, recording their
is_employee status. Once a day, it refreshes the list by re-checking the users last known as employee.
Note that you need to set
Access-Control-Allow-Origin: * headers for this to work, using extensions like this one.
Failed methods: You could look at the different users who add
[tag:status-] to questions (credits: rene). As we know this facility is only available to mods and employees, and then we could filter the employees out. However, we cannot do this in a userscript, only SEDE.