API Key Management Instructions
Current Status
1 Get a New SAM.gov API Key
Visit the SAM.gov API registration page to get a new API key:
Register for API Access
Create an account or log in to your existing SAM.gov account
Request API Key
Navigate to the "Get Opportunities Public API" section and request a new API key
Copy the Key
Save the API key securely - you'll need it for the next step
2 Update Environment Variable in Convex
You need to update the SAMdotGOV_KEY environment variable in your Convex deployment:
Option A: Using Convex Dashboard
1. Go to Convex Dashboard
Visit dashboard.convex.dev and select your project
2. Navigate to Settings
Go to the "Settings" tab in your project dashboard
3. Update Environment Variables
Find the SAMdotGOV_KEY variable and update it with your new API key
4. Deploy Changes
Save the changes and wait for the deployment to complete
Option B: Using Convex CLI
npx convex env set SAMdotGOV_KEY "your-new-api-key-here"Replace "your-new-api-key-here" with your actual API key from SAM.gov
3 Test the New API Key
After updating the API key, test that it's working correctly:
1. Go to Dashboard
Return to the main dashboard
2. Run a Test Scrape
Click the "Run Scraper" button to test the new API key
3. Check for Errors
If you see mock data or errors, the API key may not be working correctly
Troubleshooting
This usually means the API key is invalid or expired. Double-check that you copied the key correctly and that it's active in your SAM.gov account.
This indicates the API key is invalid or has expired. Request a new key from SAM.gov and update it in your Convex environment.
This means the SAMdotGOV_KEY environment variable is not set in your Convex deployment. Make sure you've added the API key to your environment variables.
This usually means there's an issue with the request parameters. Check that your date formats are correct (MM/dd/yyyy) and that all required parameters are provided.
This is normal and indicates the API is working correctly, but no opportunities match your search criteria. Try expanding your date range or adjusting your search parameters.
Make sure you're updating the correct environment variable name: SAMdotGOV_KEY. After updating, wait a few minutes for the deployment to complete.
Set a Reminder
Don't forget to set a calendar reminder for 85 days from now to update your API key before it expires!
Reminder: Update SAM.gov API key in 85 days (expires in 88 days)