Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions .github/workflows/deutschland_generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.11.1' ]
python-version: ['3.11.1']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

# Create default .spectral.yaml file used for linting if its not existing already
- name: "Create spectral file if it not exists"
continue-on-error: true
run: |
set -C; echo "extends: spectral:oas" > .spectral.yaml
- name: "Create spectral file if it not exists"
continue-on-error: true
run: |
set -C; echo "extends: spectral:oas" > .spectral.yaml
# Runs a single command using the runners shell
- name: "Lint file"
uses: stoplightio/spectral-action@v0.8.2
with:
file_glob: "openapi.yaml"
- name: "Lint file"
uses: stoplightio/spectral-action@v0.8.2
with:
file_glob: "openapi.yaml"

- name: "Generate deutschland code"
uses: wirthual/deutschland-generator-action@latest
with:
openapi-file: ${{ github.workspace }}/openapi.yaml
commit-to-git: true
upload-to-pypi: true
upload-to-testpypi: false
pypi-token: ${{ secrets.PYPI_PRODUCTION }}
testpypi-token: ${{ secrets.PYPI_TEST }}
python-version: ${{ matrix.python-version }}
- name: "Generate deutschland code"
uses: wirthual/deutschland-generator-action@latest
with:
openapi-file: ${{ github.workspace }}/openapi.yaml
commit-to-git: true
upload-to-pypi: true
upload-to-testpypi: false
pypi-token: ${{ secrets.PYPI_PRODUCTION }}
testpypi-token: ${{ secrets.PYPI_TEST }}
python-version: ${{ matrix.python-version }}
26 changes: 13 additions & 13 deletions .github/workflows/openapi_check.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
on: [push, pull_request]
jobs:
openapi_check:
name: "OpenAPI check"
runs-on: ubuntu-latest
steps:
openapi_check:
name: "OpenAPI check"
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v2

# Create default .spectral.yaml file used for linting if its not existing already
- name: "Create spectral file if it not exists"
continue-on-error: true
run: |
set -C; echo "extends: spectral:oas" > .spectral.yaml
- name: "Create spectral file if it not exists"
continue-on-error: true
run: |
set -C; echo "extends: spectral:oas" > .spectral.yaml

# Run Spectral
- uses: stoplightio/spectral-action@v0.8.2
with:
file_glob: openapi.yaml
spectral_ruleset: .spectral.yaml
- uses: stoplightio/spectral-action@v0.8.2
with:
file_glob: openapi.yaml
spectral_ruleset: .spectral.yaml
59 changes: 59 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Pre-commit hooks for jobsuche-api
# Mirrors the CI/CD pipeline checks from GitHub Actions
# Install: pre-commit install
# Run manually: pre-commit run --all-files

# Exclude python-client/ as it's auto-generated by CI/CD
exclude: ^python-client/

repos:
# General file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
name: Trim trailing whitespace
- id: end-of-file-fixer
name: Fix end of files
- id: check-yaml
name: Check YAML syntax
- id: check-added-large-files
name: Check for large files
args: ['--maxkb=1000']
- id: check-merge-conflict
name: Check for merge conflicts
- id: mixed-line-ending
name: Check for mixed line endings

# YAML formatting
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.12.0
hooks:
- id: pretty-format-yaml
name: Format YAML files
args:
- --autofix
- --indent=2
- --preserve-quotes
files: \.(yaml|yml)$

# OpenAPI/Spectral linting (mirrors GitHub Actions)
- repo: local
hooks:
- id: spectral-lint
name: Lint OpenAPI spec with Spectral
entry: npx @stoplight/spectral-cli lint
language: system
files: openapi\.yaml$
args:
- --ruleset
- .spectral.yaml

# Python formatting (for generated code and examples)
- repo: https://github.com/psf/black
rev: 24.2.0
hooks:
- id: black
name: Format Python code
language_version: python3
files: \.(py)$
10 changes: 10 additions & 0 deletions .spectral.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Spectral OpenAPI linting configuration
# Used by both pre-commit hooks and GitHub Actions CI/CD
# Documentation: https://meta.stoplight.io/docs/spectral/

extends: spectral:oas

# Custom rules can be added here
# rules:
# operation-operationId: warn
# operation-tags: warn
2 changes: 1 addition & 1 deletion CNAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@
jobsuche.api.bund.dev
jobsuche.api.bund.dev
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Arbeitsagentur Jobsuche API
# Arbeitsagentur Jobsuche API
Die Bundesagentur für Arbeit verfügt über die größte Datenbank für offene Stellen in Deutschland. Obwohl sie vollständig staatlich ist und es sich dabei um einen sehr spannenden Basisdatensatz handelt, mit dem viele Analysen möglich wären, bietet die Bundesagentur für Arbeit dafür bis heute keine offizielle API an.


