# USDA Local Food & Farmers Market Leads Scraper (`scrapesage/usda-local-food-scraper`) Actor

Scrape USDA Local Food Directories — farmers markets, CSAs, food hubs, on-farm markets & agritourism. Get name, address, geo, email, phone, website & socials plus products, payments, SNAP/WIC/FMNP, organic status & season. Filter by state, ZIP, product or program. Export JSON, CSV, Excel.

- **URL**: https://apify.com/scrapesage/usda-local-food-scraper.md
- **Developed by:** [Scrape Sage](https://apify.com/scrapesage) (community)
- **Categories:** Lead generation, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$6.00 / 1,000 local food leads

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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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

## USDA Local Food & Farmers Market Leads Scraper — Markets, CSAs, Food Hubs, On-Farm Markets & Agritourism (Emails, Phones & Socials)

Extract **every business in the official USDA Local Food Directories** — **farmers markets, CSAs, food hubs, on-farm markets and agritourism operations** — as ready-to-contact B2B leads. Each record ships the fields generic Google-Maps scrapers miss: **contact email, phone, website and social links** joined with the **rich USDA firmographics** — accepted payments, **SNAP / WIC / FMNP** participation, **organic / USDA-certified** production methods, products sold, season, CSA share details, facilities and exact geo-coordinates.

No login, no cookies, no API key — fast JSON extraction straight from the USDA Local Food portal.

### Why this scraper?

The USDA Local Food Directories are the authoritative public registry of ~28,000 US local-food businesses, but the official site hides contacts behind a map UI and a key-gated API, and the bulk download strips them out entirely. This actor unifies **both** USDA data sources — the complete bulk directory **and** the contact-bearing listing pages — into one clean lead record.

| Data | Generic GMaps scrapers | USDA bulk download | This actor |
|---|---|---|---|
| Farmers markets + CSAs + food hubs + on-farm markets + agritourism | partial | ✅ | ✅ all five, unified |
| Contact email | guesses | ❌ stripped | ✅ official |
| Phone | ✅ | ❌ stripped | ✅ |
| Website + Facebook / Instagram / Twitter / Pinterest / YouTube | partial | ❌ | ✅ |
| Accepted payments (cash, credit, check) | ❌ | ✅ | ✅ |
| SNAP / EBT, WIC, FMNP, SFMNP participation | ❌ | ✅ | ✅ + filters |
| Organic / USDA-certified production | ❌ | ✅ | ✅ + filter |
| Products sold, season, CSA share details, facilities | ❌ | ✅ | ✅ |
| Latitude / longitude / full address | partial | ✅ | ✅ |
| Lead score (0–100) | ❌ | ❌ | ✅ |
| Monitor mode (only new / changed) | ❌ | ❌ | ✅ |

### Use cases

- **Lead generation** — sell to local-food businesses: POS & market-management software, payment / EBT processors, packaging & labeling, cold-chain & delivery, insurance, agtech, food-safety and certification services. Score leads by contact completeness (`leadScore`) and reach them at `email` / `phone`.
- **CPG & food-brand distribution** — find farmers markets, CSAs, food hubs and on-farm stores to place products, sample, or recruit as wholesale accounts, filtered by state, product (`productKeywords`) or season.
- **Agritourism & travel** — build directories of farm stays, U-pick, tours, wineries and on-farm dining with contacts and facilities.
- **Public-health & nutrition programs** — target (or find gaps in) markets that accept **SNAP / WIC / FMNP** for outreach, equipment, and incentive programs.
- **Market & competitive intelligence** — map the local-food economy by state, product mix, organic status and accepted-payment coverage.
- **Monitoring** — schedule recurring runs to capture newly listed or recently updated markets for newsletters and lead pipelines.

### How to use

1. [Sign up for Apify](https://console.apify.com/sign-up) — the free plan is enough to try this actor.
2. Open the **USDA Local Food & Farmers Market Leads Scraper**, choose directories and a location (state, city, ZIP, or lat/long + radius), and click **Start**.
3. Watch lead records stream into the dataset table.
4. **Export** as JSON, CSV, Excel, XML, or RSS — or pull results programmatically via the [Apify API](https://docs.apify.com/api/v2).

### Input

```json
{
    "directories": ["farmersmarket", "csa", "onfarmmarket"],
    "states": ["CO", "NM"],
    "acceptsSnap": true,
    "organicOnly": true,
    "hasEmail": true,
    "includeContacts": true,
    "includeFirmographics": true,
    "sortBy": "leadScore",
    "maxResults": 500
}
````

- **directories** — any of `farmersmarket`, `csa`, `foodhub`, `onfarmmarket`, `agritourism` (default: all five).
- **states / cities / zipCodes** — geographic filters (2-letter or full state names).
- **latitude / longitude / radiusMiles** — point-radius search (overrides state/city/zip targeting).
- **searchTerm / productKeywords / acceptedPaymentContains / nameContains** — keyword filters.
- **acceptsSnap / acceptsWic / acceptsFmnp** — keep only listings in those nutrition programs.
- **organicOnly / certifiedOrganicOnly** — keep only organic / USDA-certified listings.
- **hasEmail / hasPhone / hasWebsite / hasAnyContact** — keep only contactable leads.
- **updatedAfter** — only listings updated on/after a date (freshness).
- **includeContacts** *(default true)* — resolve email, phone, website & socials per listing.
- **includeFirmographics** *(default true)* — products, payments, programs, production methods, season, CSA shares, facilities.
- **monitorMode** *(default false)* — output only new or changed listings vs. previous runs.
- **includeRawFields** *(default false)* — attach the full raw USDA record under `sourceFields`.

### Output

One record per local-food business:

```json
{
    "listingId": "309045",
    "directoryType": "farmersmarket",
    "directoryName": "Farmers Market",
    "listingName": "Downtown Sunday Market",
    "briefDescription": "Seasonal open-air market in downtown Colorado Springs.",
    "address": "115 E. Platte Ave., Colorado Springs, CO, 80903",
    "street": "115 E. Platte Ave.",
    "city": "Colorado Springs",
    "state": "Colorado",
    "stateAbbr": "CO",
    "zipCode": "80903",
    "latitude": 38.8378,
    "longitude": -104.8224,
    "contactName": null,
    "email": "infomarket@ppcf.org",
    "phone": "719-243-6693",
    "website": "http://www.downtowncs.com/experience-downtown/sunday-market-downtown.html",
    "facebook": "https://www.facebook.com/DowntownSundayMarket",
    "instagram": null,
    "socialLinks": ["https://www.facebook.com/DowntownSundayMarket"],
    "acceptedPayments": ["Debit card/Credit card"],
    "nutritionPrograms": ["SNAP", "Accept EBT at a central location"],
    "acceptsSnap": true,
    "acceptsWic": false,
    "acceptsFmnp": false,
    "productionMethods": ["Organic (USDA Certified)"],
    "isOrganic": true,
    "isCertifiedOrganic": true,
    "products": ["Vegetables", "Fruits", "Honey", "Baked goods"],
    "season": "June to October",
    "seasonStart": "2023-06",
    "seasonEnd": "2023-10",
    "lastUpdated": "2023-03-20",
    "leadScore": 86,
    "leadSignals": ["email", "phone", "website", "social", "nutritionPrograms", "certifiedOrganic"],
    "contactCount": 4,
    "profileUrl": "https://www.usdalocalfoodportal.com/fe/flisting?lid=309045&directory_type=farmersmarket",
    "scrapedAt": "2026-06-21T18:00:00.000Z"
}
```

### Automate & schedule

Run this actor on autopilot and pull results into your own stack:

- **[Apify API](https://docs.apify.com/api/v2)** — start runs, fetch datasets, and manage schedules over REST.
- **[apify-client for JavaScript](https://docs.apify.com/api/client/js/)** and **[apify-client for Python](https://docs.apify.com/api/client/python/)** — official SDKs.
- **[Schedules](https://docs.apify.com/platform/schedules)** — run it daily/weekly to capture newly listed markets in a state or category; pair with `monitorMode` for a clean new-leads-only feed.
- **[Webhooks](https://docs.apify.com/platform/integrations/webhooks)** — trigger downstream actions (CRM import, Slack alert, email sequence) the moment a run finishes.

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'MY_APIFY_TOKEN' });

const run = await client.actor('scrapesage/usda-local-food-scraper').call({
    directories: ['farmersmarket', 'csa'],
    states: ['CA'],
    hasEmail: true,
    maxResults: 1000,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Got ${items.length} local-food leads`);
```

### Integrate with any app

Connect the dataset to 5,000+ apps — no code required:

- **[Make](https://docs.apify.com/platform/integrations/make)** — multi-step automation scenarios.
- **[Zapier](https://docs.apify.com/platform/integrations/zapier)** — push new leads straight into your CRM.
- **[Slack](https://docs.apify.com/platform/integrations/slack)** — get notified when a monitored search finds new markets.
- **[Google Drive / Sheets](https://docs.apify.com/platform/integrations/drive)** — auto-export every run to a spreadsheet.
- **[Airbyte](https://docs.apify.com/platform/integrations/airbyte)** — pipe results into your data warehouse.
- **[GitHub](https://docs.apify.com/platform/integrations/github)** — trigger runs from commits or releases.

### Use with AI assistants (MCP)

The output is clean, LLM-ready JSON. Call this actor from Claude, ChatGPT, or any agent framework through the **[Apify MCP server](https://docs.apify.com/platform/integrations/mcp)** — ask your assistant to "find organic farmers markets in Colorado that accept SNAP and list their emails" and let it run this scraper for you.

### Agent-ready: autonomous payments (x402 & Skyfire)

This actor is **agent-ready** — AI agents can discover it, run it, and **pay for it autonomously**, with no Apify account and no human in the loop. It uses [pay-per-event](https://docs.apify.com/platform/actors/publishing/monetize/pay-per-event) pricing and [limited permissions](https://docs.apify.com/platform/actors/development/permissions), so it qualifies for Apify's agentic-payment standards:

- **[x402](https://docs.apify.com/platform/integrations/x402)** — an open, HTTP-native payment protocol. Agents pay per run in USDC on the Base network directly through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp) — no account, no API key.
- **[Skyfire](https://docs.apify.com/platform/integrations/skyfire)** — agent-to-service payments for fully autonomous AI-agent workflows.

Building an AI agent, MCP tool, or autonomous data pipeline? This scraper is ready to plug in and pay as it goes.

### More scrapers from scrapesage

Build a complete **US food, agriculture & local-business lead stack**:

- **[US Organic Operations Scraper](https://apify.com/scrapesage/us-organic-operations-scraper)** — USDA-certified organic farms & handlers with certifier, scopes and contacts.
- **[US SNAP Retailers Scraper](https://apify.com/scrapesage/us-snap-retailer-scraper)** — every SNAP/EBT-authorized store (grocery, convenience, supermarket, farmers market).
- **[USDA FSIS Establishment Scraper](https://apify.com/scrapesage/fsis-establishment-scraper)** — meat, poultry & egg plants with contacts and activities.
- **[US Restaurant Inspection Scraper](https://apify.com/scrapesage/us-restaurant-inspection-scraper)** — restaurant leads with health-inspection grades and signals.
- **[Nonprofit 990 Scraper](https://apify.com/scrapesage/nonprofit-990-scraper)** — US nonprofit financials and contacts (food banks, co-ops, ag nonprofits).
- **[US Business Formation Scraper](https://apify.com/scrapesage/us-business-formation-scraper)** — newly registered US companies as fresh B2B leads.
- **[Texas Business Leads Scraper](https://apify.com/scrapesage/texas-business-leads-scraper)** — Texas businesses by NAICS industry with new-business intent.
- **[SBA Loan Leads Scraper](https://apify.com/scrapesage/sba-loan-leads-scraper)** — SBA 7(a) & 504 borrowers as financing-intent leads.

### Tips

- **Pick a single state and a few directories** for a fast, fully-populated run that's perfect for direct export.
- **For the most contactable leads**, set `hasEmail` or `hasAnyContact` and sort by `leadScore`.
- **Nationwide runs**: keep `includeContacts` on and raise `maxSearchCalls` so contact enrichment covers the whole country; contacts come from the public USDA listing pages, so coverage is highest where markets publish them.
- **Recurring monitoring**: combine [Schedules](https://docs.apify.com/platform/schedules) with `monitorMode` to track only newly listed or updated markets.
- **Proxies**: not required — the USDA portal is reachable directly from Apify. Add a proxy only if you ever hit blocks.

### FAQ

**Where does the data come from?** The official [USDA Local Food Directories](https://www.usdalocalfoodportal.com/) maintained by USDA AMS — the authoritative public registry of US farmers markets, CSAs, food hubs, on-farm markets and agritourism operations.

**Does it need an API key?** No. The USDA API requires an emailed key and the bulk download omits contacts — this actor reads the same public data (including the listing pages that carry contacts) with no key or login.

**Where do the emails and phones come from?** From the public USDA directory listing pages, where each business chooses to publish its own contact details. Coverage is high but not universal — fields are `null` only when the business didn't publish them, never because the scraper skipped them.

**Can I export to Google Sheets, CSV, or Excel?** Yes — one click in the dataset view, or automatically on every run via the [Google Drive integration](https://docs.apify.com/platform/integrations/drive).

**How do I monitor new markets automatically?** Turn on `monitorMode` and create a [Schedule](https://docs.apify.com/platform/schedules); each run returns only new or updated listings. Add a [webhook](https://docs.apify.com/platform/integrations/webhooks) or [Zapier zap](https://docs.apify.com/platform/integrations/zapier) to push them into your CRM.

**Does monitor mode conflict with Apify Schedules?** No — they're complementary. Schedules decide *when* the actor runs; monitor mode decides *what* each run outputs (only new/changed listings). Use them together for a hands-off new-leads feed.

**Is scraping this data legal?** This actor collects publicly available government directory data only. You are responsible for using it in compliance with applicable laws (e.g. GDPR/CCPA for personal data) and the source site's terms.

### Need help?

Open an issue on the actor's **Issues** tab, or visit the [Apify help center](https://help.apify.com/). Feature requests are welcome — this actor is actively maintained.

# Actor input Schema

## `directories` (type: `array`):

Which USDA Local Food directories to scrape. Default: all five.

## `states` (type: `array`):

Filter by US state — 2-letter codes (<code>CA</code>, <code>TX</code>) or full names (<code>California</code>). Leave empty for all states.

## `cities` (type: `array`):

Filter by city name (case-insensitive, exact match on the directory's city field).

## `zipCodes` (type: `array`):

Filter by 5-digit ZIP code.

## `latitude` (type: `string`):

Center latitude for a radius search (use with Longitude + Radius). Overrides state/city/zip targeting.

## `longitude` (type: `string`):

Center longitude for a radius search.

## `radiusMiles` (type: `integer`):

Radius in miles for the point search above.

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

Optional keyword passed to the USDA search (matches listing name / description), e.g. <code>organic</code>, <code>honey</code>.

## `productKeywords` (type: `array`):

Keep only listings whose products / name / description / facilities mention any of these keywords (e.g. <code>eggs</code>, <code>grass-fed</code>, <code>honey</code>, <code>flowers</code>).

## `acceptedPaymentContains` (type: `string`):

Keep only listings whose accepted-payment list contains this text (e.g. <code>credit</code>, <code>check</code>).

## `acceptsSnap` (type: `boolean`):

Only listings that accept SNAP / EBT.

## `acceptsWic` (type: `boolean`):

Only listings that accept WIC (incl. WIC Farmers' Market Nutrition Program).

## `acceptsFmnp` (type: `boolean`):

Only listings that accept the Farmers' Market Nutrition Program (FMNP / SFMNP).

## `organicOnly` (type: `boolean`):

Only listings that report any organic production method.

## `certifiedOrganicOnly` (type: `boolean`):

Only listings that report USDA-certified organic production.

## `nameContains` (type: `string`):

Keep only listings whose name contains this text.

## `hasEmail` (type: `boolean`):

Only output listings with a contact email.

## `hasPhone` (type: `boolean`):

Only output listings with a contact phone.

## `hasWebsite` (type: `boolean`):

Only output listings with a website.

## `hasAnyContact` (type: `boolean`):

Only output listings with at least one of email / phone / website / social link.

## `updatedAfter` (type: `string`):

Only listings last updated on or after this date (YYYY-MM-DD). Great for freshness / monitoring.

## `includeContacts` (type: `boolean`):

Resolve email, phone, website and social links per listing (recommended — this is what turns a listing into a lead). Turn off for a faster firmographic-only run.

## `includeFirmographics` (type: `boolean`):

Include the rich directory fields: products, accepted payments, nutrition programs (SNAP/WIC/FMNP), production methods, season, CSA share details, facilities, etc.

## `includeRawFields` (type: `boolean`):

Attach the full raw USDA record under <code>sourceFields</code> for each listing.

## `sortBy` (type: `string`):

Order of the output records.

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

Maximum number of lead records to output.

## `maxSearchCalls` (type: `integer`):

Safety cap on the number of geo searches used for contact enrichment. Higher = more complete contacts on very large (nationwide) runs.

## `monitorMode` (type: `boolean`):

Remember listings seen in previous runs (by ID + last-updated date) and output only new or changed ones. Independent of Apify Schedules — schedule this actor and each run returns just the fresh leads.

## `monitorStateKey` (type: `string`):

Namespace for monitor memory. Use different keys for independent monitors (e.g. one per state or per directory).

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

Optional. The USDA portal is reachable directly from Apify; add a proxy only if you hit blocks.

## Actor input object example

```json
{
  "directories": [
    "farmersmarket"
  ],
  "states": [
    "CO"
  ],
  "radiusMiles": 50,
  "acceptsSnap": false,
  "acceptsWic": false,
  "acceptsFmnp": false,
  "organicOnly": false,
  "certifiedOrganicOnly": false,
  "hasEmail": false,
  "hasPhone": false,
  "hasWebsite": false,
  "hasAnyContact": false,
  "includeContacts": true,
  "includeFirmographics": true,
  "includeRawFields": false,
  "sortBy": "leadScore",
  "maxResults": 1000,
  "maxSearchCalls": 90,
  "monitorMode": false,
  "monitorStateKey": "default",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

All scraped local-food lead records as JSON items in the default dataset.

# 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 = {
    "directories": [
        "farmersmarket"
    ],
    "states": [
        "CO"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapesage/usda-local-food-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 = {
    "directories": ["farmersmarket"],
    "states": ["CO"],
}

# Run the Actor and wait for it to finish
run = client.actor("scrapesage/usda-local-food-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "directories": [
    "farmersmarket"
  ],
  "states": [
    "CO"
  ]
}' |
apify call scrapesage/usda-local-food-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=scrapesage/usda-local-food-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "USDA Local Food & Farmers Market Leads Scraper",
        "description": "Scrape USDA Local Food Directories — farmers markets, CSAs, food hubs, on-farm markets & agritourism. Get name, address, geo, email, phone, website & socials plus products, payments, SNAP/WIC/FMNP, organic status & season. Filter by state, ZIP, product or program. Export JSON, CSV, Excel.",
        "version": "0.1",
        "x-build-id": "4LNdZNNIL5bgsXPln"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scrapesage~usda-local-food-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scrapesage-usda-local-food-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/scrapesage~usda-local-food-scraper/runs": {
            "post": {
                "operationId": "runs-sync-scrapesage-usda-local-food-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/scrapesage~usda-local-food-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-scrapesage-usda-local-food-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "directories": {
                        "title": "Directories",
                        "type": "array",
                        "description": "Which USDA Local Food directories to scrape. Default: all five.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "farmersmarket",
                                "csa",
                                "foodhub",
                                "onfarmmarket",
                                "agritourism"
                            ],
                            "enumTitles": [
                                "Farmers Markets",
                                "CSAs (Community Supported Agriculture)",
                                "Food Hubs",
                                "On-Farm Markets",
                                "Agritourism"
                            ]
                        },
                        "default": [
                            "farmersmarket",
                            "csa",
                            "foodhub",
                            "onfarmmarket",
                            "agritourism"
                        ]
                    },
                    "states": {
                        "title": "States",
                        "type": "array",
                        "description": "Filter by US state — 2-letter codes (<code>CA</code>, <code>TX</code>) or full names (<code>California</code>). Leave empty for all states.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "cities": {
                        "title": "Cities",
                        "type": "array",
                        "description": "Filter by city name (case-insensitive, exact match on the directory's city field).",
                        "items": {
                            "type": "string"
                        }
                    },
                    "zipCodes": {
                        "title": "ZIP codes",
                        "type": "array",
                        "description": "Filter by 5-digit ZIP code.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "latitude": {
                        "title": "Latitude (point search)",
                        "type": "string",
                        "description": "Center latitude for a radius search (use with Longitude + Radius). Overrides state/city/zip targeting."
                    },
                    "longitude": {
                        "title": "Longitude (point search)",
                        "type": "string",
                        "description": "Center longitude for a radius search."
                    },
                    "radiusMiles": {
                        "title": "Radius (miles)",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Radius in miles for the point search above.",
                        "default": 50
                    },
                    "searchTerm": {
                        "title": "Search term",
                        "type": "string",
                        "description": "Optional keyword passed to the USDA search (matches listing name / description), e.g. <code>organic</code>, <code>honey</code>."
                    },
                    "productKeywords": {
                        "title": "Product keywords",
                        "type": "array",
                        "description": "Keep only listings whose products / name / description / facilities mention any of these keywords (e.g. <code>eggs</code>, <code>grass-fed</code>, <code>honey</code>, <code>flowers</code>).",
                        "items": {
                            "type": "string"
                        }
                    },
                    "acceptedPaymentContains": {
                        "title": "Accepted payment contains",
                        "type": "string",
                        "description": "Keep only listings whose accepted-payment list contains this text (e.g. <code>credit</code>, <code>check</code>)."
                    },
                    "acceptsSnap": {
                        "title": "Accepts SNAP / EBT only",
                        "type": "boolean",
                        "description": "Only listings that accept SNAP / EBT.",
                        "default": false
                    },
                    "acceptsWic": {
                        "title": "Accepts WIC only",
                        "type": "boolean",
                        "description": "Only listings that accept WIC (incl. WIC Farmers' Market Nutrition Program).",
                        "default": false
                    },
                    "acceptsFmnp": {
                        "title": "Accepts FMNP only",
                        "type": "boolean",
                        "description": "Only listings that accept the Farmers' Market Nutrition Program (FMNP / SFMNP).",
                        "default": false
                    },
                    "organicOnly": {
                        "title": "Organic only",
                        "type": "boolean",
                        "description": "Only listings that report any organic production method.",
                        "default": false
                    },
                    "certifiedOrganicOnly": {
                        "title": "USDA-certified organic only",
                        "type": "boolean",
                        "description": "Only listings that report USDA-certified organic production.",
                        "default": false
                    },
                    "nameContains": {
                        "title": "Name contains",
                        "type": "string",
                        "description": "Keep only listings whose name contains this text."
                    },
                    "hasEmail": {
                        "title": "Has email only",
                        "type": "boolean",
                        "description": "Only output listings with a contact email.",
                        "default": false
                    },
                    "hasPhone": {
                        "title": "Has phone only",
                        "type": "boolean",
                        "description": "Only output listings with a contact phone.",
                        "default": false
                    },
                    "hasWebsite": {
                        "title": "Has website only",
                        "type": "boolean",
                        "description": "Only output listings with a website.",
                        "default": false
                    },
                    "hasAnyContact": {
                        "title": "Has any contact only",
                        "type": "boolean",
                        "description": "Only output listings with at least one of email / phone / website / social link.",
                        "default": false
                    },
                    "updatedAfter": {
                        "title": "Updated after",
                        "type": "string",
                        "description": "Only listings last updated on or after this date (YYYY-MM-DD). Great for freshness / monitoring."
                    },
                    "includeContacts": {
                        "title": "Include contact enrichment",
                        "type": "boolean",
                        "description": "Resolve email, phone, website and social links per listing (recommended — this is what turns a listing into a lead). Turn off for a faster firmographic-only run.",
                        "default": true
                    },
                    "includeFirmographics": {
                        "title": "Include firmographic detail",
                        "type": "boolean",
                        "description": "Include the rich directory fields: products, accepted payments, nutrition programs (SNAP/WIC/FMNP), production methods, season, CSA share details, facilities, etc.",
                        "default": true
                    },
                    "includeRawFields": {
                        "title": "Include raw source fields",
                        "type": "boolean",
                        "description": "Attach the full raw USDA record under <code>sourceFields</code> for each listing.",
                        "default": false
                    },
                    "sortBy": {
                        "title": "Sort by",
                        "enum": [
                            "leadScore",
                            "recent",
                            "name",
                            "state"
                        ],
                        "type": "string",
                        "description": "Order of the output records.",
                        "default": "leadScore"
                    },
                    "maxResults": {
                        "title": "Max results",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of lead records to output.",
                        "default": 1000
                    },
                    "maxSearchCalls": {
                        "title": "Max contact-search calls",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Safety cap on the number of geo searches used for contact enrichment. Higher = more complete contacts on very large (nationwide) runs.",
                        "default": 90
                    },
                    "monitorMode": {
                        "title": "Monitor mode (only new / changed)",
                        "type": "boolean",
                        "description": "Remember listings seen in previous runs (by ID + last-updated date) and output only new or changed ones. Independent of Apify Schedules — schedule this actor and each run returns just the fresh leads.",
                        "default": false
                    },
                    "monitorStateKey": {
                        "title": "Monitor state key",
                        "type": "string",
                        "description": "Namespace for monitor memory. Use different keys for independent monitors (e.g. one per state or per directory).",
                        "default": "default"
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Optional. The USDA portal is reachable directly from Apify; add a proxy only if you hit blocks.",
                        "default": {
                            "useApifyProxy": false
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
