# Levels.fyi Pay Leveling & Leaderboard Scraper (`crawlyth-forge/levels-fyi-pay-leveling-and-leaderboard-scraper`) Actor

Pull Levels.fyi pay data by company, role and level: base salary, stock, bonus and total compensation medians, individual submissions, percentile breakdowns, and top-paying company and location leaderboards.

- **URL**: https://apify.com/crawlyth-forge/levels-fyi-pay-leveling-and-leaderboard-scraper.md
- **Developed by:** [crawlyth forge](https://apify.com/crawlyth-forge) (community)
- **Categories:** Jobs, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Levels.fyi Pay Leveling & Leaderboard Scraper

Levels.fyi is a crowdsourced database of tech-industry pay, organized by company, job family (role) and internal level. This actor has eight entry points into that data — from a single company's full comp overview down to one specific company × role × level bucket, plus role and location leaderboards.

### What this actor does

- **Company overview** (`byCompany`) — every job family at a company with its median total compensation.
- **Company × role** (`byCompanyByRole`) — per-level medians and, optionally, every individual salary submission behind them.
- **Company × role × level** (`byCompanyByRoleLevel`) — a single level bucket plus its percentile breakdown.
- **Role landing** (`byRole`) — top-paying companies and top-paying locations for one job family.
- **Role × location** (`byRoleLocation`) — percentile breakdown and top-paying companies for a role in a specific place.
- **Company search, top-companies index, or any Levels.fyi URL** — browse the company catalog, the locations/role index, or paste a URL and the actor figures out which page type it is.
- Fields a record doesn't carry (e.g. no stock grant on a sales role, no percentile breakdown for a thin sample) are omitted rather than filled in.

### Output per record

Every record carries `recordType`, `scrapedAt`, and (when relevant) `url` back to the source page. Fields vary by `recordType`:

- **`companyOverview`** (mode=`byCompany`): `company`, `companySlug`, `companyDescription`, `companyWebsite`, `companyYearFounded`, `companyEmployeeCount`, `companyTicker`, `companyLinkedIn`, `companyTwitter`, `companyHq`, `medianTotalCompensation`, `highestPayingJobFamily`/`highestPayingLevel`/`highestTotalCompensation`, `lowestPayingJobFamily`/`lowestTotalCompensation`, `jobFamilies[]` (each with `jobFamily`, `jobFamilySlug`, and `titles[]` of `{title, titleSlug, count, medianTotalCompensation}`)
- **`levelAggregate`** (modes `byCompanyByRole`/`byCompanyByRoleLevel`): `company`, `jobFamily`, `level`, `levelName`, `secondaryLevelName`, `count`, `countLast12Months`, `medianBaseSalary`, `medianTotalCompensation`, `medianBonus`, `medianStockGrant`, `medianCommission`, `currency`, `exchangeRate`
- **`salarySample`** (same modes, when `includeSamples` is on): `uuid`, `company`, `title`, `jobFamily`, `level`, `focusTag`, `yearsOfExperience`, `yearsAtCompany`, `yearsAtLevel`, `offerDate`, `location`, `workArrangement`, `compPerspective`, `baseSalary`, `totalCompensation`, `stockGrant`, `bonus`, `firstYearTotalCompensation`, `firstYearStockGrant`, `firstYearBonus`, `salesComp`, `baseSalaryCurrency`, `stockGrantCurrency`, `bonusCurrency`, `stockType`, `salaryFormat`, `employmentType`, `education`, `gender`, `ethnicity`, `currency`, `exchangeRate`, `companyLogo`
- **`percentiles`** (modes `byCompanyByRoleLevel`/`byRoleLocation`): `company`, `jobFamily`, `location`, `locationName`, `count`, `currency`, plus percentile columns named `baseSalary_<p>`, `totalComp_<p>`, `bonus_<p>`, `stockGrant_<p>` (e.g. `totalComp_p50`, `totalComp_p90`)
- **`topCompany`** (modes `byRole`/`byRoleLocation`): `company`, `companySlug`, `jobFamily`, `location`, `medianTotalCompensation`, `companyLogo`
- **`topLocation`** (modes `byRole`/`topCompanies`): `location`, `locationSlug`, `locationType`, `jobFamily`, `region`, `medianTotalCompensation`
- **`jobFamily`** (mode `topCompanies`): `jobFamily`, `jobFamilySlug`, `category`, `jobFamilyIcon`
- **`company`** (mode `searchCompanies`): `company`, `companySlug`, `fundingStage` (for startups grouped by funding stage)

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `byCompanyByRole` | `byCompany`, `byCompanyByRole`, `byCompanyByRoleLevel`, `byRole`, `byRoleLocation`, `searchCompanies`, `topCompanies`, or `byUrl` |
| `company` | string | `google` | Company slug (modes `byCompany`/`byCompanyByRole`/`byCompanyByRoleLevel`) |
| `role` | string | `software-engineer` | Job-family slug (modes `byCompanyByRole`/`byCompanyByRoleLevel`/`byRole`/`byRoleLocation`) |
| `level` | string | – | Level slug, company-specific, e.g. `L4`, `E4` (mode=`byCompanyByRoleLevel`) |
| `locationSlug` | string | `san-francisco-bay-area` | Location slug (mode=`byRoleLocation`) |
| `url` | string | – | Any Levels.fyi URL to auto-route (mode=`byUrl`) |
| `search` | string | – | Substring filter against the popular-companies list (mode=`searchCompanies`) |
| `minTotalCompensation` | integer | – | Drop records below this total compensation |
| `maxTotalCompensation` | integer | – | Drop records above this total compensation |
| `minYearsOfExperience` | integer | – | Drop salary samples below this years of experience |
| `maxYearsOfExperience` | integer | – | Drop salary samples above this years of experience |
| `includeSamples` | boolean | `true` | Emit individual `salarySample` records (modes `byCompany`/`byCompanyByRole`) |
| `includeAggregates` | boolean | `true` | Emit `levelAggregate`/percentile records |
| `useResidentialProxyOnBlock` | boolean | `true` | Retry through an Apify proxy if the direct fetch is blocked |
| `maxItems` | integer | `200` | Hard cap on emitted records (1–5000) |

#### Example: full level breakdown for a company and role

```json
{
  "mode": "byCompanyByRole",
  "company": "meta",
  "role": "software-engineer",
  "includeSamples": false,
  "maxItems": 50
}
```

#### Example: individual submissions above a comp floor

```json
{
  "mode": "byCompanyByRole",
  "company": "amazon",
  "role": "data-scientist",
  "includeSamples": true,
  "includeAggregates": false,
  "minTotalCompensation": 200000,
  "maxItems": 100
}
```

#### Example: top-paying companies for a role in a region

```json
{
  "mode": "byRoleLocation",
  "role": "product-manager",
  "locationSlug": "europe",
  "maxItems": 50
}
```

#### Example: scrape by a Levels.fyi URL directly

```json
{
  "mode": "byUrl",
  "url": "https://www.levels.fyi/companies/openai/salaries/software-engineer"
}
```

### Use cases

- **Salary benchmarking** — pull company × role × level medians to set a competitive offer.
- **Offer negotiation** — compare an individual offer against recent `salarySample` records at the same level.
- **Compensation research** — track median total comp trends across companies for one job family.
- **Talent market mapping** — use `byRole`/`byRoleLocation` leaderboards to see which employers pay the most for a role in a region.
- **Company due diligence** — pull a `companyOverview` record for headcount, founding year and pay spread across job families.

### FAQ

**Do I need a Levels.fyi account or API key?**
No — every mode reads data the site serves to anonymous visitors.

**Why are `medianBaseSalary`, `medianBonus` etc. sometimes missing from a `levelAggregate` record?**
Levels.fyi only reports a median for a pay component when it has at least one non-zero submission for it; a level with no bonus submissions simply won't have `medianBonus`.

**What's the difference between `levelAggregate` and `salarySample` records?**
`levelAggregate` is one row per level with medians and counts. `salarySample` is one row per individual crowdsourced submission behind that level — turn `includeSamples` on to get both.

**Why do percentile fields look like `totalComp_p50`?**
Levels.fyi returns percentile breakdowns as a set of named points (e.g. the 25th, 50th, 90th percentile); the actor keeps that structure as flat `<metric>_<percentile>` columns rather than guessing which percentiles always exist.

**Can I filter by years of experience?**
Yes, on `salarySample` records, with `minYearsOfExperience`/`maxYearsOfExperience`. It has no effect on aggregate or leaderboard record types, which don't carry a per-person experience value.

**What does mode=`byUrl` actually do?**
It inspects the URL's path (company page, company×role page, role page, role×location page, or companies index) and runs the matching scrape logic automatically, so you don't have to pick a mode yourself.

**Is this affiliated with Levels.fyi?**
No. This is an independent, third-party actor built on Levels.fyi's publicly browsable pages.

# Actor input Schema

## `mode` (type: `string`):

What to scrape from Levels.fyi.

## `company` (type: `string`):

Levels.fyi company slug (mode=byCompany / byCompanyByRole / byCompanyByRoleLevel). Examples: `google`, `meta`, `apple`, `amazon`, `microsoft`, `netflix`, `openai`, `anthropic`. Visit `https://www.levels.fyi/companies/<slug>/salaries` to verify.

## `role` (type: `string`):

Job-family slug (mode=byCompanyByRole / byCompanyByRoleLevel / byRole / byRoleLocation). Pick from common slugs or pass any valid Levels.fyi job-family slug.

## `level` (type: `string`):

Levels.fyi level slug (mode=byCompanyByRoleLevel). Examples: `L3`, `L4`, `L5`, `IC3`, `E4`, `M1`. Slugs are company-specific — find them on the company×role page.

## `locationSlug` (type: `string`):

Levels.fyi location slug (mode=byRoleLocation). Common: `united-states`, `san-francisco-bay-area`, `greater-seattle-area`, `new-york-city-area`, `europe`, `india`, `canada`, `germany`, `united-kingdom`, `japan`.

## `url` (type: `string`):

Any levels.fyi URL — `/companies/<slug>/salaries`, `/companies/<slug>/salaries/<role>`, `/t/<role>/locations/<loc>`, `/companies`, etc. Auto-routes to the right scraper.

## `search` (type: `string`):

Substring match against the popular-companies catalog (case-insensitive). Empty = return all listed popular companies.

## `minTotalCompensation` (type: `integer`):

Drop salary samples / level rows with totalCompensation below this value (USD-equivalent at the page's exchange rate).

## `maxTotalCompensation` (type: `integer`):

Drop salary samples / level rows with totalCompensation above this value.

## `minYearsOfExperience` (type: `integer`):

Drop salary samples below this YOE.

## `maxYearsOfExperience` (type: `integer`):

Drop salary samples above this YOE.

## `includeSamples` (type: `boolean`):

Emit one record per individual salary submission inside each level (mode=byCompany / byCompanyByRole). When false, only level-aggregate rows are emitted.

## `includeAggregates` (type: `boolean`):

Emit one record per level (and an overall percentiles record) summarising compensation.

## `useResidentialProxyOnBlock` (type: `boolean`):

If Cloudflare blocks the direct fetch, retry through Apify residential proxy.

## `maxItems` (type: `integer`):

Hard cap on emitted records.

## Actor input object example

```json
{
  "mode": "byCompanyByRole",
  "company": "google",
  "role": "software-engineer",
  "locationSlug": "san-francisco-bay-area",
  "includeSamples": true,
  "includeAggregates": true,
  "useResidentialProxyOnBlock": true,
  "maxItems": 200
}
```

# Actor output Schema

## `records` (type: `string`):

Dataset containing all scraped Levels.fyi records.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mode": "byCompanyByRole",
    "company": "google",
    "role": "software-engineer",
    "locationSlug": "san-francisco-bay-area",
    "includeSamples": true,
    "includeAggregates": true,
    "useResidentialProxyOnBlock": true,
    "maxItems": 200
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlyth-forge/levels-fyi-pay-leveling-and-leaderboard-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "mode": "byCompanyByRole",
    "company": "google",
    "role": "software-engineer",
    "locationSlug": "san-francisco-bay-area",
    "includeSamples": True,
    "includeAggregates": True,
    "useResidentialProxyOnBlock": True,
    "maxItems": 200,
}

# Run the Actor and wait for it to finish
run = client.actor("crawlyth-forge/levels-fyi-pay-leveling-and-leaderboard-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "byCompanyByRole",
  "company": "google",
  "role": "software-engineer",
  "locationSlug": "san-francisco-bay-area",
  "includeSamples": true,
  "includeAggregates": true,
  "useResidentialProxyOnBlock": true,
  "maxItems": 200
}' |
apify call crawlyth-forge/levels-fyi-pay-leveling-and-leaderboard-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,crawlyth-forge/levels-fyi-pay-leveling-and-leaderboard-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/4kmlCKvD5WZdgbm1q/builds/fAy0J1vUWP28nRQsV/openapi.json
