# Data.gov Scraper - US Government Open Data Portal Extractor (`fervent_bus/datagov-scraper`) Actor

- **URL**: https://apify.com/fervent\_bus/datagov-scraper.md
- **Developed by:** [Archit Khurana](https://apify.com/fervent_bus) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 datasets

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

## Data.gov Scraper

Extract datasets from Data.gov, the US government's open data portal. Perfect for AI research, data discovery, and automated dataset curation for LLM training.

### Features

- 🔍 Search by keywords, organization, and tags
- 📊 Extract dataset metadata, tags, and resource counts
- 🏛️ Access 300,000+ government datasets
- ⚡ Fast httpx-based scraping (no browser needed)
- 🤖 Compatible with Claude, ChatGPT & AI agents via Apify MCP

### Input

| Field | Type | Description | Default |
|-------|------|-------------|---------|
| searchQuery | string | Dataset keywords (e.g. 'climate', 'health') | "" |
| organization | string | Filter by organization (e.g. 'nasa', 'noaa', 'cdc') | "" |
| tags | string | Filter by tags (comma-separated) | "" |
| maxResults | integer | Maximum number of datasets to scrape | 3 |
| proxyConfiguration | object | Proxy settings (optional) | - |

### Output

Each dataset contains:

- `datasetUrl` - Full URL to the dataset page
- `datasetTitle` - Dataset name
- `organization` - Publishing organization (NASA, NOAA, CDC, etc.)
- `tags` - Topic tags
- `notes` - Dataset description
- `resources` - Number of downloadable files
- `lastModified` - Last update timestamp
- `scrapedAt` - When the data was scraped

### Use Cases

1. **AI Training Data Discovery** - Find datasets for fine-tuning LLMs
2. **Research Automation** - Auto-collect government research data
3. **Data Journalism** - Monitor new government data releases
4. **Policy Analysis** - Track datasets by organization/topic
5. **Academic Research** - Discover datasets for thesis/papers

### Integration with AI Agents

This scraper is compatible with Claude Code, ChatGPT, and other AI agents via the Apify MCP (Model Context Protocol). Use it to:

- Auto-discover datasets matching research topics
- Build curated dataset libraries for LLM training
- Monitor new releases from specific agencies (NASA, CDC, NOAA)
- Generate research reports from government data

### Pricing

- **Per Result**: $0.003 per dataset scraped
- **Startup Fee**: $0.03 per actor run

Example: Scraping 100 datasets = $0.03 + (100 × $0.003) = **$0.33**

### Example

```json
{
  "searchQuery": "climate change",
  "organization": "noaa",
  "maxResults": 50
}
```

### FAQ

**Q: How many datasets are available?**
A: Over 300,000 datasets from federal, state, and local government agencies.

**Q: What organizations are covered?**
A: NASA, NOAA, CDC, EPA, DOE, USGS, Census Bureau, and 100+ other agencies.

**Q: Can I download the actual data?**
A: This actor extracts dataset *metadata*. Use the `datasetUrl` to access download links on data.gov.

**Q: Is this compatible with ChatGPT/Claude?**
A: Yes! Fully compatible with AI agents via Apify MCP integration.

***

Built for AI agents | Compatible with Claude, ChatGPT & AI agents via Apify MCP

# Actor input Schema

## `searchQuery` (type: `string`):

Dataset keywords to search for (e.g. 'climate', 'health', 'education')

## `organization` (type: `string`):

Filter by organization (e.g. 'nasa', 'noaa', 'cdc')

## `tags` (type: `string`):

Filter by tags (comma-separated)

## `maxResults` (type: `integer`):

Maximum number of datasets to scrape

## `proxyConfiguration` (type: `object`):

Proxy settings (optional)

## Actor input object example

```json
{
  "maxResults": 3
}
```

# 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 = {
    "searchQuery": "",
    "organization": "",
    "tags": "",
    "maxResults": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("fervent_bus/datagov-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 = {
    "searchQuery": "",
    "organization": "",
    "tags": "",
    "maxResults": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("fervent_bus/datagov-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 '{
  "searchQuery": "",
  "organization": "",
  "tags": "",
  "maxResults": 3
}' |
apify call fervent_bus/datagov-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,fervent_bus/datagov-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/jOxBs7XJPwLoTYroO/builds/AESFxfdvVRQ8PEqal/openapi.json
