๐Ÿฆ– TinyRex Data Toolspractical guides for web data APIs

How to export US federal (SAM.gov) and UK (Contracts Finder) tenders to CSV or JSON

Updated 2026-10-28 ยท Tool used: SAM.gov & UK Contracts Finder Tenders Scraper on Apify ยท Price: $2.50 per 1,000 notices; empty or failed runs and notices skipped as already seen are free

SAM.gov lists every US federal contract opportunity and Contracts Finder lists UK public sector contracts above the publishing thresholds, but both websites are built for browsing one notice at a time, and their search pages don't give you a clean export or alerts with your own filters.

This guide shows how to pull both through their official APIs (SAM.gov Get Opportunities Public API and the Contracts Finder OCDS search under the Open Government Licence) into one table with the same columns: title, buyer, publication and deadline dates, open/closed flag, estimated value and currency, NAICS or CPV code, procedure and notice type, and a direct notice URL.

Open SAM.gov & UK Contracts Finder Tenders Scraper on Apify โ†’

Steps

  1. Pick sources: contracts-finder needs no key; sam.gov needs a free public API key from your SAM.gov Account Details page, pasted into samApiKey.
  2. Add keywords (matched against titles, and UK descriptions), a publishedWithinDays window and maxResults. For SAM.gov you can also filter by samNaicsCode, samState and procurement type; for the UK by stage (planning, tender, award).
  3. Run it and export the dataset as CSV or Excel, or turn on onlyNew with a stateKey and schedule it daily for an alert feed of new notices only.

Example input

{
  "sources": [
    "contracts-finder"
  ],
  "keywords": [
    "software"
  ],
  "publishedWithinDays": 14,
  "maxResults": 50,
  "cfStages": [
    "tender"
  ]
}

Example output (one item, shortened)

{
  "source": "contracts-finder",
  "noticeId": "ocds-b5fd17-eba856aa-b8d6-4d73-b794-8420ea10a3d9",
  "solicitationNumber": "68f9f9f5-5a6f-47df-ae77-6b1aceb3f7ea",
  "title": "CA18543 - Northampton College - Media planning & Buying Services",
  "description": "Northampton College is seeking to appoint an experienced media planning and buying agency...",
  "publicationDate": "2026-10-09",
  "deadlineDate": "2026-11-04",
  "isOpen": true,
  "buyerName": "Northampton College",
  "buyerCountry": "United Kingdom",
  "estimatedValue": 250000,
  "currency": "GBP",
  "noticeUrl": "https://www.contractsfinder.service.gov.uk/Notice/d2301388-4ca6-48fc-805d-eb2e5793377e",
  "documentsUrl": "https://www.contractsfinder.service.gov.uk/Notice/d2301388-4ca6-48fc-805d-eb2e5793377e",
  "cpvOrNaics": "79340000",
  "naicsCode": null,
  "classificationCode": "79340000",
  "procedureType": "Open procedure",
  "noticeType": "tender",
  "setAside": null,
  "placeOfPerformance": null,
  "scrapedAt": "2026-10-10T07:05:00.000Z"
}

Every run's dataset can be downloaded as JSON, CSV, Excel, XML or HTML from the Apify Console, or via https://api.apify.com/v2/datasets/<datasetId>/items?format=csv.

Run it from code

Python

from apify_client import ApifyClient  # pip install apify-client

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run_input = {
  "sources": [
    "contracts-finder"
  ],
  "keywords": [
    "software"
  ],
  "publishedWithinDays": 14,
  "maxResults": 50,
  "cfStages": [
    "tender"
  ]
}
run = client.actor("tinyrex/us-uk-tenders-scraper").call(run_input=run_input)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

JavaScript / Node.js

import { ApifyClient } from 'apify-client'; // npm i apify-client

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('tinyrex/us-uk-tenders-scraper').call({
  "sources": [
    "contracts-finder"
  ],
  "keywords": [
    "software"
  ],
  "publishedWithinDays": 14,
  "maxResults": 50,
  "cfStages": [
    "tender"
  ]
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

curl (no SDK)

# Runs the actor and returns the results directly (CSV here; use format=json for JSON)
curl -X POST "https://api.apify.com/v2/acts/tinyrex~us-uk-tenders-scraper/run-sync-get-dataset-items?format=csv" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"sources": ["contracts-finder"], "keywords": ["software"], "publishedWithinDays": 14, "maxResults": 50, "cfStages": ["tender"]}' > results.csv

Get your API token in Apify Console โ†’ Settings โ†’ API & Integrations. The free Apify plan includes monthly credit that is enough to try this.

Use it from an AI agent (MCP)

The Apify MCP server exposes this actor as a tool for Claude, Cursor, VS Code, n8n and other MCP clients. Add this to your client's MCP config (or use the OAuth flow at mcp.apify.com instead of a token):

{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=tinyrex/us-uk-tenders-scraper",
      "headers": {
        "Authorization": "Bearer <YOUR_APIFY_TOKEN>"
      }
    }
  }
}

Then ask in plain language, e.g. "Sam.gov api export for this list and give me a table".

Pricing

Pay per result: $2.50 per 1,000 notices; empty or failed runs and notices skipped as already seen are free. You can cap the cost of every run in the run options.

FAQ

Is there an API for SAM.gov contract opportunities?

Yes. GSA publishes the Get Opportunities Public API; you need a free public API key from your SAM.gov account. The actor calls that API with your key, so you get the same notices as the website, as clean rows.

Does UK Contracts Finder have an API?

Yes. Contracts Finder offers an OCDS (Open Contracting Data Standard) notice search that needs no key. Its data is published under the Open Government Licence v3.0, which allows commercial reuse with attribution.

How do I get alerts for new government tenders?

Turn on onlyNew, give each saved search its own stateKey and add a daily Schedule. Each run returns only notices it has not returned before, and the skipped ones are free. Send the rows to Google Sheets, email or Slack from the Integrations tab.

What does it cost?

$0.0025 per notice ($2.50 per 1,000). A run that finds nothing, fails, or only sees notices it already returned costs only the tiny start fee.

Try it on Apify โ†’

More guides