# US H-1B Visa Sponsorship Data (`ivosandoval/us-h1b-visa`) Actor

Search H-1B visa sponsorship data from US Department of Labor LCA disclosures. Filter by employer, job title, state, city, and salary range. Covers fiscal years 2020-2026 with 800K+ records per year. Ideal for job seekers, recruiters, and immigration research.

- **URL**: https://apify.com/ivosandoval/us-h1b-visa.md
- **Developed by:** [Ivo Sandoval](https://apify.com/ivosandoval) (community)
- **Categories:** Automation, Lead generation, Other
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## US H-1B Visa Sponsorship Data Scraper

> Search H-1B visa sponsorship data from DOL OFLC LCA disclosures.
> Find employer sponsorship history, wages, job titles, and locations across fiscal years.

### Data Source

- **URL**: https://www.dol.gov/agencies/eta/foreign-labor/performance
- **Format**: XLSX files (80-250 MB per fiscal year)
- **Rate limits**: None (direct file downloads)
- **Auth required**: No
- **Coverage**: FY2020-FY2026, ~800K+ records per fiscal year
- **Updates**: Quarterly (Q1-Q4), Q4 contains the full fiscal year

### Output Example (real data from FY2024)

```json
{
    "case_number": "I-200-24186-636144",
    "case_status": "Certified",
    "employer_name": "GOOGLE LLC",
    "employer_city": "MOUNTAIN VIEW",
    "employer_state": "CA",
    "job_title": "SENIOR STAFF SOFTWARE ENGINEER",
    "soc_code": "15-1252",
    "soc_title": "SOFTWARE DEVELOPERS",
    "wage_from": 296000.0,
    "wage_to": 296000.0,
    "wage_unit": "Year",
    "worksite_city": "MOUNTAIN VIEW",
    "worksite_state": "CA",
    "visa_class": "H-1B",
    "received_date": "2024-07-03",
    "decision_date": "2024-07-10",
    "begin_date": "2024-10-01",
    "end_date": "2027-09-30",
    "fiscal_year": 2024
}
```

### Output Schema

| Field | Type | Description |
|-------|------|-------------|
| case\_number | string | DOL case ID (e.g. `I-200-24186-636144`) |
| case\_status | string | Certified, Certified - Withdrawn, Denied, Withdrawn |
| employer\_name | string | Sponsoring employer name |
| employer\_city | string | Employer city |
| employer\_state | string | Employer 2-letter state code |
| job\_title | string | Position title |
| soc\_code | string | SOC occupation code (e.g. `15-1252`) |
| soc\_title | string | SOC occupation title |
| wage\_from | float | Base salary (lower bound) |
| wage\_to | float | Base salary (upper bound) |
| wage\_unit | string | Year, Month, Bi-Weekly, Week, Hour |
| worksite\_city | string | Work location city |
| worksite\_state | string | Work location 2-letter state code |
| visa\_class | string | H-1B, H-1B1, or E-3 |
| received\_date | string | Date DOL received the application |
| decision\_date | string | Date DOL made the decision |
| begin\_date | string | Employment start date |
| end\_date | string | Employment end date |
| fiscal\_year | int | DOL fiscal year of the disclosure file |

### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| employer\_name | string | No | Filter by employer (case-insensitive partial match) |
| job\_title | string | No | Filter by job title (case-insensitive partial match) |
| worksite\_state | string | No | Filter by 2-letter US state code (e.g. CA, NY, TX) |
| worksite\_city | string | No | Filter by worksite city (case-insensitive partial match) |
| min\_wage | number | No | Minimum annual salary (wages auto-annualized for comparison) |
| max\_wage | number | No | Maximum annual salary (wages auto-annualized for comparison) |
| visa\_class | string | No | H-1B (default), H-1B1, or E-3 |
| case\_status | string | No | Certified, Certified - Withdrawn, Denied, Withdrawn |
| fiscal\_years | int\[] | No | Fiscal years to fetch (default: \[2025]) |
| max\_results | integer | No | Max results (default: 1,000 / max: 100,000) |
| database\_url | string | No | PostgreSQL URL for persistence |
| proxy\_configuration | object | No | Apify proxy config |

### Database

- **Database name**: `datamon_us_h1b_visa`
- **Table**: `lca_records`
- **Upsert key**: `case_number`
- **Batch size**: 1,000 rows per INSERT (optimized for 800K+ record files)
- **Index**: composite on `(fiscal_year, employer_name)`

### Pricing (Apify Store)

- **Model**: Pay-per-event (PPE)
- **Price**: $3 / 1,000 results

### Development

```bash
## Local runner (no Apify dependency)
cd actors/us-h1b-visa
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt

## Search by employer (no DB)
python runner.py --no-db --employer "GOOGLE" --fiscal-years 2024 --max-results 10

## Filter by state + salary
python runner.py --no-db --employer "GOOGLE" --worksite-state CA --min-wage 200000 --fiscal-years 2024

## Filter by job title
python runner.py --no-db --job-title "DATA SCIENTIST" --worksite-state NY --fiscal-years 2025

## Persist to PostgreSQL
DATABASE_URL="postgresql+asyncpg://user:pass@host:5432/datamon_us_h1b_visa" \
    python runner.py --employer "META" --fiscal-years 2024,2025

## Apify run
apify run --purge
```

### Technical Notes

- **Memory efficient**: Uses openpyxl `read_only=True` to stream XLSX rows without loading the full file (~80-250 MB) into memory
- **Wage annualization**: Hourly (x2080), monthly (x12), bi-weekly (x26), weekly (x52) -- applied only for filtering, raw values stored as-is
- **Column variants**: DOL column names change across fiscal years -- the scraper maps 18 known header variants to canonical field names
- **URL resolution**: HEAD request to resolve the correct DOL download URL before fetching (FY2020-2025 and FY2026+ use different URL patterns)

### Status

- \[x] Scraper implementation (XLSX streaming + in-memory filtering)
- \[x] Database models + migrations
- \[x] Input/output schemas
- \[x] DB persistence (batch upsert, 1000/batch)
- \[x] Local runner (runner.py)
- \[x] Verified against live DOL data (FY2024 Q4, 79.2 MB)
- \[x] Apify Store listing
- \[ ] Tests

# Actor input Schema

## `employer_name` (type: `string`):

Filter by employer/company name (case-insensitive partial match). Example: GOOGLE, META, AMAZON

## `job_title` (type: `string`):

Filter by job title (case-insensitive partial match). Example: SOFTWARE ENGINEER, DATA SCIENTIST

## `worksite_state` (type: `string`):

Filter by 2-letter US state code where the job is located. Example: CA, NY, TX, WA

## `worksite_city` (type: `string`):

Filter by worksite city (case-insensitive partial match). Example: SAN FRANCISCO, NEW YORK

## `min_wage` (type: `number`):

Minimum annual salary filter. Hourly/monthly wages are automatically annualized for comparison.

## `max_wage` (type: `number`):

Maximum annual salary filter. Hourly/monthly wages are automatically annualized for comparison.

## `visa_class` (type: `string`):

Visa classification to filter

## `case_status` (type: `string`):

Filter by LCA case decision status

## `fiscal_years` (type: `array`):

Which DOL fiscal years to fetch data from. Q4 files contain the full year. Default: \[2025]

## `max_results` (type: `integer`):

Maximum number of records to return

## `database_url` (type: `string`):

PostgreSQL connection string to persist results. Format: postgresql+asyncpg://user:pass@host:port/dbname

## `proxy_configuration` (type: `object`):

Apify proxy configuration

## Actor input object example

```json
{
  "visa_class": "H-1B",
  "fiscal_years": [
    2025
  ],
  "max_results": 1000
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("ivosandoval/us-h1b-visa").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("ivosandoval/us-h1b-visa").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 '{}' |
apify call ivosandoval/us-h1b-visa --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ivosandoval/us-h1b-visa"
        }
    }
}

```

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/2BFNJ3ArvbhI1mJiW/builds/Gku9EhS1JBxY5On0w/openapi.json
