DEV Community

Violettttee
Violettttee

Posted on Edited on

Querying Workday, KYB/LEI & eBay Sold Comps in Python Without Headless Browsers (2026 Guide)

Most B2B enrichment, compliance, and market-comps pipelines break for the same reason: they launch heavy Playwright or Selenium browsers to scrape React SPAs when clean, unauthenticated JSON endpoints—or deterministic HTTP parsers—already exist underneath.

In this guide, we will walk through four production Python patterns (httpx + BeautifulSoup + Decimal, zero headless browsers) covering common B2B and quant data sources in 2026:

  1. Workday (*.myworkdayjobs.com), Greenhouse, Ashby & Lever — calling the hidden CXS & board JSON endpoints directly in ~200ms.
  2. Global Corporate KYB & GLEIF LEI Ownership Trees — pre-validating ISO 17442 Mod 97-10 check digits locally, traversing parent entities, and avoiding the #1 UK Companies House 401 Basic Auth trap.
  3. eBay Completed / Sold Listings (LH_Sold=1) — handling 2026 .s-card DOM shifts, strikethrough Best-Offer prices, and "Results matching fewer words" query-rewrite boundaries.
  4. Zero-Boilerplate Option: Connecting via Model Context Protocol (MCP) — wiring these endpoints straight into Claude Desktop, Cursor, or n8n.

1. Querying Workday, Greenhouse, Ashby & Lever Without a Browser

Career sites hosted on *.myworkdayjobs.com look like opaque React SPAs—if you fetch the HTML URL with requests, you get an empty shell. Under the hood, every Workday career site issues a POST request to /wday/cxs/<tenant>/<site_id>/jobs:

import re
import httpx

WORKDAY_URL_RE = re.compile(
    r"https?://(?P<tenant>[^.]+)\.(?P<wd>wd\d+)\.myworkdayjobs\.com/(?:[a-z]{2}-[A-Z]{2}/)?(?P<site>[^/?#]+)"
)

def fetch_workday_jobs(board_url: str, search_text: str = "", limit: int = 20, offset: int = 0) -> dict:
    m = WORKDAY_URL_RE.match(board_url.strip())
    if not m:
        raise ValueError(f"Unrecognized Workday URL: {board_url}")

    tenant, wd, site = m.group("tenant"), m.group("wd"), m.group("site")
    cxs_url = f"https://{tenant}.{wd}.myworkdayjobs.com/wday/cxs/{tenant}/{site}/jobs"

    payload = {
        "appliedFacets": {},
        "limit": min(limit, 20),  # Workday caps limit at 20 on most tenants
        "offset": offset,
        "searchText": search_text,
    }
    headers = {
        "Accept": "application/json",
        "Content-Type": "application/json",
        "User-Agent": "Mozilla/5.0",
    }

    with httpx.Client(http2=True, timeout=20.0, follow_redirects=True) as client:
        resp = client.post(cxs_url, json=payload, headers=headers)
        resp.raise_for_status()
        data = resp.json()

    base = f"https://{tenant}.{wd}.myworkdayjobs.com/en-US/{site}"
    jobs = [
        {
            "title": p.get("title"),
            "location": p.get("locationsText"),
            "posted_on": p.get("postedOn"),
            "url": f"{base}{p.get('externalPath', '')}",
        }
        for p in data.get("jobPostings", [])
    ]
    return {"total": data.get("total", len(jobs)), "jobs": jobs}
Enter fullscreen mode Exit fullscreen mode

And if you are normalizing across startup and mid-market career pages, the other major ATS platforms expose unauthenticated GET JSON feeds as well:

  • Greenhouse: GET https://boards-api.greenhouse.io/v1/boards/{board_token}/jobs?content=true
  • Ashby (with structured compensation): GET https://api.ashbyhq.com/posting-api/job-board/{org_slug}?includeCompensation=true
  • Lever: GET https://api.lever.co/v0/postings/{site}?mode=json
  • SmartRecruiters: GET https://api.smartrecruiters.com/v1/companies/{company_id}/postings

2. Official Corporate KYB: GLEIF LEI Parent Trees, EU VIES & UK Companies House

Before calling external KYB APIs on user-submitted company identifiers, validate check digits locally. Every 20-character Legal Entity Identifier (LEI) uses an ISO 17442 / ISO 7064 Mod 97-10 checksum—catching OCR errors and typos in O(1) time:

import httpx

def is_valid_lei(lei: str) -> bool:
    code = lei.strip().upper()
    if len(code) != 20 or not code.isalnum() or not code[18:].isdigit():
        return False
    numeric_str = "".join(str(ord(ch) - 55) if ch.isalpha() else ch for ch in code)
    return int(numeric_str) % 97 == 1

def fetch_gleif_ownership(lei: str) -> dict:
    if not is_valid_lei(lei):
        raise ValueError(f"Invalid ISO 17442 LEI checksum: {lei}")

    base = f"https://api.gleif.org/api/v1/lei-records/{lei}"
    headers = {"Accept": "application/vnd.api+json"}
    with httpx.Client(timeout=15.0) as client:
        rec = client.get(base, headers=headers)
        rec.raise_for_status()
        attrs = rec.json()["data"]["attributes"]
        direct = client.get(f"{base}/direct-parent", headers=headers)
        ultimate = client.get(f"{base}/ultimate-parent", headers=headers)

    return {
        "lei": lei,
        "legal_name": attrs["entity"]["legalName"]["name"],
        "jurisdiction": attrs["entity"].get("jurisdiction"),
        "status": attrs["registration"].get("status"),
        "direct_parent_lei": direct.json()["data"]["id"] if direct.status_code == 200 else None,
        "ultimate_parent_lei": ultimate.json()["data"]["id"] if ultimate.status_code == 200 else None,
    }
