SAM.gov & Grants.gov Scraper: Federal Contracts & Grants API
Pricing
from $1.00 / 1,000 opportunity results
SAM.gov & Grants.gov Scraper: Federal Contracts & Grants API
US government contract opportunities from SAM.gov and federal grants from Grants.gov in one dataset, from their official public APIs. Filter by keyword, agency, NAICS, category and date; only-new mode for daily alerts. SAM.gov needs your own free API key.
Pricing
from $1.00 / 1,000 opportunity results
Rating
0.0
(0)
Developer
Stanislav
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
14 days ago
Last modified
Categories
Security
Limited permissionsShare
SAM.gov & Grants.gov Scraper: Federal Contracts and Grants
Get US government contract opportunities from SAM.gov and federal grant opportunities from Grants.gov in one clean dataset, straight from their official public APIs. Filter by keyword, agency, NAICS code, funding category, status and posted date, and schedule it daily in only-new mode to get alerts for fresh RFPs and grants.
- Who it's for: government contractors and bid teams, grant writers, nonprofits, consultants and GovCon lead lists.
- Source: the Grants.gov Search API (no key needed) and the SAM.gov Get Opportunities Public API (needs your own free SAM.gov API key). No scraping, no login.
- Alerts: only-new mode remembers what you already received.
- Output: JSON, CSV or Excel; pay per opportunity returned (see the Pricing tab).
Quick start (one click)
Open the Actor and press Start: the form is prefilled with this input.
{"keywords": "climate","sources": ["grants.gov"],"postedWithinDays": 30,"stateStoreName": "gov-opps-state","maxItems": 40}
Sample output (one row, more fields in the dataset):
| source | type | id | title | agency |
|---|---|---|---|---|
| grants.gov | grant | L20AS00080 | USDA/USDOI Joint Fire Science Program (JFSP) | Bureau of Land Management |
Use cases
Daily grant alerts for a nonprofit. New and forecasted grants on your topic; only-new mode for a daily schedule.
{"keywords": "climate", "sources": ["grants.gov"], "grantStatuses": ["forecasted", "posted"], "onlyNew": true}
GovCon pipeline by NAICS. Contract opportunities in your NAICS code from the last 14 days (needs your free SAM.gov key).
{"keywords": "software", "sources": ["sam.gov"], "naicsCode": "541511", "postedWithinDays": 14, "samApiKey": "YOUR_SAM_GOV_KEY"}
Both sources in one feed. Contracts and grants for one keyword, one schema.
{"keywords": "cybersecurity", "sources": ["sam.gov", "grants.gov"], "samApiKey": "YOUR_SAM_GOV_KEY", "postedWithinDays": 30}
Funding-trend research. Everything posted in the last 90 days, for analysis.
{"keywords": "artificial intelligence", "sources": ["grants.gov"], "postedWithinDays": 90, "maxItems": 1000}
Features and details of this federal grants API
Get US federal grant opportunities and government contract notices in one clean dataset, straight from the official public APIs of Grants.gov (no key needed) and SAM.gov (your own free API key). Schedule it daily with "only new" mode to get alerts.
Why this Actor
- Official sources only: Grants.gov Search API and the SAM.gov Get Opportunities Public API. No scraping, no proxies, no login.
- Grants and contracts in one output format.
- Filters: keywords, agency codes, funding categories, eligibility, status (forecasted, posted, closed, archived), NAICS (SAM.gov), posted within N days.
- Only new: remembers what it already returned, so daily runs give you just fresh opportunities.
- Fast: about 125 Grants.gov results in ~1 s in our tests.
How to use
- Enter Keywords (e.g.
artificial intelligence,climate,broadband). - Grants.gov works out of the box. For SAM.gov contracts, paste your free personal API key (sam.gov > Account Details > Public API Key).
- Optionally filter by agency (exact Grants.gov codes such as
NSF,HHS-NIH11,DOE-GFO), category, eligibility or NAICS. - Click Start, then export JSON, CSV or Excel, or use the API, Make, Zapier or n8n.
- For alerts, add a daily Schedule with
onlyNew: true.
Pricing
Pay per result: $1.00 per 1,000 opportunities ($0.001 each) plus $0.005 per run start. No subscription.
Errors
If one source fails, the run continues and the error is saved in the ERRORS key-value record.
How to use the federal grants API
- Open the Actor, fill in the input form (or paste the JSON below).
- Click Start. Results land in the dataset as JSON, CSV, Excel or via the Apify API.
- For alerts or regular refreshes, add an Apify Schedule. You can cap spend with "Max charge per run".
Input example
Real input of cloud run LuGO1XWkux67LnrCL (2026-10-22/23):
{"keywords": "wildfire","sources": ["grants.gov"],"grantStatuses": ["posted","forecasted"],"maxItems": 10}
Output example
Real rows from that run (10 results, 3.3 s) (long titles shortened in the table):
| id | title | agency | status | posted | closes |
|---|---|---|---|---|---|
| L20AS00080 | USDA/USDOI Joint Fire Science Program (JFSP) | Bureau of Land Management | forecasted | 2020-03-16 | — |
| G27AS00072 | Cooperative Agreement for Affiliated Partner with the Rocky Mountains | Geological Survey | posted | 2026-10-14 | 2026-11-14 |
| EDA-DISASTER-2023 | FY 2023 Disaster Supplemental | Economic Development Administration | posted | 2023-04-24 | — |
| G27AS00165 | Cooperative Agreement for Affiliated Partner with the Southern Appalac | Geological Survey | posted | 2026-10-01 | 2026-10-30 |
| G27AS00073 | Cooperative Agreement for Affiliated Partner with the Hawaiʻi-Pacific | Geological Survey | posted | 2026-10-14 | 2026-11-14 |
| EDA-DISASTER-2025 | EDA FY25 Disaster Supplemental | Economic Development Administration | posted | 2025-06-04 | — |
One full record:
{"source": "grants.gov","type": "grant","id": "L20AS00080","title": "USDA/USDOI Joint Fire Science Program (JFSP)","agency": "Bureau of Land Management","status": "forecasted","postedDate": "2020-03-16","closeDate": null,"assistanceListings": ["15.232"],"url": "https://www.grants.gov/search-results-detail/325472"}
Dates come as Grants.gov publishes them: some long-running notices keep an old posted date or a far-future close date. Filter with postedWithinDays and grantStatuses.
FAQ
Do I need a SAM.gov API key?
Only for contract notices. Grants.gov works without a key; for SAM.gov you paste your own free key from your sam.gov account.
Why do agency filters need exact codes?
Grants.gov matches sub-agency codes such as HHS-NIH11, not just HHS.
Is this affiliated with the government?
No. It only reads public US government APIs.
How much does it cost?
$1 per 1,000 opportunities plus $0.005 per run.
Are there limits I should know about?
Yes. Results are only as complete and current as the official source. If a source is down, the run logs the error instead of returning made-up data. Report problems in the Issues tab.
Use it from code, AI agents and automations
The same input as the form above works everywhere. Results are the run's dataset (JSON, CSV, Excel). You need an Apify API token (Console → Settings → API & Integrations).
Python (pip install apify-client)
from apify_client import ApifyClientclient = ApifyClient("<YOUR_APIFY_TOKEN>")run = client.actor("stazis/gov-opportunities-api").call(run_input={"keywords": "climate","sources": ["grants.gov"],"postedWithinDays": 30,"maxItems": 40})for item in client.dataset(run.default_dataset_id).iterate_items(): # apify-client < 3: run["defaultDatasetId"]print(item)
JavaScript / TypeScript (npm i apify-client)
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: process.env.APIFY_TOKEN });const run = await client.actor('stazis/gov-opportunities-api').call({"keywords": "climate","sources": ["grants.gov"],"postedWithinDays": 30,"maxItems": 40});const { items } = await client.dataset(run.defaultDatasetId).listItems();
HTTP, one call (waits for the run, up to 5 minutes, and returns the items)
curl -X POST "https://api.apify.com/v2/acts/stazis~gov-opportunities-api/run-sync-get-dataset-items" \-H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \-d '{"keywords": "climate", "sources": ["grants.gov"], "postedWithinDays": 30, "maxItems": 40}'
AI agents (MCP). This Actor runs with limited permissions, so AI agents can use it through the hosted Apify MCP server (Claude, Cursor, VS Code, Codex and other MCP clients). Add this to your MCP client config and sign in with Apify on first use:
{ "mcpServers": { "gov-opportunities-api": { "url": "https://mcp.apify.com?tools=stazis/gov-opportunities-api" } } }
Agents without an Apify account can pay per run in USDC through agi.apify.com (x402). Pricing is pay-per-event, so an agent pays only for the results it gets.
LangChain (pip install langchain-apify, set APIFY_TOKEN): from langchain_apify import ApifyActorsTool and tool = ApifyActorsTool("stazis/gov-opportunities-api") gives your agent this Actor as a tool.
No-code and scheduling: use the Apify app in Make, n8n or Zapier ("Run an Actor", then pick stazis/gov-opportunities-api), or create a Schedule in Apify Console to run it daily and send results to a webhook, Slack or Google Drive through Apify integrations.
Other data APIs by stazis
- Greenhouse, Lever & Ashby Jobs Scraper API: Scrape job postings from company career sites via official Greenhouse, Lever, Ashby, Workable, SmartRecruiters and Recruitee job-board APIs.
- UK Companies House Search API: Bulk Company Data: Search all ~5.
- SEC EDGAR Filings Scraper API: 8-K, 10-K, Full-Text Search: Search SEC EDGAR filings by full text, form type (8-K, 10-K, 10-Q, S-1, Form D), date and state, or list recent filings for any ticker or CIK.
- Bulk WHOIS & RDAP Domain Lookup API: Expiry, DNS: Bulk domain lookup via official RDAP (the WHOIS successor) plus live DNS: registrar, status, created/updated/expiry dates, nameservers, DNSSEC, A/AAAA/MX/NS/TXT records.
- OpenAlex API: Scholarly Paper Search, Citations, Abstracts: Search 250M+ scholarly papers from OpenAlex (CC0): title, DOI, year, venue, open-access link, citation count, authors, institutions, topics and abstract.