Guide · Jobs data

USAJOBS API: how to search US federal jobs in code

USAJOBS, the US federal government's jobs site, publishes its open job announcements through a free Search API at data.usajobs.gov. It's the official source, it's free, and it needs a key.

Getting access

Request a key on the USAJOBS developer site. Every request then sends three headers:

Header Value
Host data.usajobs.gov
User-Agent the email address you used to request the key
Authorization-Key your API key

The limits

Python: data scientist jobs posted this week

import os, requests

headers = {
    "Host": "data.usajobs.gov",
    "User-Agent": os.environ["USAJOBS_EMAIL"],
    "Authorization-Key": os.environ["USAJOBS_API_KEY"],
}
params = {"Keyword": "data scientist", "DatePosted": 7, "ResultsPerPage": 500, "Page": 1}

jobs = []
while True:
    r = requests.get("https://data.usajobs.gov/api/Search", headers=headers, params=params, timeout=30)
    r.raise_for_status()
    result = r.json()["SearchResult"]
    jobs += [item["MatchedObjectDescriptor"] for item in result["SearchResultItems"]]
    if params["Page"] >= int(result["UserArea"]["NumberOfPages"]):
        break
    params["Page"] += 1

for job in jobs[:5]:
    pay = job["PositionRemuneration"][0]
    print(job["PositionTitle"], "|", job["DepartmentName"], "|", pay["MinimumRange"], "to", pay["MaximumRange"], pay["Description"])

Where it trips people up

We built this

Disclosure: Your Evenings Ltd built and sells this. It isn't operated, sponsored, approved or endorsed by OPM, USAJOBS or any federal agency. USAJOBS API (Unofficial): Federal Government Jobs on the Apify Store reads the official USAJOBS Search API with its own key, so you don't need one:

Pricing: $0.002 per job, and $0.01 per monitor run that finds new jobs (base prices; higher Apify plans pay less). Status rows and jobs your filters drop are free.

FAQ

Do I need a key for the USAJOBS API? Yes. Request one on developer.usajobs.gov and send it in the Authorization-Key header, with your email as the User-Agent.

How many results can the USAJOBS API return? Up to 500 a page and 10,000 a query.

Why do I see fewer jobs than on usajobs.gov? The API returns jobs open to the public by default. Announcements for current federal employees and other status candidates need extra authorisation.

Can I apply through the API? No. Each job has an official apply link. Apply on usajobs.gov using the instructions in the announcement.

Product names and logos belong to their owners. Your Evenings Ltd is not affiliated with or endorsed by them. Job data from the USAJOBS Search API. Your Evenings Ltd is not operated, sponsored, approved or endorsed by OPM, USAJOBS or any federal agency.