# IRS Form W-2 Details Scraper (`parseforge/irs-form-w-2-scraper`) Actor

Extract official IRS Form W-2 metadata and structured details from the IRS website. Pulls form number, title, description, revision date, PDF link, instructions URL, category, and related forms. Ideal for tax professionals and developers building up-to-date tax form databases or compliance tools.

- **URL**: https://apify.com/parseforge/irs-form-w-2-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Other, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.40 / 1,000 result items

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
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

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner-v4.webp)](https://apify.com/parseforge?fpr=vmoqkp)

### IRS Form W-2 Details Scraper

**Scrape IRS Form W-2 details from any form page or search query.** Each result includes the form title, description, PDF URL, revision date, related forms, and full page metadata. No login or API key. Export to CSV, JSON, Excel, or XML.

The IRS website posts detailed information about each tax form, but pulling W-2 data manually for analysis or compliance is slow. This reads the public IRS form pages directly, filtered by historical status, and returns a structured dataset with every metadata field available on the page.

| Who uses it | What they scrape IRS for |
|---|---|
| Payroll processors | Verify current W-2 form instructions and PDF links without visiting the IRS page manually. |
| HR compliance teams | Monitor revision dates and related forms for quarterly filing updates. |
| Tax software developers | Integrate W-2 form metadata and PDF URLs directly into their applications. |
| Data analysts | Collect W-2 form details across multiple IRS form types for trend tracking. |

### What it does

This Actor collects IRS Form W-2 detail pages by URL or search term, and returns each page's metadata as one flat row.

- 🔍 **Search by term:** Enter a keyword like "W-2" to find all matching form pages, with optional historical status filters.
- 🌐 **Direct URLs:** Scrape specific IRS form detail pages by URL, such as the official W-2 page or its instructions.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with IRS data

**✅ Keep W-2 form data up to date.**

Payroll teams run this scraper monthly to capture any revision date changes or new PDF editions without manually checking the IRS site.

**🗂️ Build a tax form database.**

Software developers use the scrape output to populate a searchable database of IRS forms with direct PDF download links for their users.

**📊 Analyze form metadata trends.**

Researchers collect revision dates and related forms across years to track how IRS publications evolve.

### Why choose this scraper

| | What you get |
|---|---|
| **Form metadata** | Each row includes the form number, title, description, PDF URL, and revision date. |
| **Page SEO data** | Get the meta description, canonical URL, Open Graph and Twitter card images and alt text. |
| **Related resources** | A list of related forms and instructions URLs is included in the output. |
| **Language support** | The hreflang field shows available translations for the form page. |

### What a IRS record looks like

Every record returns as one flat JSON row. Here is a real one from a run:

```json
{
 "pageTitle": "About Form W-2, Wage and Tax Statement | Internal Revenue Service",
 "metaDescription": "Information about Form W-2, Wage and Tax Statement, including recent updates, related forms and instructions on how to file. Form W-2 is filed by employers to report wages, tips, and other compensation paid to employees as well as FICA and withheld income taxes.",
 "canonicalUrl": "https://www.irs.gov/forms-pubs/about-form-w-2",
 "ogImage": "https://www.irs.gov/pub/image/irs_logo.jpg",
 "ogImageAlt": "IRS logo",
 "twitterTitle": "About Form W-2, Wage and Tax Statement | Internal Revenue Service",
 "twitterDescription": "Information about Form W-2, Wage and Tax Statement, including recent updates, related forms and instructions on how to file. Form W-2 is filed by employers to report wages, tips, and other compensation paid to employees as well as FICA and withheld income taxes.",
 "twitterImage": "https://www.irs.gov/pub/image/logo_small.jpg",
 "title": "About Form W-2, Wage and Tax Statement",
 "formNumber": "W-2",
 "formDescription": "Information about Form W-2, Wage and Tax Statement, including recent updates, related forms and instructions on how to file. Form W-2 is filed by employers to report wages, tips, and other compensation paid to employees as well as FICA and withheld income taxes.",
 "pdfUrl": "https://www.irs.gov/pub/irs-pdf/fw2.pdf",
 "instructionsUrl": "https://www.irs.gov/forms-instructions",
 "category": "Forms and Instructions",
 "language": "en"
}
```

Every value above comes from a real run. A field a record does not have comes back as `null`.

### Configure the run

Drive the Actor from IRS form detail URLs or a search term, and two historical status filters let you narrow results to current forms only. The Input tab lists every parameter.

A first run with the defaults:

```json
{
 "startUrls": [
 {
 "url": "https://www.irs.gov/forms-pubs/about-form-w-2"
 }
 ],
 "maxItems": 10
}
```

A larger pull:

```json
{
 "startUrls": [
 {
 "url": "https://www.irs.gov/forms-pubs/about-form-w-2"
 }
 ],
 "maxItems": 200
}
```

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Set your inputs and any filters, then click **Start**.
3. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to IRS through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**I'm getting no results from a search term.**

Check that the search term is spelled correctly and is a valid IRS form name. Try using partial words like 'W-2' or the form number.

**The run returns only 10 items.**

Free accounts are limited to 10 items. Upgrade to a paid Apify account and increase the maxItems value.

**Output fields are missing.**

Some IRS pages may not have all optional metadata (like og:image or twitter fields). The scraper returns only what is available on the page.

**The URL I added returns a 404.**

Ensure the URL points to an 'about-form' or 'forms-pubs' page on irs.gov. Direct PDF links are not supported as start URLs.

### FAQ

| Question | Answer |
|---|---|
| Does this scrape the actual W-2 form data for employees? | No, this scraper extracts metadata from the IRS Form W-2 detail page, such as form title, PDF URL, revision date, and instructions. It does not parse the fillable W-2 form or extract personal income data. |
| Can I use a search term instead of a URL? | Yes. Set the searchTerm input to a keyword like 'W-2' and the Actor will return all matching IRS form pages. |
| How do I filter to only current forms? | Set both Historical filter 1 and Historical filter 2 to 'No' to exclude older versions. |
| What is the maxItems limit? | Free users get 10 items as a preview. Paid users can set up to 1,000,000. |
| Does this require an IRS API key? | No. The Actor reads the public IRS website pages directly with no authentication. |
| Will it work with other IRS form pages? | Yes. You can scrape any IRS about-form page, such as Form 1099 or Form 1040, by providing its URL or searching by name. |
| What export formats are available? | CSV, JSON, Excel, and XML, plus direct integration via Apify's webhooks and API. |
| Does the output include the full page HTML? | No. Only the structured metadata fields (title, description, PDF URL, etc.) are extracted. |
| How often is the IRS site scraped? | You control the run frequency with Apify's scheduling. We do not scrape automatically. |
| Can I scrape instructions pages too? | Yes. The related forms and instructions URLs are listed in the output, and you can add them as start URLs in a new run. |

### Related actors

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by Internal Revenue Service. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

# Actor input Schema

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

List of IRS form detail page URLs to scrape. Defaults to the official Form W-2 about page.

## `searchTerm` (type: `string`):

Keyword to search for forms on the IRS site. Overrides start URLs when provided.

## `fieldPupHistorical1` (type: `string`):

Filter search results by the first historical status field.

## `fieldPupHistorical` (type: `string`):

Filter search results by the second historical status field.

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

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.irs.gov/forms-pubs/about-form-w-2"
    }
  ],
  "maxItems": 10
}
```

# Actor output Schema

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

Complete dataset of all scraped 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 = {
    "startUrls": [
        {
            "url": "https://www.irs.gov/forms-pubs/about-form-w-2"
        }
    ],
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/irs-form-w-2-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.irs.gov/forms-pubs/about-form-w-2" }],
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/irs-form-w-2-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 '{
  "startUrls": [
    {
      "url": "https://www.irs.gov/forms-pubs/about-form-w-2"
    }
  ],
  "maxItems": 10
}' |
apify call parseforge/irs-form-w-2-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/irs-form-w-2-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/zis6k9wcwwUW6dvXr/builds/HJcU2QoSNYC18hM71/openapi.json
