SAM.gov API Guide: Complete Developer Tutorial

Everything you need to know to integrate with SAM.gov's API for federal contract opportunities: registration, authentication, rate limits, and working code examples.

Quick Reference: SAM.gov provides free API access to federal contract opportunities. Public access allows 10 requests/day; registered entities get 1,000/day. Plan for 1-4 weeks total for registration and API access approval.
Need Decision Maker Contacts?

Found opportunities on SAM.gov? Get verified contact info for agency contracting officers and program managers. Try GovCon Contacts →

What is SAM.gov?

The System for Award Management (SAM.gov) is the official U.S. government registry for entities doing business with the federal government. It consolidates multiple systems and provides APIs for accessing federal contracting opportunities.

SAM.gov provides access to:

SAM.gov API Registration Process

API Key Required (Basic Account - Instant)

Create free SAM.gov account → Generate key → 10 requests/day:

curl "https://api.sam.gov/prod/opportunities/v2/search?api_key=your_sam_key&limit=1&postedFrom=01/01/2026&postedTo=01/28/2026"

Entity Registration for 1,000/day (~2-3 weeks)

Time Required: Up to 10 business days + role approval

Step 2: API Access Request

Time Required: Additional 1-2 weeks

Tip: Be specific in your justification. Explain your use case clearly (e.g., "Building internal tool to monitor contract opportunities in NAICS 541511").

SAM.gov API Rate Limits

Rate Limits by Access Level

Access Level Requests Per Day How to Get It
Public (no auth) 10 No registration required
Entity User 1,000 Complete entity registration
Federal System User 10,000 Government .gov/.mil email + system account

Note: The 1,000/day limit works for most small-scale applications. For high-volume needs, consider caching responses or using bulk data downloads.

API Data Coverage

What the API Returns

What Requires Additional Steps

Code Example: SAM.gov API

import requests import json # SAM.gov API endpoint SAM_API_URL = "https://api.sam.gov/prod/opportunities/v2/search" API_KEY = "your_sam_gov_api_key" # Get from sam.gov after registration def get_sam_opportunities(): headers = { 'Accept': 'application/json' } params = { 'api_key': API_KEY, # API key goes in query params 'limit': 25, 'postedFrom': '01/01/2026', 'postedTo': '01/31/2026', 'ptype': 'o' # Solicitations only } response = requests.get(SAM_API_URL, headers=headers, params=params) response.raise_for_status() data = response.json() opportunities = data.get('opportunitiesData', []) for opp in opportunities: print(f"Title: {opp.get('title')}") print(f"Agency: {opp.get('fullParentPathName')}") print(f"Posted: {opp.get('postedDate')}") print(f"Deadline: {opp.get('responseDeadLine')}") print(f"Type: {opp.get('type')}") # Contact info is in an array contacts = opp.get('pointOfContact', []) if contacts: print(f"Contact: {contacts[0].get('email', 'N/A')}") print("---") get_sam_opportunities()

Important: Pagination

The API returns paginated results. Use offset to retrieve subsequent pages:

Check totalRecords in the response to know when you've retrieved everything.

Key Parameters

Common Issues and Solutions

1. Registration Takes Too Long

Issue: Entity registration can take up to 10 business days.

Solution: Start with the public 10 requests/day while waiting. Use caching to make the most of limited calls.

2. Rate Limit Exceeded

Issue: Hit the daily limit during development.

Solution: Cache responses locally. The opportunities data doesn't change frequently, so a 1-hour cache is usually fine.

3. Need Full Descriptions

Issue: API returns metadata but not the full contract description.

Solution: Use the resourceLinks field to download attached documents, or use SAM.gov's bulk data downloads.

4. Need Award Data

Issue: Want to see who won similar contracts.

Solution: Search for "Award Notice" types in SAM.gov matching the solicitation number.

When SAM.gov API Works Well

Good fit for:

When to Consider Alternatives

Consider other options if you need:

Alternative: GovCon API

GovCon API provides SAM.gov data with some differences:

Free tier: 25 requests/day. Developer plan: $19/month.

import requests # GovCon API example GOVCON_API_URL = "https://govconapi.com/api/v1/opportunities/search" API_KEY = "your_govcon_api_key" def get_opportunities(): headers = {'Authorization': f'Bearer {API_KEY}'} params = {'naics': '541330', 'limit': 50} response = requests.get(GOVCON_API_URL, headers=headers, params=params) data = response.json() for opp in data.get('data', []): print(f"Title: {opp.get('title')}") print(f"Agency: {opp.get('agency')}") print(f"Description: {opp.get('description_text', '')[:200]}...") print("---") get_opportunities()

Summary

SAM.gov's API is the official source for federal contract data. It's free, authoritative, and works well for low-volume use cases. The main tradeoffs are the registration wait time and rate limits.

For higher-volume needs or faster setup, third-party APIs like GovCon API provide alternatives with different tradeoffs (cost vs. convenience).

Next Steps

Related Guides

Official Resources

Last Updated: January 2026 | Questions? [email protected]