Enter fullscreen mode Exit fullscreen mode

Two subtle gotchas when combining European registries:

  • UK Companies House (api.company-information.service.gov.uk): Pass your API key as the HTTP Basic Auth username with an empty password (auth=(api_key, "") in httpx), not Authorization: Bearer .... Forgetting the trailing colon when Base64-encoding manually causes silent 401 Unauthorized errors.
  • EU VIES VAT Validation: Skip legacy SOAP/XML envelopes—the European Commission's REST JSON endpoint at GET https://ec.europa.eu/taxation_customs/vies/rest-api/ms/{country_code}/vat/{vat_number} returns clean JSON directly.

3. Parsing eBay Sold Comps Without Query-Rewrite & Best-Offer Skew

Since eBay sunset findCompletedItems in the legacy Finding API, developers parsing LH_Sold=1&LH_Complete=1 pages commonly hit three pricing traps:

  1. Query-Expansion Tail Noise: When exact matches run low, eBay injects a "Results matching fewer words" divider mid-river and appends unrelated phone cases or cables below it.
  2. Strikethrough Best-Offer Prices: When a Best Offer is accepted, eBay hides the final negotiated price and renders the rejected original asking price with a strikethrough class (.s-item__price--strikethrough or .strikethrough across .s-item and newer .s-card cards).
  3. Outlier Skew: Always compute IQR-trimmed P25 / Median / P75 quartiles rather than raw means.
import re
import statistics
from bs4 import BeautifulSoup

PRICE_RE = re.compile(r"([0-9]+(?:,[0-9]{3})*(?:\.[0-9]{2})?)")

def parse_ebay_sold_comps(html_text: str) -> dict:
    soup = BeautifulSoup(html_text, "html.parser")
    river = soup.select_one("#srp-river-results ul.srp-results")
    if not river:
        return {"items": [], "quartiles": None}

    rows = []
    for node in river.children:
        if not getattr(node, "name", None):
            continue
        banner = node.get_text(" ", strip=True).lower()
        if "results matching fewer words" in banner or "results for fewer words" in banner:
            break  # Hard stop before noisy query-rewrite tail

        classes = node.get("class") or []
        if "s-item" not in classes and "s-card" not in classes:
            continue

        title_el = node.select_one(".s-item__title, .s-card__title")
        price_el = node.select_one(".s-item__price, .s-card__price")
        if not title_el or not price_el:
            continue

        title = title_el.get_text(" ", strip=True)
        price_raw = price_el.get_text(" ", strip=True)
        if title.lower().startswith("shop on ebay") or " to " in price_raw.lower():
            continue

        card_text = node.get_text(" ", strip=True).lower()
        best_offer = (
            "best offer accepted" in card_text
            or node.select_one(".s-item__price--strikethrough, .strikethrough, s, strike") is not None
        )

        m = PRICE_RE.search(price_raw)
        if m:
            rows.append({
                "title": title,
                "price": float(m.group(1).replace(",", "")),
                "best_offer_accepted": best_offer,
            })

    confirmed = sorted(r["price"] for r in rows if not r["best_offer_accepted"])
    quartiles = None
    if len(confirmed) >= 4:
        q1, med, q3 = statistics.quantiles(confirmed, n=4)
        iqr = q3 - q1
        clean = [p for p in confirmed if (q1 - 1.5 * iqr) <= p <= (q3 + 1.5 * iqr)]
        if len(clean) >= 4:
            cq1, cmed, cq3 = statistics.quantiles(clean, n=4)
            quartiles = {"p25": round(cq1, 2), "median": round(cmed, 2), "p75": round(cq3, 2), "n": len(clean)}

    return {"items": rows, "quartiles": quartiles}
Enter fullscreen mode Exit fullscreen mode

4. Companion Examples, n8n Workflows & Remote MCP Configs

If you prefer calling managed endpoints (or wiring these directly into Claude Desktop, Cursor, n8n, or Clay.com without maintaining scrapers and taxonomy updates), I published an MIT-licensed collection of client scripts, importable n8n .json workflows, and MCP configs here:

For example, dropping this into .cursor/mcp.json or claude_desktop_config.json exposes all 6 tools over Streamable HTTP:

{
  "mcpServers": {
    "apify-b2b-intelligence": {
      "url": "https://mcp.apify.com/?tools=Zenonnnnnn/multi-ats-hiring-signals,Zenonnnnnn/enterprise-workday-migration-signals,Zenonnnnnn/global-kyb-new-incorporations-api,Zenonnnnnn/gov-job-boards-eu-na-aggregator,Zenonnnnnn/ebay-sold-listings-comps,Zenonnnnnn/sec-xbrl-congress-verified-financials",
      "headers": {
        "Authorization": "Bearer YOUR_APIFY_TOKEN"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Happy building—and if you run into edge cases on specific Workday tenants, European registries, or XBRL restatement tags, drop a comment below!

Top comments (0)