Your contract-versus-permanent salary chart can look ready for the compensation meeting while quietly comparing advertised pay with an assumed working year.
The trap starts with salaryMin. The Actor applies that annual salary floor after converting shorter pay periods, and excludes vacancies without parseable pay whenever either salary bound is set.
An annualised salary filter selects rates under a working-calendar assumption; it does not select guaranteed annual earnings.
That changes the population behind your chart before you calculate a median. The unit looks comparable. The promise behind it may be quite different.
Dataset Autopsy
What does the salary floor actually select?
Your intended question might be: “Do contract vacancies advertise higher pay than permanent vacancies for this role and location?”
With a salary bound, the question becomes narrower: “Among collected vacancies with parseable advertised pay that passes an annualised salary filter, how do the retained employment groups compare?”
That qualification belongs beside the result, not somewhere beneath the meeting notes.
To inspect the pay mix before salary filtering removes anything, collect without salary bounds. Example collection input:
import os
import re
import pandas as pd
import duckdb
from apify_client import ApifyClient
run_input = {
"mode": "searchJobs",
"query": "software developer",
"location": "London",
"jobType": "",
"includeDetails": True,
"maxItems": 1000,
"maxPages": 100,
}
client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor(
"dataspryva/cv-library-uk-vacancy-finder-by-industry"
).call(run_input=run_input)
if run["status"] != "SUCCEEDED":
raise RuntimeError(f"Collection ended with {run['status']}")
items = list(
client.dataset(run["defaultDatasetId"]).iterate_items()
)
Leaving jobType empty keeps the employment groups in the same collection design. It doesn't make their occupations, seniority or responsibilities equivalent.
The collection still has boundaries. maxItems caps saved records, while maxPages caps fetched result pages per search. Reaching either ceiling leaves completeness unresolved; it can't establish that you've captured the vacancy population.
The working calendar is part of the filter
The conversion factors explain why a shared annual threshold can treat pay periods differently.
| Advertised pay basis | Annualisation factor |
|---|---|
| Hourly | × 2080 |
| Daily | × 220 |
| Weekly | × 52 |
| Monthly | × 12 |
These factors provide a comparison basis. They don't establish how long a contract lasts, how much work someone receives or which absences are paid.
The selection happens along this path:
advertised pay
→ parsed rate and pay period
→ annualised bounds
→ salary filter
→ retained vacancies
Change the conversion assumption and you can change which rates would qualify for the same threshold.
There's another exclusion alongside that arithmetic: a vacancy with undisclosed or unparseable pay can't survive a salary-bound collection. Your resulting median describes pay-disclosing, parseable vacancies within the collected search, rather than all matching vacancies.
Whether that exclusion differs between employment groups is something to measure. A neat chart isn't evidence that disclosure is evenly distributed.
Keep unsupported pay periods visible
Retain salary, salaryPeriod, salaryCurrency and both annualised bounds together. The advertised text is your route back to what the employer actually offered.
Missing values are omitted from the Actor's records. Reindexing below makes those omissions explicit in the analysis, while unrecognised period labels remain available for inspection.
This cell also keeps employment labels as complete sets, so a vacancy with several labels doesn't silently become several observations.
columns = [
"jobId", "salary", "salaryCurrency", "salaryPeriod",
"salaryAnnualMin", "salaryAnnualMax", "employmentTypes",
]
df = pd.DataFrame(items).reindex(columns=columns)
def money_number(value):
if pd.isna(value):
return float("nan")
text = str(value).strip().replace(",", "")
text = re.sub(r"^(?:GBP\s*|£\s*)", "", text, flags=re.I)
return pd.to_numeric(text, errors="coerce")
for column in ["salaryAnnualMin", "salaryAnnualMax"]:
df[column] = df[column].map(money_number)
period_aliases = {
"hour": "hour", "hourly": "hour",
"day": "day", "daily": "day",
"week": "week", "weekly": "week",
"month": "month", "monthly": "month",
"year": "year", "annual": "year",
"annually": "year", "yearly": "year", "annum": "year",
}
df["salaryPeriod"] = df["salaryPeriod"].astype("string")
df["pay_basis"] = (
df["salaryPeriod"].str.strip().str.lower().map(period_aliases)
)
def employment_group(value):
if not isinstance(value, list):
return "missing-or-unrecognised"
labels = sorted({
label.strip().lower()
for label in value
if isinstance(label, str) and label.strip()
})
return " | ".join(labels) if labels else "missing-or-unrecognised"
df["employment_group"] = df["employmentTypes"].map(employment_group)
df["is_gbp"] = (
df["salaryCurrency"].astype("string").str.upper().eq("GBP")
).fillna(False)
The aliases are an analyst's explicit interpretation of textual period labels. A numeric value or an unfamiliar label stays unmapped; it isn't quietly treated as annual pay.
Keep those rows in your coverage count. Excluding them from a calculation and forgetting they existed would make the comparison look more complete than it's.
Check the conversion before comparing the pay
A useful audit asks whether a recognisable advertised rate agrees with the returned annualised bounds.
The parser below deliberately accepts only simple amounts or ranges with a recognised period suffix. More complicated salary wording remains unchecked. That's preferable to extracting a bonus figure and calling it base pay.
amount_pattern = r"\d+(?:,\d{3})*(?:\.\d+)?"
salary_pattern = re.compile(
rf"^\s*(?:£|GBP\s*)?({amount_pattern})"
rf"(?:\s*(?:-|–|to)\s*(?:£|GBP\s*)?({amount_pattern}))?"
r"\s*(?:(?:/|per\s+|a\s+)"
r"(?:hour|day|week|month|year|annum)|"
r"hourly|daily|weekly|monthly|annually|yearly)?\s*$",
re.I,
)
def advertised_bounds(value):
match = salary_pattern.fullmatch(str(value))
if match is None:
return (float("nan"), float("nan"))
lower = float(match[1].replace(",", ""))
upper = float((match[2] or match[1]).replace(",", ""))
return lower, upper
df[["rate_low", "rate_high"]] = pd.DataFrame(
df["salary"].map(advertised_bounds).tolist(),
index=df.index,
)
factors = {"hour": 2080, "day": 220, "week": 52, "month": 12, "year": 1}
df["factor"] = df["pay_basis"].map(factors)
df["checkable"] = (
df["is_gbp"]
& df[["rate_low", "rate_high", "factor",
"salaryAnnualMin", "salaryAnnualMax"]].notna().all(axis=1)
& df["rate_low"].le(df["rate_high"])
)
df["lower_difference"] = (
df["salaryAnnualMin"] - df["rate_low"] * df["factor"]
)
df["upper_difference"] = (
df["salaryAnnualMax"] - df["rate_high"] * df["factor"]
)
inspection = df.loc[
df["checkable"]
& (df["lower_difference"].ne(0) | df["upper_difference"].ne(0)),
["jobId", "salary", "salaryPeriod",
"lower_difference", "upper_difference"],
]
inspection identifies differences to investigate. It doesn't pronounce them errors or assume a rounding rule.
Uncheckable rows are a separate issue: this conservative parser may reject valid wording, and missing fields can prevent comparison. Neither case is evidence that the Actor's conversion is wrong.
Split the pay bases before pooling them
Before producing the headline comparison, inspect employment groups within each pay basis.
This cell calculates an analyst-derived midpoint only where both annualised bounds are available, ordered and denominated in GBP.
valid_annual = (
df["is_gbp"]
& df[["salaryAnnualMin", "salaryAnnualMax"]].notna().all(axis=1)
& df["salaryAnnualMin"].le(df["salaryAnnualMax"])
)
df["annual_mid"] = (
(df["salaryAnnualMin"] + df["salaryAnnualMax"]) / 2
).where(valid_annual)
by_basis = duckdb.sql("""
SELECT employment_group, salaryPeriod, pay_basis,
count(*) AS vacancies,
count(annual_mid) AS usable_midpoints,
median(annual_mid) AS median_annualised_midpoint
FROM df
GROUP BY ALL
""").df()
pooled = duckdb.sql("""
SELECT employment_group,
count(*) AS vacancies,
count(annual_mid) AS usable_midpoints,
median(annual_mid) AS median_annualised_midpoint
FROM df
GROUP BY employment_group
""").df()
The midpoint is a summary of advertised bounds, not an observed wage or an offer accepted by a candidate.
Compare by_basis with pooled. If employment groups draw on different pay-period mixes, their pooled difference combines advertised rates with conversion assumptions and composition. Your data can reveal that mix; it can't make the mix irrelevant.
The worked example uses CV-Library UK Vacancy Finder by Industry & Location. The same sampling problem applies whenever a collection filter normalises rates before deciding which records qualify.
Change the calendar on the same vacancies
A better input design separates collection from the analytical salary restriction: omit salary bounds, retain missing-pay rows, then define the comparison cohort locally.
That lets you report pay coverage and examine calendar sensitivity without retrieving a different salary-selected population for each assumption.
This cell uses explicitly chosen alternative hourly and daily factors. They're sensitivity parameters, not claims about a typical working year.
scenario_factors = {
"hour": 1840,
"day": 200,
"week": 52,
"month": 12,
"year": 1,
}
sensitivity = df.loc[df["checkable"]].copy()
sensitivity["rate_mid"] = (
sensitivity["rate_low"] + sensitivity["rate_high"]
) / 2
sensitivity["default_calendar_mid"] = (
sensitivity["rate_mid"] * sensitivity["factor"]
)
sensitivity["alternative_calendar_mid"] = (
sensitivity["rate_mid"]
* sensitivity["pay_basis"].map(scenario_factors)
)
calendar_comparison = sensitivity.groupby("employment_group")[
["default_calendar_mid", "alternative_calendar_mid"]
].agg(["count", "median"])
Both scenarios use the same vacancies. If the comparison changes, calendar assumptions contribute to the result.
Report the sensitivity cohort separately from the broader annualised summary, because requiring recognisable rate text narrows coverage again.
For broader searches, splitting collection by location or sector can reach deeper results, but overlapping searches need an identity check using jobId. Sorting the collected jobs with sortBy can't establish that uncollected vacancies were considered.
The claim your meeting can support
Your chart label can say: “Median advertised annualised salary-range midpoint among collected GBP vacancies, by employment group.”
Alongside it, report the search scope, collection caps, usable-pay coverage, pay-period composition and scenario assumptions. If you apply a salary restriction locally, describe the exact range rule you chose rather than implying it reproduces an unspecified boundary rule.
Even a carefully sampled vacancy dataset doesn't establish realised earnings, paid days, contract duration, paid leave, pension contributions or total compensation. Differences in role mix can also remain after you separate pay periods.
A contract rate can support an annualised comparison. It can't promise someone an annual income.
Drafted with AI assistance and reviewed for accuracy.
Top comments (0)