Expand All @@ -13,7 +13,7 @@ Bei folgenden GET-requests ist die clientId als Header-Parameter 'X-API-Key' zu
## Jobbörse

**URL:** https://rest.arbeitsagentur.de/jobboerse/jobsuche-service/pc/v4/jobs


Die Jobsuche ermöglicht verfügbare Jobangebote mit verschiedenen get Parametern zu filtern:

Expand Down Expand Up @@ -62,16 +62,16 @@ Anzahl der Tage, seit der Job veröffentlicht wurde. Kann zwischen 0 und 100 Tag


**Parameter:** *pav* (Optional)
- false
- false
- true

Private Arbeitsvermittlung: Gibt an, ob Jobs von privaten Arbeitsvermittlungen in die Suchergebnisse einbezogen werden sollen.


**Parameter:** *angebotsart* (Optional)
- 1
- 2
- 4
- 1
- 2
- 4
- 34

Angebotsart: 1=ARBEIT; 2=SELBSTAENDIGKEIT; 4=AUSBILDUNG/Duales Studium; 34=Praktikum/Trainee.
Expand All @@ -85,12 +85,12 @@ Befristung: 1 = befristet; 2 = unbefristet. Mehrere Semikolon-separierte Werte m


Parameter: behinderung (Optional)
- false
- false
- true


Parameter: corona (Optional)
- false
- false
- true

Corona: Es werden nur Jobs die im Kontext von Corona angeboten werden angezeigt wenn *true*.
Expand All @@ -102,13 +102,13 @@ Umkreis: in Kilometern von *Wo*-Parameter (z.B. 25 oder 200).


**Parameter:** *arbeitszeit* (Optional)
- vz
- tz
- vz
- tz
- snw
- ho
- mj
- ho
- mj

Arbeitszeit: vz=VOLLZEIT, tz=TEILZEIT, snw=SCHICHT_NACHTARBEIT_WOCHENENDE, ho=HEIM_TELEARBEIT, mj=MINIJOB.
Arbeitszeit: vz=VOLLZEIT, tz=TEILZEIT, snw=SCHICHT_NACHTARBEIT_WOCHENENDE, ho=HEIM_TELEARBEIT, mj=MINIJOB.
Mehrere Semikolon-separierte Werte möglich (z.B. arbeitszeit=vz;tz).


Expand Down
2 changes: 0 additions & 2 deletions api_example.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ writeLines(jsonlite::toJSON(data$facetten,pretty=TRUE,auto_unbox=TRUE),paste0(Sy

urlLogo="https://rest.arbeitsagentur.de/jobboerse/jobsuche-service/ed/v1/arbeitgeberlogo/arJ0dxbYlPFXeMuZtdZzooRdCOnK2TjUXjLQlkBr-Ew="
dataLogo=httr::content(httr::GET(url=urlLogo, httr::add_headers(.headers=c("X-API-Key"=clientId)), config=httr::config(connecttimeout=60)))


34 changes: 20 additions & 14 deletions api_example.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
import requests


def search(what, where):
"""search for jobs. params can be found here: https://jobsuche.api.bund.dev/"""
params = (
('angebotsart', '1'),
('page', '1'),
('pav', 'false'),
('size', '100'),
('umkreis', '25'),
('was', what),
('wo', where),
("angebotsart", "1"),
("page", "1"),
("pav", "false"),
("size", "100"),
("umkreis", "25"),
("was", what),
("wo", where),
)
headers = {
'User-Agent': 'Jobsuche/2.9.2 (de.arbeitsagentur.jobboerse; build:1077; iOS 15.1.0) Alamofire/5.4.4',
'Host': 'rest.arbeitsagentur.de',
'X-API-Key': 'jobboerse-jobsuche',
'Connection': 'keep-alive',
"User-Agent": "Jobsuche/2.9.2 (de.arbeitsagentur.jobboerse; build:1077; iOS 15.1.0) Alamofire/5.4.4",
"Host": "rest.arbeitsagentur.de",
"X-API-Key": "jobboerse-jobsuche",
"Connection": "keep-alive",
}
response = requests.get('https://rest.arbeitsagentur.de/jobboerse/jobsuche-service/pc/v4/app/jobs',
headers=headers, params=params, verify=False)
response = requests.get(
"https://rest.arbeitsagentur.de/jobboerse/jobsuche-service/pc/v4/app/jobs",
headers=headers,
params=params,
verify=False,
)
return response.json()


result = search("bahn", "berlin")

print(result['stellenangebote'][0]["refnr"])
print(result["stellenangebote"][0]["refnr"])
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<script>
window.onload = function () {
const ui = SwaggerUIBundle({
url: "openapi.yaml",
url: "openapi.yaml",
dom_id: "#openapi"
})
}
Expand Down
Loading