DEV Community

Cover image for How to Scrape France Travail Jobs with the France Travail Scraper
ReventaData
ReventaData

Posted on Originally published at apify.com

How to Scrape France Travail Jobs with the France Travail Scraper

By the end of this tutorial you will have a Python script that searches public France Travail job offers by keyword, waits for the run to finish, and prints one line per offer with its title, company, place and salary text. The output is JSON rows you can store, filter or load into a spreadsheet.

France Travail is France's national job board. Searching it for one job title and then copying company names, places and salaries by hand takes a long time. This tutorial replaces that with one API call from Python.

We use the France Travail Scraper Actor (reventadata/francetravail-scraper) from Python with the official apify-client package. The Actor reads public job offers on the France Travail site. It needs no login. It is an unofficial tool and is not affiliated with France Travail.


Prerequisites

To follow this tutorial, you need:

  1. Python 3.11 or newer installed on your machine.
  2. The Apify API client for Python. Install or upgrade it with:
pip install -U "apify-client~=3.0"
Enter fullscreen mode Exit fullscreen mode
  1. An Apify account and your personal API token. Copy the token from API & Integrations in the Apify Console.

Set the token as an environment variable in your terminal:

export APIFY_API_TOKEN="your_apify_token_here"
Enter fullscreen mode Exit fullscreen mode

What you'll achieve

Each dataset row is one job offer. A row carries the offer id, title, url, companyName, city, departmentCode, contractType, experience, romeCode and romeLabel, the salary fields, createdAt and applyUrl.

The end result is a file of rows that you can filter with a line of Python: keep the offers with one contractType, sort them by createdAt, or count the offers per romeLabel. The next section shows real rows, so you know what to expect before you run anything.

Example use case: list the accounting offers in one department on CDI contracts, with their salary text and apply links, and save the rows to a file each morning.

Note on data: the Actor returns what each offer publishes. Company names, recruiter names and contact details appear as the offer shows them, and the rows are not edited.


Sample rows

The rows below are three of the 10 rows from a run dated 2026-11-20, with some fields trimmed for length. These rows do not come from the filtered script in Step 2: they include other departments and contract types, so your rows will differ.

[
  {
    "id": "216QWCR",
    "url": "https://candidat.francetravail.fr/offres/recherche/detail/216QWCR",
    "title": "Comptable (H/F)",
    "companyName": null,
    "city": "Fort-de-France",
    "postalCode": "97200",
    "departmentCode": "972",
    "contractType": "CDD",
    "experience": "2 An(s)",
    "romeCode": "M1203",
    "romeLabel": "Comptable",
    "salaryText": "Mensuel de 1867.06 Euros",
    "salaryMin": 1867.06,
    "salaryMax": null,
    "salaryFrequency": "Mensuel",
    "createdAt": "2026-11-19T21:15:41.922",
    "applyUrl": null
  },
  {
    "id": "216QVRC",
    "url": "https://candidat.francetravail.fr/offres/recherche/detail/216QVRC",
    "title": "Comptable (H/F)",
    "companyName": "MANPOWER",
    "city": "Biars-sur-Cère",
    "postalCode": "46130",
    "departmentCode": "46",
    "contractType": "MIS",
    "experience": "Débutant accepté",
    "romeCode": "M1203",
    "romeLabel": "Comptable",
    "salaryText": "Horaire de 12.7 Euros à 15.0 Euros",
    "salaryMin": 12.7,
    "salaryMax": 15,
    "salaryFrequency": "Horaire",
    "createdAt": "2026-11-19T19:15:02.952",
    "applyUrl": "https://www.manpower.fr/offers/details/1101519690?partenaire=FRANCE_TRAVAIL"
  },
  {
    "id": "216QVFK",
    "url": "https://candidat.francetravail.fr/offres/recherche/detail/216QVFK",
    "title": "Collaborateur comptable confirmé à Argenteuil (CDI) / Agora SEA (H/F)",
    "companyName": "Agora S.E.A.",
    "city": "Argenteuil",
    "postalCode": "95100",
    "departmentCode": "95",
    "contractType": "CDI",
    "experience": "7 An(s)",
    "romeCode": "M1211",
    "romeLabel": "Expert-comptable / Experte-comptable",
    "salaryText": "Annuel de 38000.0 Euros à 42000.0 Euros",
    "salaryMin": 38000,
    "salaryMax": 42000,
    "salaryFrequency": "Annuel",
    "createdAt": "2026-11-19T18:58:56.469",
    "applyUrl": null
  }
]
Enter fullscreen mode Exit fullscreen mode

Step 1: Open the Actor

Open the France Travail Scraper page on Apify Store. It lists the input fields and the output fields. You can run the Actor from the Console, but this guide calls it from Python.


Step 2: Write the input

