# SBA 7(a) Rural Loan Leads — Demand (`belcaidsaad/sba-rural-loans`) Actor

Pulls SBA 7(a) loan data, finds rural borrowers, ranks the best leads, and shows where the opportunities are.

- **URL**: https://apify.com/belcaidsaad/sba-rural-loans.md
- **Developed by:** [Saad Belcaid](https://apify.com/belcaidsaad) (community)
- **Categories:** Agents, Automation, Lead generation
- **Stats:** 24 total users, 21 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## 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.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.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/platform/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

## SBA Rural Businesses That Need Financing — Demand Side Leads

Rural businesses that applied for SBA loans but the deal fell through, or just started and need capital. These are businesses that said "I need money" — and haven't found it yet.

**357,866 total SBA loans** in the dataset. The scraper filters to the ones that signal active financing need:

- **CANCELLED loans** — approved then fell through. Borrower still needs the money. Strongest signal.
- **COMMITTED loans** — approved but not yet funded. Deal in progress, may need a different lender.
- **Startups** — new businesses that just got starter capital and will need more.

Not just farmers. Every type of rural business: restaurants, hotels, construction, healthcare, manufacturing, retail, agriculture.

### What You Get Per Record

- **Business name** and **full address**
- **Loan amount** they applied for — tells you the scale of their need
- **Loan status** — CANCLD (deal fell through), COMMIT (in process), or EXEMPT (funded)
- **Industry** — NAICS code + plain English
- **Business age** — startup vs established
- **Bank that was involved** — the lender relationship that didn't work out
- **Rural classification** — USDA county code
- **Opportunity score** — hot / warm / moderate / low
- **Signal** — "500K SBA loan approved 45 days ago but CANCELLED — restaurant in rural Kansas still needs financing"

### How Much Data

| Loan Status | What it means | Volume in dataset |
|---|---|---|
| CANCLD | Loan fell through — still needs money | ~42,000 |
| COMMIT | Loan committed, not yet funded | ~23,000 |
| Startups | New business, will need ongoing capital | ~30,000 |
| **Total demand pool** | | **~95,000 records** |

After rural filter: thousands of leads. You pick how many with `maxResults`.

| Setting | What you get |
|---|---|
| maxResults: 500 | 500 leads, ~90 seconds |
| maxResults: 1000 | 1,000 leads, ~90 seconds |
| maxResults: 2000 | 2,000 leads, ~2 minutes |

### Slice By Industry

Use `naicsFilter`:

| Code | Industry |
|---|---|
| `72` | Hotels, restaurants, food service |
| `23` | Construction |
| `62` | Healthcare clinics |
| `11` | Agriculture, farming |
| `44` | Retail stores |
| `31` | Manufacturing |

### Slice By State

Use `stateFilter`: `"KS,OK,MO,TX"`

### Slice By Loan Status

Use `loanStatusFilter`:
- `CANCLD` — only cancelled loans (strongest demand signal)
- `CANCLD,COMMIT` — cancelled + in-process
- `CANCLD,COMMIT,STARTUP` — all demand signals (default)
- Leave empty — all statuses including already-funded (weaker signal)

### Scoring

| Factor | Points | Logic |
|---|---|---|
| Demand signal | 0-35 | CANCLD = 35, COMMIT = 25, EXEMPT = 5 |
| Recency | 0-35 | <90 days = 35, <180 = 28, <365 = 20 |
| Business age | 0-20 | Startup = 20, New = 15, Change of ownership = 10 |
| Loan size (inverted) | 0-10 | Smaller loans = more likely to need MORE capital |

**Hot** = recent cancelled loan for a new business. They need money NOW.

### Quick Start

1. Click **Start**
2. Wait ~90 seconds
3. Click **Export** → CSV
4. Sort by opportunity_score descending — hottest leads first

### Data Source

Public government data from [SBA.gov](https://data.sba.gov/en/dataset/7-a-504-foia) (357,866 loans) cross-referenced with [USDA Rural-Urban Continuum Codes](https://www.ers.usda.gov/data-products/rural-urban-continuum-codes/) (3,233 US counties). Updated quarterly.

# Actor input Schema

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

How many leads to return.
## `stateFilter` (type: `string`):

Comma-separated state codes to include (e.g., 'KS,NE,IA'). Leave empty for all states.
## `minLoanAmount` (type: `integer`):

Minimum gross loan approval amount in dollars.
## `maxLoanAmount` (type: `integer`):

Maximum gross loan approval amount in dollars.
## `ruralOnly` (type: `boolean`):

Filter to USDA RUCC codes 4-9 (rural counties). Disable for all counties.
## `naicsFilter` (type: `string`):

Filter by NAICS code prefix (e.g., '72' for Accommodation & Food, '23' for Construction). Leave empty for all.
## `loanStatusFilter` (type: `string`):

Comma-separated statuses. CANCLD = loan fell through (strongest demand signal). COMMIT = loan in process. STARTUP = new businesses regardless of status. Leave empty for all statuses.
## `apolloApiKey` (type: `string`):

Adds company size and domain. Free Apollo tier works.

## Actor input object example

```json
{
  "maxResults": 500,
  "minLoanAmount": 50000,
  "maxLoanAmount": 5000000,
  "ruralOnly": true,
  "loanStatusFilter": "CANCLD,COMMIT,STARTUP"
}
````

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("belcaidsaad/sba-rural-loans").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("belcaidsaad/sba-rural-loans").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 '{}' |
apify call belcaidsaad/sba-rural-loans --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=belcaidsaad/sba-rural-loans",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "SBA 7(a) Rural Loan Leads — Demand",
        "description": "Pulls SBA 7(a) loan data, finds rural borrowers, ranks the best leads, and shows where the opportunities are.",
        "version": "1.0",
        "x-build-id": "SzoHpS7UTKHjWJ4ER"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/belcaidsaad~sba-rural-loans/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-belcaidsaad-sba-rural-loans",
                "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/belcaidsaad~sba-rural-loans/runs": {
            "post": {
                "operationId": "runs-sync-belcaidsaad-sba-rural-loans",
                "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/belcaidsaad~sba-rural-loans/run-sync": {
            "post": {
                "operationId": "run-sync-belcaidsaad-sba-rural-loans",
                "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": {
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "How many leads to return.",
                        "default": 500
                    },
                    "stateFilter": {
                        "title": "State Filter",
                        "type": "string",
                        "description": "Comma-separated state codes to include (e.g., 'KS,NE,IA'). Leave empty for all states."
                    },
                    "minLoanAmount": {
                        "title": "Minimum Loan Amount",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Minimum gross loan approval amount in dollars.",
                        "default": 50000
                    },
                    "maxLoanAmount": {
                        "title": "Maximum Loan Amount",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum gross loan approval amount in dollars.",
                        "default": 5000000
                    },
                    "ruralOnly": {
                        "title": "Rural Only",
                        "type": "boolean",
                        "description": "Filter to USDA RUCC codes 4-9 (rural counties). Disable for all counties.",
                        "default": true
                    },
                    "naicsFilter": {
                        "title": "NAICS Code Filter",
                        "type": "string",
                        "description": "Filter by NAICS code prefix (e.g., '72' for Accommodation & Food, '23' for Construction). Leave empty for all."
                    },
                    "loanStatusFilter": {
                        "title": "Loan Status Filter",
                        "type": "string",
                        "description": "Comma-separated statuses. CANCLD = loan fell through (strongest demand signal). COMMIT = loan in process. STARTUP = new businesses regardless of status. Leave empty for all statuses.",
                        "default": "CANCLD,COMMIT,STARTUP"
                    },
                    "apolloApiKey": {
                        "title": "Apollo API Key (optional)",
                        "type": "string",
                        "description": "Adds company size and domain. Free Apollo tier works."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
