# USAspending Loans Scraper (`parseforge/usaspending-loans-scraper`) Actor

Scrapes federal loan records from USAspending.gov by recipient name, awarding agency, or fiscal year. Returns each loan as a flat row with amount, recipient, agency, and program details. Export to CSV, JSON, Excel, or XML.

- **URL**: https://apify.com/parseforge/usaspending-loans-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Business, Lead generation
- **Features:** Limited permissions
- **Stats:** 4 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $19.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

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

### USAspending Loans Scraper

**Scrape federal loan records from USAspending.gov by recipient, agency, or fiscal year, up to a million per run.** Each loan comes with its amount, recipient, agency, and program details. No API key or login. Export to CSV, JSON, Excel, or XML.

USAspending.gov is the official open data source for federal spending, but its website and API are built for browsing, not bulk analysis. This Actor reads the public loan records directly, filtered by recipient name, awarding agency, or fiscal year, and returns each match in one fixed schema.

| Who uses it | What they scrape USAspending.gov for |
|---|---|
| Government contractors | Which agencies are issuing loans to their competitors |
| Financial analysts | The volume and terms of federal credit programs |
| Journalists | Which companies received federal loans in a given year |
| Researchers | Loan-level data for economic studies |
| Nonprofits | Federal loan activity in their sector |

### What it does

This Actor collects federal loan records from USAspending.gov based on recipient name, awarding agency, or fiscal year, and returns each loan as a flat row.

- 🔍 **Recipient search:** filter by a company or individual name keyword.
- 🏛️ **Agency filter:** narrow to a top-level awarding agency.
- 📅 **Fiscal year:** select any year from 2008 to 2030.
- 📊 **Bulk export:** collect up to 1,000,000 loans per run.

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

### What you can do with USAspending.gov data

**📈 Track federal credit programs.**

A financial analyst runs the Actor for a fiscal year and agency to see the total loan volume and top recipients.

**🔎 Investigate loan recipients.**

A journalist searches a company name to find all federal loans awarded to that entity.

**📊 Build a loan database.**

A researcher collects all loans for multiple years and exports them to CSV for statistical analysis.

**🏛️ Monitor agency lending.**

A government contractor filters by agency to see which competitors received loans from that agency.

### Why choose this scraper

| | What you get |
|---|---|
| **No API key** | Reads public USAspending.gov data directly |
| **Fixed schema** | Every loan returns the same flat fields |
| **Bulk collection** | Up to 1,000,000 loans per run |
| **Flexible filters** | Recipient, agency, and fiscal year |

### How it compares

This Actor focuses specifically on federal loans, while the competitors below cover contracts and grants more broadly.

| Feature | ParseForge | USAspending Contracts Intelligence - Federal Data | USAspending Scraper - Federal Contract Data & Grants API | USASpending Scraper - Federal Contracts & Grants Data |
|---|---|---|---|---|
| Loan-specific filtering | Yes | Not listed | Yes | Not listed |
| Recipient name search | Yes | Not listed | Yes | Not listed |
| Agency filter | Yes | Not listed | Yes | Not listed |
| Fiscal year filter | Yes | Not listed | Not listed | Not listed |
| Bulk export up to 1M records | Yes | Not listed | Not listed | Not listed |
| AI opportunity analysis | Not listed | Yes | Not listed | Not listed |

### Configure the run

Drive the Actor with a recipient name keyword, an awarding agency, and a fiscal year, alone or together, and set a maximum number of loans to collect. The Input tab lists every parameter.

A first run with the defaults:

```json
{
 "maxItems": 10
}
```

A larger pull:

```json
{
 "maxItems": 200
}
```

### Pricing

Pay-per-result: **$0.021 per result** collected. You pay only for the results written to your dataset.

| Results collected | Approximate cost |
|---|---|
| 100 results | $2.10 |
| 1,000 results | $21.00 |
| 10,000 results | $210.00 |

New Apify accounts start with $5 in free credit.

### Free users

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

### Run it

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

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

### Use with AI agents (MCP)

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

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/usaspending-loans-scraper"
```

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

### Troubleshooting

**Why am I getting no results?**

Check your filters. The recipientSearch and agency inputs are keyword filters, so try a broader term. Also ensure the fiscalYear is within 2008-2030.

**Why did the run stop before reaching maxItems?**

The Actor stops when there are no more matching loans. Try removing or broadening your filters.

**Why is the run slow?**

Collecting a large number of loans takes time. Reduce maxItems or narrow your filters.

**Why are some fields empty?**

Not all loans have every field populated on USAspending.gov. Empty fields mean the data was not available for that loan.

### FAQ

| Question | Answer |
|---|---|
| Do I need an API key for USAspending.gov? | No. This Actor reads the public data directly from USAspending.gov without requiring an API key or login. |
| What loan data does this Actor return? | It returns federal loan records from USAspending.gov, including recipient name, loan amount, awarding agency, fiscal year, and other fields available in the public data. |
| Can I filter by recipient name? | Yes. Use the recipientSearch input to filter by a keyword in the recipient name. |
| Can I filter by awarding agency? | Yes. Use the agency input to filter by a top-level agency keyword. |
| Can I filter by fiscal year? | Yes. Use the fiscalYear input to select a year from 2008 to 2030. |
| How many loans can I collect in one run? | You can set maxItems up to 1,000,000 loans per run. |
| What export formats are supported? | You can export the results to CSV, JSON, Excel, or XML. |
| Is this an official USAspending.gov API? | No, this is an unofficial scraper that reads the public website data. It is not affiliated with or endorsed by the U.S. government. |
| Does this Actor include grants and contracts? | No, this Actor focuses on federal loans. For grants and contracts, see other USAspending scrapers on Apify. |
| Can I run this Actor on a schedule? | Yes, you can schedule runs on Apify to collect new loan data automatically. |

### Related actors

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

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

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

# Actor input Schema

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

How many loans to collect per run.

## `recipientSearch` (type: `string`):

Filter by recipient name keyword

## `fiscalYear` (type: `integer`):

Fiscal year (2008-2030)

## `agency` (type: `string`):

Top-level agency keyword filter

## Actor input object example

```json
{
  "maxItems": 10
}
```

# Actor output Schema

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

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

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

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/usaspending-loans-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 = { "maxItems": 10 }

# Run the Actor and wait for it to finish
run = client.actor("parseforge/usaspending-loans-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "maxItems": 10
}' |
apify call parseforge/usaspending-loans-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/usaspending-loans-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/IecBuSjyNHF6xMBHt/builds/LuZgFQpaotMVkKZDn/openapi.json