The input has six fields you will use most often:

  • searchQueries: a list of keywords, one per entry. Each keyword is searched on its own, and an offer found by two keywords is kept once.
  • locations: department codes such as "75D", region codes such as "84R", or five-digit commune codes such as "69123".
  • contractTypes: any of CDI, CDD, MIS (temp agency) and LIB (freelance).
  • franceTravailOffersOnly: true leaves out offers that partner job boards publish.
  • sortBy: relevance (the default) or newest.
  • maxItems: the most rows the run pushes.

The script below searches comptable in department 69 for permanent contracts, newest first.

import os
from apify_client import ApifyClient

# 1. Initialize ApifyClient with the token from the environment
client = ApifyClient(os.environ["APIFY_API_TOKEN"])

# 2. Define the input: one keyword, one department, permanent contracts, at most 200 rows
run_input = {
    "searchQueries": ["comptable"],
    "locations": ["69D"],
    "contractTypes": ["CDI"],
    "sortBy": "newest",
    "maxItems": 200,
}
Enter fullscreen mode Exit fullscreen mode
# 3. Start the Actor run and wait for it to complete
print("Starting France Travail job search...")
run = client.actor("reventadata/francetravail-scraper").call(run_input=run_input)
if run is None or run.status != "SUCCEEDED":
    status = run.status if run else "unknown"
    raise SystemExit(f"Run did not succeed (status: {status}).")

# 4. Fetch the resulting dataset items
dataset = client.dataset(run.default_dataset_id).list_items().items
print(f"Extraction complete! Retrieved {len(dataset)} job offers.\n")
Enter fullscreen mode Exit fullscreen mode
for item in dataset:
    print(item.get("createdAt"), item.get("title"))
    print(f"  Company: {item.get('companyName')}, city: {item.get('city')}")
    print(f"  Contract: {item.get('contractType')}, salary: {item.get('salaryText')}")
    print(f"  Apply: {item.get('applyUrl')}")
    print("-" * 50)
Enter fullscreen mode Exit fullscreen mode

Step 3: Run the script

Save the three blocks in one Python file named francetravail_jobs.py, and run it:

python3 francetravail_jobs.py
Enter fullscreen mode Exit fullscreen mode

The script prints the start line, then the number of offers it received, then one block per offer. The run and its dataset are also in your Apify account, so you can open them there.


Step 4: View the results

Open the run's dataset in your Apify account. It holds every field of every row, including the full offer description, which the script above does not print. Use it to check the columns before you write any filter.


Step 5: Download the data

From the dataset, download the rows as JSON, CSV, Excel or JSONL.


Understanding your results

Each row has one id per offer, id, which France Travail assigns. The source field says where the offer comes from: PE means France Travail. The url field opens the public offer page.

Check salaryText first. When it is null, the offer states no salary, and salaryMin can still read 0 with salaryFrequency set to Autre, so test salaryText, not salaryMin. When it is present, salaryMin and salaryMax hold its numeric bounds for the pay period in salaryFrequency. The 10-row sample shows Mensuel (monthly), Horaire (hourly) and Annuel (yearly). Compare offers only within one period.

Dates are as the service gives them, so createdAt and updatedAt have no timezone suffix. The romeCode and romeLabel fields use the France Travail occupation classification, which lets you group offers by occupation even when their titles differ. In the sample, the offer titled "Collaborateur comptable confirmé" is classified under a different ROME code from the four offers in the 10-row sample titled "Comptable (H/F)".


Pro tips and advanced usage

  1. Use newest for recent offers. The site's recency order is close to, but not strictly, the publication date. Compare the createdAt values of your rows to see the order for yourself.
  2. Split large searches. The site returns at most 1,150 offers for one keyword search. Run one search per department in locations to cover a bigger market, and keep the department codes in one list so every split uses the same codes.
  3. Use several keywords in one run. Each offer is kept once, tagged with the first keyword that found it in matchedQuery. Read that field to see which keyword found each offer.
  4. Schedule the run. An Apify schedule can start the same input every day. Keep the input in a file, so the schedule and your manual runs use the same filters.
  5. Keep a log of runs. Write down the keyword, the filters and the date of each run. A later run of the same input can return different offers, and the dates show why.

Troubleshooting common issues

  • The run did not succeed. The script stops and prints the run status.
  • An empty result. A keyword with no matching offers gives an empty dataset. Widen the keyword or drop a filter, then run again.
  • Too few offers for a large market. Each keyword search returns at most 1,150 offers. Split the search by department, as the pro tips describe.
  • Read the run's status message. Before you change the input, open the run in your Apify account and read its status message and log.
  • Missing company or contact fields. Many offers leave these out. companyName is null when the offer shows no company, and the contact fields are present only when the offer publishes them.

Next steps

Try a second keyword, then a second department, and compare the rows. Once the script works, store the rows in a file or a database, and schedule the run so the data stays current. Each step adds one change at a time, so you always know which input produced which rows.

For current pricing and details, see the Store page.

Top comments (0)