FrantzPublic API
Get started

Your first job advert, from sign-in to statistics

Four steps: get a token, send a job advert, put the script on the job ad's page, and read the statistics. The examples use the test environment.

Before you start

  • A client id and client secret for the test environment, from Frantz.
  • A job ad page you can put a script on. A test page of your own is fine.
  • The examples read the id and secret from the environment variables FRANTZ_CLIENT_ID and FRANTZ_CLIENT_SECRET.

The C#, JavaScript and Python examples are one program each, split into steps. The JavaScript runs in Node 18 or later as an ES module (.mjs), and the Python uses requests.

  1. Get an access token

    Send the client id and secret to POST /api/v2/auth/token as a form. The token in access_token works for an hour (expires_in is in seconds). Send it as Authorization: Bearer on every other call.

    curl https://apitest.frantz.no/api/v2/auth/token \
      -d grant_type=client_credentials \
      --data-urlencode "client_id=$FRANTZ_CLIENT_ID" \
      --data-urlencode "client_secret=$FRANTZ_CLIENT_SECRET"
    
    # Put access_token from the response in FRANTZ_TOKEN for the next steps.
    JSON
    {
      "access_token": "fzat_...",
      "token_type": "Bearer",
      "expires_in": 3600,
      "scope": "job-adverts:write statistics:read"
    }

    Keep the token on your server and use it for its hour. Sign-in and scopes has the details.

  2. Send a job advert

    POST /api/v2/job-adverts with your own reference for the job ad in externalReference and the ad's page in landingPageUrl. Frantz answers 201 with the job advert's ConnectID (connectId) and the script for the page.

    curl https://apitest.frantz.no/api/v2/job-adverts \
      -H "Authorization: Bearer $FRANTZ_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "externalReference": "ad-12345",
        "landingPageUrl": "https://jobs.example.com/ad-12345",
        "title": "Nurse, Haukeland",
        "styrk": 2223,
        "endDate": "2026-11-30"
      }'
    JSON
    {
      "connectId": 744376,
      "externalReference": "ad-12345",
      "script": "<script crossorigin='anonymous' async='' data-r='744376' data-frpixel='744376' src='https://...'></script>",
      "title": "Nurse, Haukeland",
      "landingPageUrl": "https://jobs.example.com/ad-12345",
      "startDate": "2026-10-19",
      "endDate": "2026-11-30",
      "audienceId": 1421,
      "styrk": 2223,
      "reportUrl": "https://...",
      "createdDate": "2026-10-19T08:15:02Z",
      "updatedDate": "2026-10-19T08:15:02Z"
    }

    Sending the same externalReference again updates the job advert you have and answers 200, so the call is safe to repeat after a timeout. styrk is the job's STYRK-08 occupation code, which Frantz uses to find the audience; Audiences shows the other way.

  3. Put the script on the job ad's page

    Insert the script value as it is, at the end of <head> on the page in landingPageUrl. From then on Frantz measures the visitors who allow it.

    HTML
    <head>
      <title>Nurse, Haukeland</title>
      <!-- other tags -->
      <script crossorigin='anonymous' async='' data-r='744376' data-frpixel='744376' src='https://...'></script>
    </head>

    Store the whole script value, not just the ConnectID, and replace it when a response gives you a new one. Frantz may change the script's address or attributes, and the job advert always has the current one.

  4. Read the statistics

    GET /api/v2/job-adverts/{connectId}/statistics gives one entry per channel the job ad got visitors through. The numbers are counted during the night, so read them once a day, from a background job.

    curl https://apitest.frantz.no/api/v2/job-adverts/744376/statistics \
      -H "Authorization: Bearer $FRANTZ_TOKEN"
    JSON
    {
      "connectId": 744376,
      "from": null,
      "to": null,
      "dataUntil": "2026-10-25",
      "channels": [
        {
          "channelId": 90211,
          "network": "meta",
          "name": "Meta",
          "impressions": 15230,
          "clicks": 412,
          "pageViews": 388,
          "readMoreClicks": 141,
          "readers": 97,
          "applyClicks": 31,
          "avgTimeSeconds": 74.5
        },
        {
          "channelId": null,
          "network": null,
          "name": "Direktetrafikk",
          "impressions": 0,
          "clicks": 0,
          "pageViews": 52,
          "readMoreClicks": 20,
          "readers": 14,
          "applyClicks": 6,
          "avgTimeSeconds": 81.2
        }
      ]
    }

    Statistics explains each number and when it is updated.

Going live

Ask Frantz for a client for production, and change the address to https://api.frantz.no. Job adverts and ConnectIDs from the test environment do not exist in production, so send your job adverts again there.