US wages (OEWS)
Occupational employment and wages for the US, states and metro areas, plus SOC occupations
- Connector software
- Free and open source
- Service credentials
- Not needed
- Query Farm hosting
- Available · $10/month organization minimum
Use with an agent
Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.
npx skills add Query-farm/vgi-skills --skill orchard
Copy this request into your coding agent to get started.
Use https://query.farm/products/orchard/connectors/us-wages/index.md to help me query US wages (OEWS) with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.
The five metro areas paying registered nurses the highest median wage
Example output · captured
- Connector release
- v0.2.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
SELECT area_title, a_median, tot_emp
FROM us_wages.main.wages(occupation := '29-1141', area_type := 'metro')
WHERE a_median IS NOT NULL
ORDER BY a_median DESC
LIMIT 5
| area_title | a_median | tot_emp |
|---|---|---|
| San Jose-Sunnyvale-Santa Clara, CA | 216,740 | 22,930 |
| Vallejo, CA | 203,290 | 4120 |
| San Francisco-Oakland-Fremont, CA | 186,610 | 41,750 |
| Santa Rosa-Petaluma, CA | 174,550 | 3720 |
| Sacramento-Roseville-Folsom, CA | 171,460 | 23,590 |
Quick start
Choose where to run US wages (OEWS), then follow the steps below.
The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.
1. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
2. Attach the connector
Attach with uvx
Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.
ATTACH 'us_wages' AS us_wages (
TYPE vgi,
LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-us-wages-worker'
);
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'us_wages' AS us_wages (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-us-wages:0.2.0'
);
3. Run a query
SELECT area_title, a_median, tot_emp
FROM us_wages.main.wages(occupation := '29-1141', area_type := 'metro')
WHERE a_median IS NOT NULL
ORDER BY a_median DESC
LIMIT 5
Run the connector on a server you manage. You operate the service and choose who can connect.
1. Deploy the connector on your server
Follow the connector’s deployment instructions. Use its supported HTTP transport, or launch it remotely over SSH. The connection guide explains both options.
2. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach the connector
For an HTTP deployment, replace the example URL with your endpoint. Add the authentication options your deployment requires. For SSH, use the SSH connection instructions.
ATTACH 'us_wages' AS us_wages
(TYPE vgi, LOCATION 'https://your-connector.example.com');
4. Run a query
SELECT area_title, a_median, tot_emp
FROM us_wages.main.wages(occupation := '29-1141', area_type := 'metro')
WHERE a_median IS NOT NULL
ORDER BY a_median DESC
LIMIT 5
Query Farm operates US wages (OEWS) for your team. Hosting has a $10 monthly minimum per organization; usage counts toward it. From $2.97 per instance-month ($10 monthly minimum).
1. Create your hosted connector
Open the console, choose your organization and deployment size, and add any service credentials there.
2. Install the vgi extension
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach your deployment
Copy the ATTACH statement from your deployment in the console and run it in DuckDB or Haybarn. Use us_wages as the catalog alias for the query below.
4. Run a query
SELECT area_title, a_median, tot_emp
FROM us_wages.main.wages(occupation := '29-1141', area_type := 'metro')
WHERE a_median IS NOT NULL
ORDER BY a_median DESC
LIMIT 5
Technical details
- Verified connector release
- v0.2.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
- Verified on
- December 1, 2026
Pin a version for production
When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.
Attach with uvx
Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.
ATTACH 'us_wages' AS us_wages (
TYPE vgi,
LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-us-wages-worker'
);
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'us_wages' AS us_wages (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-us-wages:0.2.0'
);
Overview
US employment and wages by occupation for the nation, states, metro and nonmetro areas from the BLS Occupational Employment and Wage Statistics (OEWS) survey, with the SOC 2018 occupation classification, occupation search and a ZIP-to-metro lookup. No API key needed.
Employment and pay for about 830 occupations across the US, every state, about 390 metropolitan areas and 140 nonmetropolitan areas, from the Bureau of Labor Statistics Occupational Employment and Wage Statistics (OEWS) survey. Each May reference period is a release; the worker reads BLS's all-data files, converts them once into a local Parquet cache and filters them locally.
Occupations follow the 2018 Standard Occupational Classification; occupation search also covers the alternate job titles of the O*NET 31.0 database (CC BY 4.0, by the U.S. Department of Labor, Employment and Training Administration). The ZIP lookup uses the Census Bureau's 2020 ZCTA relationship files and gives metro-level figures, never ZIP-level ones.
BLS suppression and top-code markers become NULL plus a flag, never 0.
ATTACH options
- cache_dir
- Directory for downloaded BLS files and their Parquet conversions (about 25 MB per release). Default: the per-user cache directory, e.g. ~/.cache/vgi-us-wages or ~/Library/Caches/vgi-us-wages.VARCHAR
- base_url
- Where BLS files are fetched from: https://www.bls.gov (default), a mirror URL, or a local directory laid out like bls.gov (oes/tables.htm, oes/special-requests/oesmYYall.zip, oes/area_definitions_mYYYY.xlsx).VARCHAR
- user_agent
- User-Agent sent to bls.gov (default 'vgi-us-wages/0.1 (+https://query.farm)'). BLS asks automated clients to identify themselves, ideally with contact details; set your own if bls.gov answers 403.VARCHAR
- offline
- Never touch the network: use only what is cached (default false).BOOLEAN
Catalog
Everything us_wages exposes once attached — read straight from the worker's
released build.
main 2 tables · 6 functions
OEWS wage and employment estimates, the OEWS area list and ZIP lookup, the SOC 2018 occupation hierarchy and occupation search, and cache management.
Schema examples (12)
The five metro areas paying registered nurses the highest median wage
SELECT area_title, a_median, tot_emp
FROM us_wages.main.wages(occupation := '29-1141', area_type := 'metro')
WHERE a_median IS NOT NULL
ORDER BY a_median DESC
LIMIT 5;
| area_title | a_median | tot_emp |
|---|---|---|
| San Jose-Sunnyvale-Santa Clara, CA | 216,740 | 22,930 |
| Vallejo, CA | 203,290 | 4120 |
| San Francisco-Oakland-Fremont, CA | 186,610 | 41,750 |
| Santa Rosa-Petaluma, CA | 174,550 | 3720 |
| Sacramento-Roseville-Folsom, CA | 171,460 | 23,590 |
Median annual pay of each major occupation group in California
SELECT occ_code, occ_title, a_median
FROM us_wages.main.wages(area := '06')
WHERE o_group = 'major'
ORDER BY a_median DESC NULLS LAST;
Software developer pay in the metro area that contains ZIP 94103
SELECT area_title, cbsa_code, estimate_geography, a_median
FROM us_wages.main.wages_for_zip('94103', '15-1252')
ORDER BY area_code;
Best-paid healthcare occupations in the metro area around Hartford ZIP 06103
SELECT occ_title, a_median
FROM us_wages.main.wages_for_zip('06103', '29-')
WHERE o_group = 'detailed'
ORDER BY a_median DESC NULLS LAST
LIMIT 10;
8 more examples
How many areas of each type the latest release covers
SELECT area_type_name, count(*) AS areas
FROM us_wages.main.areas()
GROUP BY area_type_name
ORDER BY areas DESC;
Metro areas that include part of Connecticut
SELECT area_code, area_title, county_count
FROM us_wages.main.areas()
WHERE area_type_name = 'metro' AND list_contains(states, 'CT')
ORDER BY area_code;
Connecticut's planning regions and the OEWS area of each
SELECT county_fips, county_name, area_title
FROM us_wages.main.area_counties()
WHERE state_abbr = 'CT'
ORDER BY county_fips;
The metro areas made of the most counties
SELECT area_title, count(*) AS counties
FROM us_wages.main.area_counties()
WHERE area_type_name = 'metro'
GROUP BY area_title
ORDER BY counties DESC
LIMIT 5;
The five best SOC matches for 'nurse'
SELECT rank, soc_code, soc_title, matched_title
FROM us_wages.main.search_occupations('nurse', max_results := 5)
ORDER BY rank;
National median pay of the occupations matching 'truck driver'
SELECT s.soc_code, s.soc_title, w.a_median
FROM us_wages.main.search_occupations('truck driver', max_results := 3) s
JOIN us_wages.main.wages(area := '99') w ON w.occ_code = s.soc_code
ORDER BY s.rank;
Make sure the newest OEWS release is cached
SELECT kind, release_year, rows, sha256
FROM us_wages.main.refresh()
ORDER BY kind;
Prefetch the May 2024 release
SELECT kind, release_year, bytes
FROM us_wages.main.refresh(release := '2024')
ORDER BY kind;
cache_info
List the OEWS releases and area definitions in the local cache, plus the bundled tables
Everything the worker holds locally: bundled reference tables, plus any OEWS releases downloaded so far and when they were fetched
SELECT kind, path, release_year, bytes, fetched_at
FROM us_wages.main.cache_info
ORDER BY kind, path;
Cache entries by kind
SELECT kind, count(*) AS entries
FROM us_wages.main.cache_info
GROUP BY kind
ORDER BY kind;
Row counts of the bundled reference tables
SELECT path, rows
FROM us_wages.main.cache_info
WHERE kind = 'bundled'
ORDER BY path;
occupations
The 2018 Standard Occupational Classification: 1,447 major, minor, broad and detailed groups
The SOC major groups with the most detailed occupations
SELECT major_title, count(*) AS detailed_occupations
FROM us_wages.main.occupations
WHERE soc_level = 'detailed'
GROUP BY major_title
ORDER BY detailed_occupations DESC
LIMIT 5;
Definitions of the health diagnosing and treating practitioners
SELECT soc_code, soc_title, definition
FROM us_wages.main.occupations
WHERE minor_code = '29-1000' AND soc_level = 'detailed'
ORDER BY soc_code;
Number of occupations at each SOC level
SELECT soc_level, count(*) AS n
FROM us_wages.main.occupations
GROUP BY soc_level
ORDER BY n;
1 more example
Detailed occupations in the Software Developers broad group
SELECT soc_code, soc_title
FROM us_wages.main.occupations
WHERE broad_code = '15-1250' AND soc_level = 'detailed'
ORDER BY soc_code;
area_counties (release := VARCHAR)
Which OEWS metro or nonmetro area each county belongs to (May 2024 releases onward)
Connecticut's planning regions and the OEWS area of each
SELECT county_fips, county_name, area_title
FROM us_wages.main.area_counties()
WHERE state_abbr = 'CT'
ORDER BY county_fips;
The metro areas made of the most counties
SELECT area_title, count(*) AS counties
FROM us_wages.main.area_counties()
WHERE area_type_name = 'metro'
GROUP BY area_title
ORDER BY counties DESC
LIMIT 5;
areas (release := VARCHAR)
The OEWS areas of a release: US, states, territories, metro (CBSA) and nonmetro areas
How many areas of each type the latest release covers
SELECT area_type_name, count(*) AS areas
FROM us_wages.main.areas()
GROUP BY area_type_name
ORDER BY areas DESC;
Metro areas that include part of Connecticut
SELECT area_code, area_title, county_count
FROM us_wages.main.areas()
WHERE area_type_name = 'metro' AND list_contains(states, 'CT')
ORDER BY area_code;
refresh (force := BOOLEAN, release := VARCHAR)
Download a release into the cache, or re-download it when BLS has republished it
Make sure the newest OEWS release is cached
SELECT kind, release_year, rows, sha256
FROM us_wages.main.refresh()
ORDER BY kind;
Prefetch the May 2024 release
SELECT kind, release_year, bytes
FROM us_wages.main.refresh(release := '2024')
ORDER BY kind;
search_occupations (text VARCHAR, max_results := BIGINT)
Find SOC 2018 codes for a job title, searching SOC titles and 54,000 O*NET alternate titles
The five best SOC matches for 'nurse'
SELECT rank, soc_code, soc_title, matched_title
FROM us_wages.main.search_occupations('nurse', max_results := 5)
ORDER BY rank;
National median pay of the occupations matching 'truck driver'
SELECT s.soc_code, s.soc_title, w.a_median
FROM us_wages.main.search_occupations('truck driver', max_results := 3) s
JOIN us_wages.main.wages(area := '99') w ON w.occ_code = s.soc_code
ORDER BY s.rank;
SELECT soc_code, soc_title
FROM us_wages.main.search_occupations('software developer')
WHERE rank = 1;
1 more example
SELECT soc_code, match_source
FROM us_wages.main.search_occupations('barista', max_results := 1)
ORDER BY rank;
wages (area := VARCHAR, area_type := VARCHAR, industry := VARCHAR, occupation := VARCHAR, release := VARCHAR, state := VARCHAR)
BLS OEWS employment and wages by occupation, area and industry for one May release
The five metro areas paying registered nurses the highest median wage
SELECT area_title, a_median, tot_emp
FROM us_wages.main.wages(occupation := '29-1141', area_type := 'metro')
WHERE a_median IS NOT NULL
ORDER BY a_median DESC
LIMIT 5;
| area_title | a_median | tot_emp |
|---|---|---|
| San Jose-Sunnyvale-Santa Clara, CA | 216,740 | 22,930 |
| Vallejo, CA | 203,290 | 4120 |
| San Francisco-Oakland-Fremont, CA | 186,610 | 41,750 |
| Santa Rosa-Petaluma, CA | 174,550 | 3720 |
| Sacramento-Roseville-Folsom, CA | 171,460 | 23,590 |
Median annual pay of each major occupation group in California
SELECT occ_code, occ_title, a_median
FROM us_wages.main.wages(area := '06')
WHERE o_group = 'major'
ORDER BY a_median DESC NULLS LAST;
wages_for_zip (zip VARCHAR, occupation VARCHAR, all_areas := BOOLEAN, release := VARCHAR)
Metro-level OEWS wages for the metro or nonmetro area containing a ZIP code (not ZIP-level)
Software developer pay in the metro area that contains ZIP 94103
SELECT area_title, cbsa_code, estimate_geography, a_median
FROM us_wages.main.wages_for_zip('94103', '15-1252')
ORDER BY area_code;
Best-paid healthcare occupations in the metro area around Hartford ZIP 06103
SELECT occ_title, a_median
FROM us_wages.main.wages_for_zip('06103', '29-')
WHERE o_group = 'detailed'
ORDER BY a_median DESC NULLS LAST
LIMIT 10;
Try these queries
Median annual pay of each major occupation group in California
SELECT occ_code, occ_title, a_median
FROM us_wages.main.wages(area := '06')
WHERE o_group = 'major'
ORDER BY a_median DESC NULLS LAST
Uses wages
Software developer pay in the metro area that contains ZIP 94103
SELECT area_title, cbsa_code, estimate_geography, a_median
FROM us_wages.main.wages_for_zip('94103', '15-1252')
ORDER BY area_code
Uses wages_for_zip
How many areas of each type the latest release covers
SELECT area_type_name, count(*) AS areas
FROM us_wages.main.areas()
GROUP BY area_type_name
ORDER BY areas DESC
Uses areas
Connecticut's planning regions and the OEWS area of each
SELECT county_fips, county_name, area_title
FROM us_wages.main.area_counties()
WHERE state_abbr = 'CT'
ORDER BY county_fips
Uses area_counties
The five best SOC matches for 'nurse'
SELECT rank, soc_code, soc_title, matched_title
FROM us_wages.main.search_occupations('nurse', max_results := 5)
ORDER BY rank
Uses search_occupations
Make sure the newest OEWS release is cached
SELECT kind, release_year, rows, sha256
FROM us_wages.main.refresh()
ORDER BY kind
Uses refresh
14 more examples in the Catalog, each listed under the table or function it uses.
Questions it can answer
Plain-English questions from the worker's agent test tasks. An AI agent with this catalog attached should answer each one with SQL.
- Using the us_wages worker, how many SOC 2018 major occupation groups are there?
- Using the us_wages worker's occupation search, what is the SOC code for software developers?
- Using the us_wages worker, which metropolitan area has the highest annual median wage for registered nurses in the latest release?
- Using the us_wages worker, which OEWS metro area are wage figures for ZIP code 94103 taken from?
- Using the us_wages worker, how many metropolitan areas does the latest OEWS release cover?
- Using the us_wages worker, how many Connecticut counties or county equivalents belong to the Hartford metro area (CBSA 25540) in the latest area definitions?
US wages (OEWS) is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.
Related workers
BLS
Economy & labour
Retrieve labor, employment, price and productivity series with period codes, footnotes, calculations and survey metadata
BEA
Economy & labour
Discover BEA datasets, parameters and parameter values, then retrieve national, regional, industry and international economic accounts
Bank of England
Economy & labour
Discover Bank of England statistical series and retrieve observations with original periods, units and source metadata