Integrations · Programming languages
Load job postings data into R
Fetch job posts into an R data frame with httr2 and dplyr - pagination included.
Steps
You need: R 4.1+, install.packages(c("httr2", "dplyr")), API key in the JOBDATA_API_KEY environment variable and a jobdata API key.
- Set
JOBDATA_API_KEYin your.Renviron. - Call
fetch_jobs()with any filters as a named list. - Pick the fields you need into a tibble and analyze with dplyr or ggplot2.
library(httr2)
library(dplyr)
auth <- paste("Api-Key", Sys.getenv("JOBDATA_API_KEY"))
fetch_jobs <- function(query) {
req <- request("https://jobdataapi.com/api/jobs/") |>
req_headers(Authorization = auth) |>
req_url_query(!!!query, page_size = 1000)
jobs <- list()
repeat {
data <- req |> req_perform() |> resp_body_json()
jobs <- c(jobs, data$results)
if (is.null(data$`next`)) break
req <- request(data$`next`) |> req_headers(Authorization = auth)
}
jobs
}
jobs <- fetch_jobs(list(title = "data analyst", max_age = 30))
df <- bind_rows(lapply(jobs, function(j) tibble(
id = j$id,
title = j$title,
company = j$company$name,
published = j$published,
application_url = j$application_url
)))
count(df, company, sort = TRUE)
Notes
nextis a reserved word in R, hence the backticks indata$`next`.- Run it daily with
max_age=1to pick up new job posts; on access lite, dropmax_age- the feed covers the past 90 days and upserting byidkeeps it free of duplicates.
Related docs and tutorials
Jobs API Ingestion Guide: Reliable Historical Backfills and Incremental Syncs
A practical guide to high-volume historical backfills and incremental syncs using bounded windows, multi-pass pagination, ID deduplication, and reconciliation.
Optimizing API Requests: A Guide to Efficient jobdata API Usage
A guide on how to make efficient requests using sessions and handle large data sets with pagination.
Ready to load real data?
All endpoints are public for limited testing - run the script without a key to see the structure, then add your key. Flat monthly plans with unlimited usage.
More integrations
Explore jobdata API with AI tools
Ask an AI assistant how to search and build with live job data.