跳到正文
DEV Community· Loukas Tzekos·· 4 小時前AI 評分50

如何用 Job Opportunities API 篩選僱主明確標示「remote」的職位(Python,20 行)

Find remote jobs where the employer actually said "remote" (Python, 20 lines)

AI 導讀

Job Opportunities API(JOA)可透過 remote_confirmed=true 篩出僱主自行發布「remote」的職位,排除只由模型推斷為遠端的職位。Python 腳本可查詢近 7 日最多 20 個職位,列出來源標記及僱主的申請連結。加入 has_salary=true,則只保留僱主發布薪酬的職位。

正文

Loukas Tzekos

Most job data marks a job "remote" because a model guessed it from the text. Sometimes that's right. Often it's "hybrid, 3 days in Munich". Here's how to get only the jobs where the employer itself published "remote", using Job Opportunities API (JOA). Every field in JOA says whether it was published by the employer or inferred by us, in field_sources.

1. Get a free key (no card): https://jobopportunitiesapi.org/login

2. The script

import os, datetime, requests

API = "https://api.jobopportunitiesapi.org/v1/jobs"
api_key = os.environ.get("JOA_API_KEY")  # free key: https://jobopportunitiesapi.org/login

params = {
    "title": "data engineer",
    "country": "DE",
    "remote": "remote",
    "remote_confirmed": "true",          # only jobs where the EMPLOYER said "remote"
    "posted_after": (datetime.date.today() - datetime.timedelta(days=7)).isoformat(),
    "limit": 20,
}
r = requests.get(API, params=params, headers={"Authorization": "Bearer " + api_key}, timeout=30)
r.raise_for_status()

for job in r.json()["data"]:
    src = job["field_sources"]
    print(f'{job["title"]} | {job["company"]} | remote ({src["remote"]}) | {job["apply_url"]}')

3. Run it

Put your key in an environment variable called JOA_API_KEY, then run python remote_jobs.py.

Real output from today:

Senior Scientific Data Engineer | TetraScience | remote (published) | https://apply.workable.com/j/CD8C2AFA42/apply
Senior Data Engineer (m/w/d) | Device Insight | remote (published) | https://device-insight.breezy.hr/p/2e7513bb4c5e01-senior-data-engineer-m-w-d

Every link goes to the employer's own application page, not a job board.

What changed vs. a normal search
remote_confirmed=true drops every job where "remote" was only inferred. Drop that line and you get more results, each labelled inferred or published, so you can decide yourself.

Ideas

  • Run it daily with cron and send the list to Slack or email.
  • Swap title and country for your stack and market.
  • Add has_salary=true to keep only jobs where the employer published a salary.

What filter do you wish job sites had?

來源:DEV Community · dev.to