# Federal Procurement Suppliers Scraper (`datapilot/federal-procurement-suppliers-scraper`) Actor

extract supplier names, IDs, contract counts, source links, and discovery timestamps. Export results to Apify Dataset in JSON format.Search and analyze recent U.S. government contract awards by keyword and date range. Group awards by supplie

- **URL**: https://apify.com/datapilot/federal-procurement-suppliers-scraper.md
- **Developed by:** [Data Pilot](https://apify.com/datapilot) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 91.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 scraped usaspending supplier records

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

🏛️ **Federal Procurement Suppliers Scraper** is a powerful Apify Actor designed to discover and group the companies winning US federal contracts, using official award data from USAspending.gov. This tool provides comprehensive **Federal Procurement Suppliers** intelligence including supplier name, supplier ID (UEI), number of contract awards, and a direct link to each supplier's profile. Whether you're building a B2B lead list, researching competitors, or mapping government contractors in your industry, the Federal Procurement Suppliers Scraper delivers actionable insights efficiently.

With keyword filtering, configurable date windows, automatic pagination, supplier-level grouping, and reliable Apify Dataset delivery, this **Federal Procurement Suppliers** actor turns raw contract awards into a ranked list of suppliers. It focuses on key signals including contract count and supplier identity, making **Federal Procurement Suppliers** research fast and structured.

***

### 📋 Table of Contents

- [Features](#-features)
- [Data Source](#-data-source)
- [How It Works](#-how-it-works)
- [Input](#-input)
- [Output](#-output)
- [Technical Stack](#-technical-stack)
- [Data Fields](#-data-fields-explained)
- [Use Cases](#-use-cases)
- [Quick Start](#-quick-start)
- [Configuration](#-configuration)
- [Performance](#-performance)
- [Important Notes](#-important-notes)
- [License & Legal](#-license--legal)

***

### 🔥 Features

- **Federal Contract Award Search** – Pulls US federal contract awards from the official USAspending.gov API. This is the core of **Federal Procurement Suppliers** discovery.
- **Keyword Filtering** – Optionally narrow awards by keyword, or leave it empty to search all contract awards.
- **Configurable Date Window** – Look back any number of days from today with the `days` setting.
- **Supplier Grouping** – Combines many awards into one record per supplier, using UEI, recipient ID, or name as the key.
- **Contract Count Ranking** – Suppliers are sorted by number of contract awards, highest first.
- **Direct Profile Links** – Each supplier includes a USAspending.gov link (recipient page, award page, or search page as fallback).
- **Automatic Pagination** – Fetches awards page by page (100 per page) until your `maxAwards` target is reached or results run out.
- **Retry Handling** – Retries failed requests up to 3 times with increasing wait between attempts.
- **Apify Proxy Support** – Optional Apify Proxy for reliable **Federal Procurement Suppliers** access.
- **Proxy Fallback Handling** – Automatically retries without a proxy if a proxied request fails with an error.
- **Single-Batch Dataset Push** – Pushes all supplier records to the Apify Dataset together once grouping completes.
- **Detailed Logging** – Logs proxy status, search settings, pagination progress, and completion for every **Federal Procurement Suppliers** run.

***

### 📊 Data Source

#### **USAspending.gov — Spending by Award API**

- **Authority**: USAspending.gov, the official open data source for US federal spending
- **Endpoint**: `https://api.usaspending.gov/api/v2/search/spending_by_award/`
- **Access Method**: Browser-impersonated HTTP POST requests via `curl_cffi` (Chrome 124 fingerprint), parsing the JSON response
- **Coverage**: US federal contract awards (award type codes A, B, C, and D)
- **Data**: Award ID, recipient name, recipient UEI, award amount, and internal IDs used to build profile links
- **Access**: Public API, no API key required
- **Update Frequency**: Reflects the API's data at time of run

***

### ⚙️ How It Works

The Federal Procurement Suppliers Scraper accepts an optional keyword, a number of days to look back, and a maximum number of awards. It requests contract awards from USAspending.gov sorted by award amount (largest first), paging through results until the target is reached. The awards are then grouped by supplier, counted, ranked, and pushed to the Apify Dataset as one batch.

**Key Processing Steps:**

1. **Input Parsing** – Read `keyword`, `days`, and `maxAwards` with safe defaults
2. **Proxy Setup** – Configure Apify Proxy if enabled, with automatic direct-connection fallback
3. **Date Range** – Build a time window from `days` ago to today
4. **Award Request** – POST a filtered search for contract awards, 100 per page, sorted by award amount descending
5. **Pagination** – Continue to the next page while more results exist and `maxAwards` is not yet reached
6. **Trimming** – Keep only the first `maxAwards` awards
7. **Supplier Grouping** – Group awards by UEI (or recipient ID, or name) and count contracts per supplier
8. **Ranking** – Sort suppliers by contract count, highest first
9. **Dataset Push** – Push the full batch of **Federal Procurement Suppliers** records at once
10. **Summary Logging** – Report how many awards were grouped into how many suppliers

**Key Benefits:**

- Build lists of active federal contractors without manual searching
- Filter by industry keyword and time window in one run
- Get one clean record per supplier instead of thousands of raw awards
- Automate recurring **Federal Procurement Suppliers** research as new awards are published

***

### 📥 Input

The Actor accepts the following input parameters:

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `keyword` | string | `""` (all awards) | Keyword to filter contract awards. Leave empty to search all. |
| `days` | integer | `90` | How many days back from today to search. |
| `maxAwards` | integer | `100` | Maximum number of contract awards to fetch before grouping. |
| `proxyConfiguration` | object | `{"useApifyProxy": true}` | Apify Proxy configuration. |

**Example Input:**

```json
{
  "keyword": "cybersecurity",
  "days": 90,
  "maxAwards": 100
}
```

**Search All Awards in the Last 30 Days:**

```json
{
  "days": 30,
  "maxAwards": 200
}
```

**Run Without Proxy:**

```json
{
  "keyword": "construction",
  "days": 180,
  "maxAwards": 300,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

***

### 📤 Output

The Actor pushes **Federal Procurement Suppliers** records with the following structure:

| Field | Type | Description |
|-------|------|-------------|
| `supplier_id` | string | Supplier UEI, or recipient ID if UEI is missing, or `"N/A"` |
| `name` | string | Supplier name, or `"Unknown Contractor"` if unavailable |
| `contracts` | integer | Number of fetched contract awards belonging to this supplier |
| `link` | string | USAspending.gov link to the supplier's profile, an award page, or the search page |
| `first_seen_at` | string | ISO 8601 UTC timestamp of when the record was collected |

**Example Federal Procurement Suppliers Record:**

```json
{
  "supplier_id": "ABCD1234EFGH",
  "name": "EXAMPLE DEFENSE SYSTEMS LLC",
  "contracts": 7,
  "link": "https://www.usaspending.gov/recipient/abc123-def456-C/latest",
  "first_seen_at": "2026-10-30T09:00:00Z"
}
```

***

### 🧰 Technical Stack

- **HTTP Client:** `curl_cffi` with Chrome 124 TLS fingerprint impersonation
- **Source:** USAspending.gov `spending_by_award` JSON API
- **Grouping:** Python `OrderedDict` keyed by UEI, recipient ID, or name
- **Date Handling:** `datetime` with timezone-aware UTC timestamps
- **Async:** `asyncio` with executor-run blocking requests and a short delay between pages
- **Proxy:** Apify Proxy, optional via `useApifyProxy`, with automatic no-proxy fallback on failure
- **Logging:** Apify Actor logging system
- **Platform:** Apify Actor serverless environment

***

### 📊 Data Fields Explained

#### **Supplier Identity**

- **supplier_id / name**: The supplier's UEI (or fallback ID) and its name

#### **Activity**

- **contracts**: How many of the fetched awards belong to this supplier

#### **Links & Metadata**

- **link**: Where to view the supplier or award on USAspending.gov
- **first_seen_at**: UTC timestamp of collection

***

### 🎯 Use Cases

- **B2B Lead Generation** – Build lists of companies that actively win federal contracts
- **Competitor Research** – See which suppliers are winning awards in your niche
- **Market Mapping** – Identify the main contractors for a technology, product, or service keyword
- **Subcontracting & Partnership Outreach** – Find prime contractors to approach
- **Sales Prioritization** – Rank suppliers by number of recent awards
- **Federal Contracting Research** – Study supplier activity over a chosen time window

***

### 🚀 Quick Start

#### **1. Prepare Input**

Go to Apify Console and enter:

```json
{
  "keyword": "cybersecurity",
  "days": 90,
  "maxAwards": 100
}
```

#### **2. Run the Actor**

Click **Start**. The Actor will:

- Connect through Apify Proxy if enabled
- Fetch contract awards from USAspending.gov page by page
- Group awards by supplier and count contracts
- Push all results to the Dataset as one batch

#### **3. Monitor Progress**

Console shows:

```
🛡️ Apify Proxy connected.
Fetching awards from last 90 days (Keyword: 'cybersecurity', Max Awards: 100)...
Fetched 100 contract awards so far (Page 1).
✅ Grouped 100 contract awards into 62 suppliers & pushed to dataset!
🎉 Complete!
```

#### **4. View & Download Results**

- **Results Tab**: All **Federal Procurement Suppliers** records
- **Export**: JSON, CSV, Excel, or HTML
- **Sort / Filter**: By contract count or supplier name
- **API Access**: Available via the Apify API

***

### ⚙️ Configuration

Default run (all awards, last 90 days):

```json
{
  "days": 90,
  "maxAwards": 100
}
```

Keyword-focused run:

```json
{
  "keyword": "janitorial services",
  "days": 365,
  "maxAwards": 500
}
```

Direct connection without proxy:

```json
{
  "keyword": "software",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

***

### 📈 Performance

#### **Processing Speed**

- 100 awards fetched per request, with a 0.3 second pause between pages
- Each request has up to 3 attempts, with a longer wait after each failure
- Fetching stops as soon as `maxAwards` is reached or no more pages exist

#### **Resource Usage**

- Memory: Low, since no browser instance is launched
- Network: One lightweight request per 100 awards
- Proxy: Optional Apify Proxy with automatic no-proxy fallback on failure

***

### ⚠️ Important Notes

#### **Legal & Compliance**

- **Fair Use**: Uses sequential requests with a short delay between pages to keep load on the source minimal
- **Public Data Only**: Retrieves only publicly available federal award data from USAspending.gov
- **Legal**: Not legal advice — consult qualified professionals before using this data for compliance-sensitive decisions

#### **Data Quality**

- **Contract Counts Are Sample-Based**: `contracts` counts only the awards fetched in this run, not a supplier's total contract history. Awards are fetched in order of award amount, largest first, up to `maxAwards`, so smaller awards may not be included.
- **Time Window**: Only awards within the last `days` days are considered
- **Award Types**: Only contract award types (codes A, B, C, D) are included
- **Fallback Values**: Missing names become `"Unknown Contractor"`, and missing IDs become `"N/A"`
- **Freshness**: Reflects the API's data at time of run

#### **Best Practices**

- Use a clear keyword for focused **Federal Procurement Suppliers** results, or leave it empty for a broad scan
- Increase `maxAwards` for more complete supplier counts
- Use a shorter `days` window for recent activity only
- Run on a schedule to track new suppliers over time
- Verify important supplier details on USAspending.gov before outreach or reporting

***

### 📄 License & Legal

**Terms of Use:**

- Use for legitimate research, lead generation, and market analysis purposes
- Respect the terms of service of USAspending.gov
- Do not use for spam, harassment, or unlawful data collection
- Use data responsibly and in compliance with applicable laws

**Disclaimer:**
Federal Procurement Suppliers Scraper is provided as-is for research purposes. Users are responsible for compliance with all applicable laws and the terms of service of the data source. This is not legal advice.

***

### ⚖️ Federal Procurement Suppliers Excellence

This Actor is optimized for **Federal Procurement Suppliers** research with:

- ✅ Official USAspending.gov contract award data
- ✅ Keyword and date-window filtering
- ✅ One ranked record per supplier
- ✅ Automatic pagination with retry handling
- ✅ Proxy fallback for reliable access
- ✅ Production-ready code

# Actor input Schema

## `keyword` (type: `string`):

Contract keyword, e.g. 'software', 'cybersecurity', 'cloud'. Leave blank for all recent contracts.

## `days` (type: `integer`):

Number of days back to search from today.

## `maxAwards` (type: `integer`):

Maximum number of contract awards to sample.

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

Apify Proxy configuration.

## Actor input object example

```json
{
  "keyword": "software",
  "days": 90,
  "maxAwards": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `crawlResults` (type: `string`):

No description

## `suppliersOverview` (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 = {
    "keyword": "software",
    "days": 90,
    "maxAwards": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("datapilot/federal-procurement-suppliers-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 = {
    "keyword": "software",
    "days": 90,
    "maxAwards": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("datapilot/federal-procurement-suppliers-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 '{
  "keyword": "software",
  "days": 90,
  "maxAwards": 100
}' |
apify call datapilot/federal-procurement-suppliers-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datapilot/federal-procurement-suppliers-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/vZla8N2nrot6SS4Fy/builds/o1H3ugneio5TZx3ea/openapi.json
