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.

  1. Set JOBDATA_API_KEY in your .Renviron.
  2. Call fetch_jobs() with any filters as a named list.
  3. Pick the fields you need into a tibble and analyze with dplyr or ggplot2.
R · r
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

  • next is a reserved word in R, hence the backticks in data$`next`.
  • Run it daily with max_age=1 to pick up new job posts; on access lite, drop max_age - the feed covers the past 90 days and upserting by id keeps 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

All integrations »

Markdown version

Explore jobdata API with AI tools

Ask an AI assistant how to search and build with live job data.