# Levels.fyi Salary Scraper (`glassventures/levelsfyi-salary-scraper`) Actor

Scrape salary data from Levels.fyi. Extract total compensation, base salary, stock, bonus by company, title, and level.

- **URL**: https://apify.com/glassventures/levelsfyi-salary-scraper.md
- **Developed by:** [Glass Ventures](https://apify.com/glassventures) (community)
- **Categories:** Jobs, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Levels.fyi Salary Scraper

Scrape salary and compensation data from Levels.fyi. Extract total compensation, base salary, stock grants, bonuses, and more by company and job title.

### What does Levels.fyi Salary Scraper do?

Levels.fyi is the leading salary comparison platform for tech workers. This actor extracts structured compensation data including base salary, stock grants, bonuses, and total compensation broken down by company, job title, level, and location.

Whether you are benchmarking salaries for hiring, negotiating your next offer, or conducting compensation research across the tech industry, this actor gives you programmatic access to the salary data that thousands of tech workers rely on every day.

The actor uses efficient HTTP-based scraping (no browser needed) by extracting structured data directly from the page source, making it fast and cost-effective.

### Use Cases

- **Recruiters and HR teams** -- Benchmark compensation packages against market rates for specific roles and levels
- **Job seekers** -- Research salary ranges before negotiating offers at target companies
- **Data analysts** -- Build compensation datasets for market analysis and salary trend reports
- **Startup founders** -- Set competitive compensation bands based on real market data

### Features

- Scrape salary data by company, job title, and level
- Extract total compensation, base salary, stock grants, and bonuses
- Location and years of experience data included
- Build URLs automatically from company names and job titles
- Proxy support with automatic rotation
- Handles pagination and large datasets automatically
- Exports to JSON, CSV, Excel, or connect via API

### How much will it cost?

| Results | Estimated Cost |
|---------|---------------|
| 100     | ~$0.50        |
| 1,000   | ~$3.00        |
| 10,000  | ~$25.00       |

| Cost Component | Per 1,000 Results |
|----------------|-------------------|
| Platform compute | ~$0.50 |
| Proxy (residential) | ~$2.50 |
| **Total** | **~$3.00** |

### How to use

1. Go to the Levels.fyi Salary Scraper page on Apify Store
2. Click "Start" or "Try for free"
3. Enter company names or Levels.fyi URLs
4. Set the maximum number of items
5. Click "Start" and wait for the results

### Input parameters

| Parameter | Type | Description | Default |
|-----------|------|-------------|---------|
| startUrls | array | Levels.fyi URLs to scrape | - |
| companies | array | Company names (e.g. google, meta) | - |
| jobTitles | array | Job titles (e.g. software-engineer) | - |
| maxItems | number | Max results to return | 100 |
| maxConcurrency | number | Parallel page limit | 5 |
| proxyConfig | object | Proxy settings | Residential |

### Output

The actor produces a dataset with the following fields:

```json
{
    "company": "Google",
    "title": "Software Engineer",
    "level": "L5",
    "totalCompensation": 350000,
    "baseSalary": 185000,
    "stockGrant": 120000,
    "bonus": 45000,
    "location": "Mountain View, CA",
    "yearsOfExperience": 6,
    "yearsAtCompany": 3,
    "gender": "Male",
    "timestamp": "2024-06-15T00:00:00.000Z",
    "url": "https://www.levels.fyi/companies/google/salaries/software-engineer",
    "scrapedAt": "2024-07-01T12:00:00.000Z"
}
````

| Field | Type | Description |
|-------|------|-------------|
| company | string | Company name |
| title | string | Job title |
| level | string | Job level (e.g. L5, E5, Senior) |
| totalCompensation | number | Total yearly compensation in USD |
| baseSalary | number | Base salary in USD |
| stockGrant | number | Yearly stock/equity grant in USD |
| bonus | number | Yearly bonus in USD |
| location | string | Work location |
| yearsOfExperience | number | Total years of experience |
| yearsAtCompany | number | Years at current company |
| gender | string | Self-reported gender |
| timestamp | string | When the salary was reported |
| url | string | Source page URL |
| scrapedAt | string | ISO 8601 scrape timestamp |

### Integrations

Connect Levels.fyi Salary Scraper with other tools:

- **Apify API** -- REST API for programmatic access
- **Webhooks** -- get notified when a run finishes
- **Zapier / Make** -- connect to 5,000+ apps
- **Google Sheets** -- export directly to spreadsheets

#### API Example (Node.js)

```javascript
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_TOKEN' });
const run = await client.actor('YOUR_USERNAME/levelsfyi-salary-scraper').call({
    companies: ['google', 'meta'],
    jobTitles: ['software-engineer'],
    maxItems: 100,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

#### API Example (Python)

```python
from apify_client import ApifyClient
client = ApifyClient('YOUR_TOKEN')
run = client.actor('YOUR_USERNAME/levelsfyi-salary-scraper').call(run_input={
    'companies': ['google', 'meta'],
    'jobTitles': ['software-engineer'],
    'maxItems': 100,
})
items = client.dataset(run['defaultDatasetId']).list_items().items
```

#### API Example (cURL)

```bash
curl "https://api.apify.com/v2/acts/YOUR_USERNAME~levelsfyi-salary-scraper/runs" \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"companies": ["google"], "jobTitles": ["software-engineer"], "maxItems": 100}'
```

### Tips and tricks

- Start with a small `maxItems` (10-20) to test before running large scrapes
- Use residential proxies if you encounter blocking
- Combine multiple companies and job titles in a single run for efficiency
- Use the `companies` + `jobTitles` inputs instead of manually building URLs

### FAQ

**Q: Does this actor require login credentials?**
A: No. Levels.fyi salary data is publicly available.

**Q: How fast is the scraping?**
A: Approximately 50-200 salary entries per minute depending on proxy speed and data density per page.

**Q: What should I do if I get blocked?**
A: Switch to residential proxies in the Proxy Configuration settings and reduce max concurrency.

**Q: What companies are supported?**
A: Any company listed on Levels.fyi. Use company slugs (e.g. "google", "meta", "amazon", "apple", "microsoft").

### Is it legal to scrape Levels.fyi?

Web scraping of publicly available data is generally legal based on precedents like the LinkedIn v. HiQ Labs case. This actor only accesses publicly available data. Always review and respect the target site's Terms of Service and robots.txt. For more information, see [Apify's blog on web scraping legality](https://blog.apify.com/is-web-scraping-legal/).

### Limitations

- Only extracts publicly visible salary data (no paywalled content)
- Data accuracy depends on self-reported submissions to Levels.fyi
- Rate limiting may slow down very large scrapes
- Some salary entries may have incomplete fields (missing stock, bonus, etc.)

### Changelog

- **v0.1** (2026-04-23) -- Initial release

# Actor input Schema

## `startUrls` (type: `array`):

Levels.fyi URLs to scrape. Can be company salary pages like https://www.levels.fyi/companies/google/salaries/software-engineer

## `companies` (type: `array`):

List of company names to scrape salaries for (e.g. google, meta, apple). Used with Job Titles to build URLs.

## `jobTitles` (type: `array`):

List of job titles to scrape (e.g. Software Engineer, Product Manager, Data Scientist). Used with Companies to build URLs.

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

Maximum number of salary entries to scrape. Use 0 or leave empty for unlimited.

## `maxConcurrency` (type: `integer`):

Maximum number of pages processed in parallel.

## `debugMode` (type: `boolean`):

Enables verbose logging and saves HTML snapshots on errors.

## `extendOutputFunction` (type: `string`):

A JavaScript function to customize each output item. Receives { data, $, request }.

## `proxyConfig` (type: `object`):

Select proxies to be used. Residential proxies recommended for Levels.fyi.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.levels.fyi/companies/google/salaries/software-engineer"
    }
  ],
  "companies": [
    "google"
  ],
  "jobTitles": [
    "software-engineer"
  ],
  "maxItems": 100,
  "maxConcurrency": 5,
  "debugMode": false,
  "extendOutputFunction": "async ({ data, $ }) => {\n    return data;\n}",
  "proxyConfig": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://www.levels.fyi/companies/google/salaries/software-engineer"
        }
    ],
    "companies": [
        "google"
    ],
    "jobTitles": [
        "software-engineer"
    ],
    "extendOutputFunction": async ({ data, $ }) => {
        return data;
    },
    "proxyConfig": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("glassventures/levelsfyi-salary-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 = {
    "startUrls": [{ "url": "https://www.levels.fyi/companies/google/salaries/software-engineer" }],
    "companies": ["google"],
    "jobTitles": ["software-engineer"],
    "extendOutputFunction": """async ({ data, $ }) => {
    return data;
}""",
    "proxyConfig": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("glassventures/levelsfyi-salary-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "startUrls": [
    {
      "url": "https://www.levels.fyi/companies/google/salaries/software-engineer"
    }
  ],
  "companies": [
    "google"
  ],
  "jobTitles": [
    "software-engineer"
  ],
  "extendOutputFunction": "async ({ data, $ }) => {\\n    return data;\\n}",
  "proxyConfig": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call glassventures/levelsfyi-salary-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=glassventures/levelsfyi-salary-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Levels.fyi Salary Scraper",
        "description": "Scrape salary data from Levels.fyi. Extract total compensation, base salary, stock, bonus by company, title, and level.",
        "version": "0.1",
        "x-build-id": "VqoffbiKMz8VOaSsk"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/glassventures~levelsfyi-salary-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-glassventures-levelsfyi-salary-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/glassventures~levelsfyi-salary-scraper/runs": {
            "post": {
                "operationId": "runs-sync-glassventures-levelsfyi-salary-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/glassventures~levelsfyi-salary-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-glassventures-levelsfyi-salary-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "startUrls": {
                        "title": "Start URLs",
                        "type": "array",
                        "description": "Levels.fyi URLs to scrape. Can be company salary pages like https://www.levels.fyi/companies/google/salaries/software-engineer",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "companies": {
                        "title": "Companies",
                        "type": "array",
                        "description": "List of company names to scrape salaries for (e.g. google, meta, apple). Used with Job Titles to build URLs.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "jobTitles": {
                        "title": "Job Titles",
                        "type": "array",
                        "description": "List of job titles to scrape (e.g. Software Engineer, Product Manager, Data Scientist). Used with Companies to build URLs.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum number of salary entries to scrape. Use 0 or leave empty for unlimited.",
                        "default": 100
                    },
                    "maxConcurrency": {
                        "title": "Max Concurrency",
                        "minimum": 1,
                        "maximum": 20,
                        "type": "integer",
                        "description": "Maximum number of pages processed in parallel.",
                        "default": 5
                    },
                    "debugMode": {
                        "title": "Debug Mode",
                        "type": "boolean",
                        "description": "Enables verbose logging and saves HTML snapshots on errors.",
                        "default": false
                    },
                    "extendOutputFunction": {
                        "title": "Extend Output Function",
                        "type": "string",
                        "description": "A JavaScript function to customize each output item. Receives { data, $, request }."
                    },
                    "proxyConfig": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Select proxies to be used. Residential proxies recommended for Levels.fyi."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
