# Open Dataset Finder: Data.gov, Socrata & Hugging Face Search (`clearfeedlabs/open-dataset-finder`) Actor

Find the best open datasets on any topic in one search across Data.gov, hundreds of Socrata city/state portals and Hugging Face. Ranked, deduped, with license, formats, freshness, columns, API endpoints and optional sample rows.

- **URL**: https://apify.com/clearfeedlabs/open-dataset-finder.md
- **Developed by:** [Clearfeed Labs](https://apify.com/clearfeedlabs) (community)
- **Categories:** AI, Developer tools, Other
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.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.

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

### Open Dataset Finder: Data.gov, Socrata & Hugging Face Search

**Open Dataset Finder** searches the big open-data catalogs at once (**Data.gov**, hundreds of **Socrata** city, state and agency portals, and **Hugging Face**), then **dedupes and ranks** the results so you get the few datasets that actually fit, with **license, formats, last update, popularity, column names, API endpoint and download links** on every row. An optional add-on shows **3 real sample records** so you can check the data before you download anything.

Built for **data scientists and ML engineers, analysts and BI teams, journalists, students and researchers, civic-tech builders, and AI agents** that need data on demand.

- One query, three catalogs, one ranked list (relevance = title, keyword and description hits + freshness + popularity).
- Filters: formats (csv, json, geojson, parquet, api...), **open licenses only**, updated within N days, a single Socrata portal.
- Column names for Socrata datasets; ready-made API and CSV download URLs.
- **Add-on (off by default)**: 3 sample rows per Socrata dataset (the portal's robots.txt is checked first).

No login, no API key, no proxies: each catalog's documented public search API, called with an identifying User-Agent. Data.gov's 10-second crawl delay is respected.

Use it as a **dataset search engine API**, a **Data.gov scraper / CKAN search alternative**, a **Socrata open data portal search** across every city and state, or a **Hugging Face dataset finder** for machine learning and LLM training data: find public datasets by topic, license and format (CSV, JSON, GeoJSON, Parquet, API) and export the list to CSV, Excel or JSON.

#### Why this one

| | Open Dataset Finder | Single-catalog scraper |
|---|---|---|
| Catalogs | Data.gov + Socrata network + Hugging Face | One |
| Ranking + dedupe | Yes | Raw search order, duplicates |
| License filter | Recognised open licenses | No |
| Usable links | API endpoint + CSV download + columns | Landing page only |
| Preview | Sample rows add-on | No |

#### Pricing (pay per event)

| Event | Price | When |
|---|---|---|
| Dataset | **$0.002** | Each ranked dataset returned |
| Sample rows add-on | +$0.002 per dataset | Only if `addSampleRows` is on and samples were fetched |
| Actor start | $0.00005 | Apify's standard start event |

**How that compares:** catalog and Hugging Face scrapers on the Store run about $1–$5 per 1,000 raw results from one catalog. A ranked top-50 across three catalogs costs **$0.10** here.

**Billing examples:** no incremental mode; you pay per dataset returned: 25 datasets = $0.05; 25 with sample rows = $0.10; no matches = start event only. Set **Max charge per run** to cap spend.

#### Input examples

```json
{ "query": "wildfire risk", "openLicenseOnly": true, "maxItems": 25 }
```

```json
{ "query": "traffic crashes", "sources": ["socrata"], "formats": ["csv"], "updatedWithinDays": 30, "addSampleRows": true }
```

```json
{ "query": "medical question answering", "sources": ["huggingface"], "maxItems": 20 }
```

#### Output (one row)

`relevance`, `source` (`data.gov`, `socrata`, `huggingface`), `id`, `title`, `description`, `publisher`, `portal`, `url`, `license`, `formats`, `keywords`, `lastUpdated`, `popularity` (views or downloads), `columns`, `apiEndpoint`, `downloadUrls`, plus `sampleRows[]` with the add-on.

#### Column lists and types

Socrata results list every column name in `columns` (up to 100). They also include `columnTypes` (column → type such as Text, Number or Calendar date), the portal's `category`, `pageViewsTotal` and `downloadCount`. All of it comes straight from the Socrata Discovery API catalog record, so you can check whether a dataset has the fields you need before downloading it. Data.gov and Hugging Face catalogs don't publish column lists, so `columns` is empty for those rows.

#### Notes

- Data.gov runs slower on purpose (10 s between pages, per its robots.txt); limit `maxResultsPerSource` for faster runs.
- Gated and private Hugging Face datasets are skipped.
- Licenses are shown as each catalog reports them; always read the dataset's own terms before reuse. `openLicenseOnly` keeps only recognised open licenses, so unknown, custom or missing licenses are excluded rather than assumed open.
- `lastUpdated` is the catalog's metadata date; it doesn't prove the underlying data is fresh. Sample rows show format, not completeness or fitness for your use.
- Sample rows are published open data and are shown as-is; some city datasets include names or addresses that the city chose to publish.

#### FAQ

**How do I find open datasets on a topic?**
Type a topic in `query` (e.g. `"wildfire risk"`, `"housing permits"`, `"air quality"`). The Actor searches Data.gov, the Socrata network of city, county and state portals, and Hugging Face in one run, removes duplicates and returns a ranked list with license, formats, last update and links.

**Can I search only one portal, such as NYC Open Data or the Chicago Data Portal?**
Yes. Set `sources` to `["socrata"]` and `socrataDomain` to the portal (e.g. `data.cityofnewyork.us`, `data.cityofchicago.org`).

**Can I find datasets for machine learning or LLM training?**
Yes. Use `sources: ["huggingface"]`, or keep all three catalogs and turn on `openLicenseOnly` to keep only recognised open licenses. Always check each dataset's own terms before training a model.

**Can I filter by file format or freshness?**
Yes: `formats` (csv, json, geojson, parquet, api...) and `updatedWithinDays`.

**Can I preview the data before downloading?**
Turn on `addSampleRows` to get 3 real records for each Socrata API dataset, plus `columns` and `columnTypes`.

**How much does it cost?**
$0.002 per dataset returned ($2 per 1,000); a ranked top-25 costs $0.05. Sample rows add $0.002 per dataset.

**Can AI agents use it?**
Yes. Call it through the Apify API or the Apify MCP server so an agent can look up datasets on demand, or schedule it to watch for new datasets on a topic.

#### Data sources and legal notes

- **Data.gov catalog** (GSA): public search, robots.txt allows it, 10 s crawl delay honored.
- **Socrata Discovery API** (api.us.socrata.com): documented public API.
- **Hugging Face Hub API**: documented public API; robots.txt allows.
- Zenodo was considered and **excluded** because its robots.txt disallows `/api`.
- Not affiliated with or endorsed by GSA, Tyler Technologies (Socrata) or Hugging Face.

#### Disclaimer

Results are catalog metadata provided **as is**. This Actor doesn't verify that data is accurate, current or licensed for your use, and **it isn't legal advice**. Check each dataset's license and terms before commercial use or model training.

#### Support

Want another catalog (CKAN portals, Dataverse, EU Open Data)? Open an issue on this Actor's **Issues** tab. More Clearfeed Labs data feeds: [clearfeedlabs.com](https://clearfeedlabs.com).

### Related Clearfeed Labs Actors

- [311 Complaints by District: Pain-Point & Spike Tracker](https://apify.com/clearfeedlabs/district-pain-point-tracker): 311 complaint spikes by council district
- [USAspending Scraper: Federal Contract & Grant Award Alerts](https://apify.com/clearfeedlabs/money-trail-federal-awards): federal contract and grant awards with recompete details
- [Grants.gov Scraper & Grant Finder API: NSF, NIH Fellowships](https://apify.com/clearfeedlabs/grant-fellowship-radar): federal grants and fellowships with deadlines
- [All Clearfeed Labs Actors](https://apify.com/clearfeedlabs)

# Actor input Schema

## `query` (type: `string`):

What data you need, e.g. "bike share trips", "hospital prices", "traffic crashes".

## `sources` (type: `array`):

Where to search.

## `formats` (type: `array`):

Keep only datasets offering one of these, e.g. csv, json, geojson, parquet, api, xlsx, shp.

## `openLicenseOnly` (type: `boolean`):

Keep only datasets with a recognised open license (public domain, CC0, CC BY, ODC, MIT, Apache...).

## `updatedWithinDays` (type: `integer`):

Only datasets modified recently.

## `socrataDomain` (type: `string`):

Limit Socrata results to one portal, e.g. data.cityofchicago.org.

## `maxResultsPerSource` (type: `integer`):

How many results to pull from each catalog before ranking.

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

Top N after ranking and dedupe. Each is charged.

## `addSampleRows` (type: `boolean`):

Peek at real records (Socrata datasets) so you know the data fits before downloading.

## Actor input object example

```json
{
  "query": "wildfire risk",
  "sources": [
    "datagov",
    "socrata",
    "huggingface"
  ],
  "openLicenseOnly": false,
  "maxResultsPerSource": 60,
  "maxItems": 50,
  "addSampleRows": false
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "query": "wildfire risk"
};

// Run the Actor and wait for it to finish
const run = await client.actor("clearfeedlabs/open-dataset-finder").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 = { "query": "wildfire risk" }

# Run the Actor and wait for it to finish
run = client.actor("clearfeedlabs/open-dataset-finder").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 '{
  "query": "wildfire risk"
}' |
apify call clearfeedlabs/open-dataset-finder --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,clearfeedlabs/open-dataset-finder"
        }
    }
}
```

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/bemYpfrFrxBvBvWck/builds/htgxL1QqOaH29jmb9/openapi.json
