# USAspending Scraper (`anyxsolutions/usaspending-scraper`) Actor

Scrape US federal spending from USAspending.gov: contracts, grants, loans and direct payments by keyword, agency, recipient, state and date, with amounts, outlays, recipients, agencies, NAICS, PSC or assistance listings and links. Official data since FY2008. No API key, no login.

- **URL**: https://apify.com/anyxsolutions/usaspending-scraper.md
- **Developed by:** [Anyx Solutions](https://apify.com/anyxsolutions) (community)
- **Categories:** Business, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 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

![banner](https://anyx.solutions/banners/usaspending-scraper.png)

## USAspending Scraper

**Every US federal contract, grant, loan and direct payment on USAspending.gov — searchable by keyword, agency, recipient, state and date — as clean JSON.**

USAspending.gov is the official source of US federal spending data: every contract, contract vehicle,
grant, loan and direct payment the government awards, with who received it, which agency paid,
how much, and where the work happens. This Actor scrapes USAspending awards by keyword, award type,
awarding agency, recipient, place of performance and date, or straight from USAspending award and
recipient pages. Each award comes back with its award ID, amount obligated and outlays (or face value
and subsidy cost for loans), recipient name, UEI and location, awarding and funding agency and
sub-agency, start and end dates, place of performance, NAICS and PSC codes for contracts, assistance
listings (CFDA) for grants, and disaster-funding codes. Optionally add the full award record:
competition and pricing, options value, subawards, parent contract, offices and the funding opportunity.
Scrape federal spending data with no API key, no login and no proxy. Built for government-contracting
business development, competitive intelligence, grant research, journalists and watchdogs, and
anyone tracking where public money goes.

### ⚡ Quick start

```json
{
  "startUrls": [
    {
      "url": "https://www.usaspending.gov/recipient/ea75ddee-2d00-ac7f-5e72-6f42d7c88c8c-C/latest"
    }
  ],
  "searchTerms": ["cybersecurity"],
  "maxItems": 5
}
```

### 🧩 Input

| Field                | Type    | Required | Default                      | Description                                                                                                                                                                                                                                                             |
| -------------------- | ------- | -------- | ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `startUrls`          | array   | no       | —                            | USAspending pages: an award page (`https://www.usaspending.gov/award/CONT_AWD_…`) or a recipient page (`https://www.usaspending.gov/recipient/<id>/latest`), which returns that recipient's awards. A recipient page for one fiscal year (`…/2025`) keeps to that year. |
| `searchTerms`        | array   | no       | —                            | Keywords to find in award descriptions, recipients and programs, one search per line, at least 3 characters each, such as `cybersecurity` or `broadband`.                                                                                                               |
| `awardTypes`         | array   | no       | —                            | Only return these kinds of award: `contracts`, `idvs` (contract vehicles), `grants`, `loans`, `directPayments` or `other`. Leave empty for every kind.                                                                                                                  |
| `agencies`           | array   | no       | —                            | Only return awards made by these agencies, by name or abbreviation, such as `Department of Defense`, `DOD`, `NASA` or `HHS`.                                                                                                                                            |
| `recipients`         | array   | no       | —                            | Only return awards to these recipients, by name, UEI or DUNS number. A parent company's UEI also matches its subsidiaries.                                                                                                                                              |
| `states`             | array   | no       | —                            | Only return awards performed in these US states or territories, as two-letter codes such as `CA`, `TX` or `DC`.                                                                                                                                                         |
| `dateFrom`           | string  | no       | —                            | Only return awards with spending on or after this date (`YYYY-MM-DD`). Award search starts at fiscal year 2008.                                                                                                                                                         |
| `dateTo`             | string  | no       | —                            | Only return awards with spending on or before this date (`YYYY-MM-DD`).                                                                                                                                                                                                 |
| `sortBy`             | string  | no       | `amount`                     | `amount` for the largest awards first (loans by face value), or `newest` for the most recently awarded first.                                                                                                                                                           |
| `includeDetails`     | boolean | no       | `false`                      | Add the full award record to every row. Adds one request per award. Award pages always include it.                                                                                                                                                                      |
| `maxItems`           | integer | no       | —                            | Maximum number of awards per URL or search term. The input form starts at 5; leave it empty for every matching award.                                                                                                                                                   |
| `proxyConfiguration` | object  | no       | `{ "useApifyProxy": false }` | Proxy settings. USAspending needs no proxy.                                                                                                                                                                                                                             |

Add award pages, recipient pages, search terms, or any mix. The filters (award types, agencies,
recipients, states and dates) narrow every search term and recipient page. With no search terms and
no URLs, the filters run as one search of their own: for example, NASA's largest grants in fiscal year 2025. Award types are searched one after another in the order above, each sorted by `sortBy`, until
`maxItems` is reached.

USAspending's advanced-search page keeps its filters out of the address bar, so its URLs cannot be
pasted here: set the same filters in the input instead.

### 📤 Output

Each award is one dataset row, marked by `source`: `search` for a search-term or filter match,
`recipient` for an award found from a recipient page, `award` for an award page. Every row links to the
award's USAspending page and the recipient's profile. Amounts are in US dollars.

#### Fields

| Field                       | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| --------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `source`                    | string | `search`, `recipient` or `award`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `searchQuery`               | string | The search term that matched the award. `null` for recipient and award pages and filter-only searches.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `awardId`                   | string | The award's own ID: the contract number (PIID) or the assistance award number (FAIN or URI).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `generatedId`               | string | USAspending's unique award key, as in the award page URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `url`                       | string | The award's page on usaspending.gov.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `awardCategory`             | string | `contract`, `idv`, `grant`, `loan`, `direct payment` or `other`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `awardType`                 | string | Specific type, such as `DELIVERY ORDER`, `DEFINITIVE CONTRACT`, `PROJECT GRANT (B)` or `DIRECT LOAN (E)`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `description`               | string | The award description.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `recipientName`             | string | Recipient name.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `recipientUei`              | string | Recipient's Unique Entity Identifier (SAM.gov).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `recipientDuns`             | string | Recipient's DUNS number, on awards from before the switch to UEI.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `recipientId`               | string | USAspending's recipient key, as in the recipient page URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `recipientUrl`              | string | The recipient's profile on usaspending.gov.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `awardAmount`               | number | Total amount obligated. `null` for loans.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `totalOutlays`              | number | Total amount actually paid out so far.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `loanValue`                 | number | Face value of a loan. `null` for other awards.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `subsidyCost`               | number | Estimated cost of a loan to the government. `null` for other awards.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `awardingAgency`            | string | Agency that made the award, such as `Department of Defense`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `awardingSubAgency`         | string | Sub-agency that made the award, such as `Department of the Air Force`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `fundingAgency`             | string | Agency whose money pays for the award.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `fundingSubAgency`          | string | Sub-agency whose money pays for the award.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `startDate`                 | string | Start of the period of performance (`YYYY-MM-DD`); a loan's issue date.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `endDate`                   | string | End of the current period of performance. `null` for IDVs and loans.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `lastDateToOrder`           | string | Last date orders can be placed against an IDV. `null` for other awards.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `baseObligationDate`        | string | Date the award was first obligated (signed).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `lastModifiedDate`          | string | Date the award was last modified.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `placeOfPerformance`        | object | Where the work happens: `city`, `county`, `state`, `stateName`, `zip`, `country`, `countryName` and `congressionalDistrict`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `recipientLocation`         | object | The recipient's address: `address` plus the same fields as `placeOfPerformance`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `naicsCode`                 | string | Industry code (NAICS) of a contract.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `naicsDescription`          | string | Industry description.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `pscCode`                   | string | Product or service code (PSC) of a contract.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `pscDescription`            | string | Product or service description.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `cfdaNumber`                | string | Main assistance listing (CFDA) number of a grant, loan or payment, such as `93.243`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `assistanceListings`        | array  | Every assistance listing on the award, each with `number` and `title`. Empty for contracts.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `defCodes`                  | array  | Disaster emergency fund codes of the money spent on the award (COVID-19 and infrastructure laws among them).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `covid19Obligations`        | number | Amount obligated from COVID-19 relief funds. `null` for award pages.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `infrastructureObligations` | number | Amount obligated from Infrastructure Investment and Jobs Act funds. `null` for award pages.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `details`                   | object | With `includeDetails` and on award pages: `awardTypeCode`, `dateSigned`, `potentialEndDate`, `totalObligation`, `baseExercisedOptions`, `baseAndAllOptions`, `totalFunding`, `nonFederalFunding`, `subawardCount`, `totalSubawardAmount`, `awardingOffice`, `fundingOffice`, `parentAwardId` and `parentAwardUrl` (the contract vehicle an order sits under), `parentRecipientName`, `parentRecipientUei`, `businessCategories`, contract competition (`extentCompeted`, `solicitationProcedures`, `numberOfOffers`, `setAside`, `contractPricing`), the grant's `fundingOpportunityNumber` and `fundingOpportunityGoals` (plain text), `programs` (each assistance listing's `number`, `title`, `popularName`, `objectives` and `url`) and `executives` (the recipient's top-paid officers, when reported). `null` when off. |

<details><summary>Example output</summary>

```json
{
  "source": "search",
  "searchQuery": "cybersecurity",
  "awardId": "FA862118F6251",
  "generatedId": "CONT_AWD_FA862118F6251_9700_FA862115D6276_9700",
  "url": "https://www.usaspending.gov/award/CONT_AWD_FA862118F6251_9700_FA862115D6276_9700",
  "awardCategory": "contract",
  "awardType": "DELIVERY ORDER",
  "description": "IGF::OT::IGF AFSOC ACTS AWARD OF CONTRACT FOR CLS, ENGINEERING, INSTRUCTION, CYBERSECURITY, DMO",
  "recipientName": "LOCKHEED MARTIN CORPORATION",
  "recipientUei": "KDT2YLB34NT6",
  "recipientDuns": null,
  "recipientId": "ea75ddee-2d00-ac7f-5e72-6f42d7c88c8c-C",
  "recipientUrl": "https://www.usaspending.gov/recipient/ea75ddee-2d00-ac7f-5e72-6f42d7c88c8c-C/latest",
  "awardAmount": 666315748.84,
  "totalOutlays": 242708.65,
  "loanValue": null,
  "subsidyCost": null,
  "awardingAgency": "Department of Defense",
  "awardingSubAgency": "Department of the Air Force",
  "fundingAgency": "Department of Defense",
  "fundingSubAgency": "Department of the Air Force",
  "startDate": "2018-02-08",
  "endDate": "2027-01-31",
  "lastDateToOrder": null,
  "baseObligationDate": "2018-02-08",
  "lastModifiedDate": "2026-06-15",
  "placeOfPerformance": {
    "city": "ORLANDO",
    "county": "ORANGE",
    "state": "FL",
    "stateName": "Florida",
    "zip": "32825",
    "country": "USA",
    "countryName": "UNITED STATES",
    "congressionalDistrict": "10"
  },
  "recipientLocation": {
    "address": "100 GLOBAL INNOVATION CIR",
    "city": "ORLANDO",
    "county": "ORANGE",
    "state": "FL",
    "stateName": "Florida",
    "zip": "32825",
    "country": "USA",
    "countryName": "UNITED STATES",
    "congressionalDistrict": "10"
  },
  "naicsCode": "336413",
  "naicsDescription": "OTHER AIRCRAFT PARTS AND AUXILIARY EQUIPMENT MANUFACTURING",
  "pscCode": "J069",
  "pscDescription": "MAINT/REPAIR/REBUILD OF EQUIPMENT- TRAINING AIDS AND DEVICES",
  "cfdaNumber": null,
  "assistanceListings": [],
  "defCodes": ["E", "N", "Q"],
  "covid19Obligations": 3037759.42,
  "infrastructureObligations": 0,
  "details": {
    "awardTypeCode": "C",
    "dateSigned": "2018-02-08",
    "potentialEndDate": "2027-01-31",
    "totalObligation": 666315748.84,
    "baseExercisedOptions": 703067712.09,
    "baseAndAllOptions": 731294259.09,
    "totalFunding": null,
    "nonFederalFunding": null,
    "subawardCount": 477,
    "totalSubawardAmount": 516550094.41,
    "awardingOffice": "FA8621 AFLCMC WNSK SIMS",
    "fundingOffice": "F4FDAY AFLCMC WNS",
    "parentAwardId": "FA862115D6276",
    "parentAwardUrl": "https://www.usaspending.gov/award/CONT_IDV_FA862115D6276_9700",
    "parentRecipientName": "LOCKHEED MARTIN CORP",
    "parentRecipientUei": "ZFN2JJXBLZT3",
    "businessCategories": [
      "Category Business",
      "Corporate Entity Not Tax Exempt",
      "Manufacturer of Goods",
      "Not Designated a Small Business",
      "Special Designations",
      "U.S.-Owned Business"
    ],
    "extentCompeted": "FULL AND OPEN COMPETITION",
    "solicitationProcedures": "SUBJECT TO MULTIPLE AWARD FAIR OPPORTUNITY",
    "numberOfOffers": 4,
    "setAside": null,
    "contractPricing": "FIRM FIXED PRICE",
    "fundingOpportunityNumber": null,
    "fundingOpportunityGoals": null,
    "programs": [],
    "executives": []
  }
}
```

</details>

### 💡 Use cases

- **Government contracting business development** — find the largest contracts and contract vehicles in your NAICS or PSC area, who holds them and when they end, to plan recompetes.
- **Competitive intelligence** — pull every award a competitor or partner has won, subsidiaries included, with agencies, amounts and competition details.
- **Grant research** — see which organisations win which grants from which programs, in your state or field.
- **Journalism and accountability** — trace where federal money goes by agency, recipient, place or keyword, including COVID-19 and infrastructure funds.
- **Market sizing** — total federal spending on a topic, agency or region over time.

### ❓ FAQ

- **Do I need an API key or an account?** No. USAspending is public government data.
- **Do I need a proxy?** No. It runs without one by default.
- **How far back does it go?** Searches cover fiscal year 2008 (October 2007) onwards. Award pages work for any award USAspending has.
- **What does the date filter match?** Awards with spending activity (an obligation or modification) inside the window, so a long-running contract signed years ago still appears when it was funded in the window.
- **Why are some fields empty?** Each award type publishes different data: contracts have NAICS and PSC codes, grants and loans have assistance listings, loans have a face value instead of an obligation, and recipients have a UEI or, on older awards, a DUNS number.
- **Can I paste a USAspending search URL?** No. The site keeps its search filters out of the address bar. Set the same filters in the input, or paste award and recipient pages.
- **Why did a run return fewer awards than expected?** An agency name may not be recognised (use its full name or abbreviation; the log names any it could not match), or the filters may be narrower than you think. Open an issue if something looks off.

### 🔗 More scrapers by Anyx

- [SEC EDGAR Scraper](https://apify.com/anyxsolutions/sec-edgar-scraper)
- [Google Search Scraper](https://apify.com/anyxsolutions/google-search-scraper)
- [Web Content Scraper](https://apify.com/anyxsolutions/web-content-scraper)
- [Google News Scraper](https://apify.com/anyxsolutions/google-news-scraper)

### 🤝 Anyx Solutions

We build custom scrapers and data-extraction pipelines.

- Email: tantosthor@gmail.com

### 🖼 Image credit

Image credit: [usaspending.gov](https://www.usaspending.gov/)

# Actor input Schema

## `startUrls` (type: `array`):

Public USAspending pages: an award page (https://www.usaspending.gov/award/CONT_AWD_FA862118F6251_9700_FA862115D6276_9700) or a recipient page (https://www.usaspending.gov/recipient/ea75ddee-2d00-ac7f-5e72-6f42d7c88c8c-C/latest), which returns that recipient's awards. Advanced-search URLs are not supported; use the filters below instead.

## `searchTerms` (type: `array`):

Keywords to find in award descriptions, recipients and programs, one search per line, at least 3 characters each, for example cybersecurity, broadband or wildfire.

## `awardTypes` (type: `array`):

Only return these kinds of award: contracts, contract vehicles (IDVs), grants, loans, direct payments or other financial assistance. Leave empty for every kind; they are searched in that order.

## `agencies` (type: `array`):

Only return awards made by these federal agencies, one per line, by name or abbreviation, for example Department of Defense, DOD, NASA or HHS.

## `recipients` (type: `array`):

Only return awards to these recipients, one per line, by name, UEI or DUNS number, for example Lockheed Martin or KDT2YLB34NT6. A parent company's UEI also matches its subsidiaries.

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

Only return awards performed in these US states or territories, as two-letter codes, one per line, for example CA, TX or DC.

## `dateFrom` (type: `string`):

Only return awards with spending on or after this date, for example 2024-10-01. Award search starts at fiscal year 2008 (2007-10-01).

## `dateTo` (type: `string`):

Only return awards with spending on or before this date, for example 2025-09-30.

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

Order of awards within each award type: largest amount first (loans by face value), or most recently awarded first.

## `includeDetails` (type: `boolean`):

Add the full award record to every row: competition and pricing, options value, subawards, parent contract, offices, business categories, programs and funding opportunity. Adds one request per award. Award pages always include it.

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

Maximum number of awards to return per URL or search term. Leave empty for every matching award.

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

Proxy settings. USAspending is public government data and needs no proxy.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.usaspending.gov/recipient/ea75ddee-2d00-ac7f-5e72-6f42d7c88c8c-C/latest"
    }
  ],
  "searchTerms": [
    "cybersecurity"
  ],
  "sortBy": "amount",
  "includeDetails": false,
  "maxItems": 5,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "startUrls": [
        {
            "url": "https://www.usaspending.gov/recipient/ea75ddee-2d00-ac7f-5e72-6f42d7c88c8c-C/latest"
        }
    ],
    "searchTerms": [
        "cybersecurity"
    ],
    "maxItems": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("anyxsolutions/usaspending-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 = {
    "startUrls": [{ "url": "https://www.usaspending.gov/recipient/ea75ddee-2d00-ac7f-5e72-6f42d7c88c8c-C/latest" }],
    "searchTerms": ["cybersecurity"],
    "maxItems": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("anyxsolutions/usaspending-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 '{
  "startUrls": [
    {
      "url": "https://www.usaspending.gov/recipient/ea75ddee-2d00-ac7f-5e72-6f42d7c88c8c-C/latest"
    }
  ],
  "searchTerms": [
    "cybersecurity"
  ],
  "maxItems": 5
}' |
apify call anyxsolutions/usaspending-scraper --silent --output-dataset

```

## MCP server setup

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