HigherGov Docs
  • The HigherGov Docs
  • HigherGov Basics
    • Search Basics
    • Saved Searches and Alerts
    • Favoriting, Tracking, and Passing
    • Adding Users to Your Account
    • Daily Opportunity Emails
  • Find Opportunities
    • Federal Contracts
    • Federal Grants
    • State and Local Contracts
    • DLA Opportunities
    • Forecasted Opportunities and Expiring Awards
    • Federal Small Business and Socioeconomic Contracts
    • Federal Subcontracts and Subgrants
  • Business Development
    • Find And Analyze Competing Bidders
    • Find Teaming Partners
    • Benchmarking Labor Rates
    • Find Federal Incumbents
    • Find Government Buyers
  • Pursuit Management
    • Create a Pipeline
    • Add Pursuits to Pipeline
    • Review Pipeline and Performance
  • Market Intelligence
    • Research Federal Contractors and Grant Recipients
    • Find and Analyze Federal Contracts
    • Find and Analyze Federal Grants
    • Market Analysis Tool
    • Analyze Contract Vehicles
  • Capital Markets
    • Analyze M&A Transactions and Trends
    • Find M&A Targets and Buyers
  • Reference
    • Federal Contract Hierarchies
    • Federal Contract Protests
    • Analyze and Select NAICS and PSC Codes
  • MARKETING
    • Customize Awardee Profile
    • Marketing Audit Tool
    • Marketing Booster
  • Import and Export
    • API
    • Task Order Integration
    • Zapier Integration
  • More
    • FOIA Service
    • FAQ
Powered by GitBook
On this page
  • Access, Limits, and Pricing
  • Endpoints
  • Creating Keys
  • Using the search_id Parameter
  • Downloading Opportunity Files
  • Data Refresh Rate
  • Code Examples
  1. Import and Export

API

Getting started with the powerful HigherGov API

PreviousMarketing BoosterNextTask Order Integration

Last updated 9 months ago

Access, Limits, and Pricing

All HigherGov subscriptions include access to the API and 10,000 records per month through the API. If you require more data, please with your use case for pricing.

Endpoints

A list of available endpoints and fields is available in the OAS . The OAS Documentation can also generate sample API calls by pressing the Try It Out button under each endpoint, selecting the desired Parameters, and pressing Execute.

We also offer APIs customized to your needs. Please us if you are interested in learning more.

Creating Keys

API keys can be managed when signed in by selecting the gear icon in the upper right and selecting API or by clicking . Only an account administrator will have access to create keys. To create an API key, select the Generate Key button. Note that the full key will only be available on this screen once so make sure to copy and securely save the key.

Using the search_id Parameter

For the Opportunity, Federal Contract, and Federal Grant endpoints, HigherGov provides a search_id parameter that allows a HigherGov search to be easily converted into an API call. The search_id parameter does not accept all search fields, please see the endpoint documentation for a list of supported fields.

Example

You can take the searchID listed in the URL:

https://www.highergov.com/contract-opportunity/?searchID=2F6PPA1a7NAQ4C1OUh7XB

and use that in your API call as the search_id parameter:

https://www.highergov.com/api-external/opportunity/?api_key=your-api-key-here&search_id=2F6PPA1a7NAQ4C1OUh7XB&captured_date=2024-05-01&page_size=10&source_type=sam

Best Results

For best results with the search_id filter in the Opportunity endpoint, we recommend also using the source_type and captured_date filters to limit your call to the most relevant data source(s) and most recent dates.

Downloading Opportunity Files

To download opportunity files, first make a call to the Opportunity endpoint. In the results, there will be a field called document_path that will provide a path to call to the Document endpoint. Making this call to the Document endpoint will return information on all of the documents related to the opportunity including a set of download_url paths that can be used to download files.

Please note that the provided download_url will expire after 60 minutes, and if files are not downloaded within that timeframe, a new call will need to be made to the Document endpoint.

Data Refresh Rate

Data is generally updated shortly after the underlying data source. Some examples are shown below.

Endpoint
Data Update Frequency

Opportunity

20 Minutes

Federal Contract

Daily

Federal Grant

Daily

Awardee

Daily

Code Examples

Below are a few code snippets to get started accessing the API.

import requests
import json

# Define the Endpoint and Key
endpoint = 'https://www.highergov.com/api-external/contract/'
api_key = 'your-api-key-here'

#Define Parameters
params = {
    'api_key': api_key,
    'last_modified_date': '2023-07-06',
    'search_id': 'z9zi90apiU_Zyl3T2CUZa',    
    'page_number': '1',
}

#Call API
response = requests.get(endpoint, params=params)

#Convert Response to JSON
data = response.json()
#print(json.dumps(data, indent=4))  # Print the JSON

#Loop through results
for result in data.get('results'):
    contract_award_id = result.get('award_id')
    ...
// Define the Endpoint and Key
const endpoint = 'https://www.highergov.com/api-external/contract/';
const api_key = 'your-api-key-here';

// Define Parameters
let params = {
    'api_key': api_key, 
    'last_modified_date': '2023-07-06',
    'search_id': 'z9zi90apiU_Zyl3T2CUZa',        
    'page_number': '1',
};

// Convert parameters to URL query string
let query = Object.keys(params).map(k => `${encodeURIComponent(k)}=${encodeURIComponent(params[k])}`).join('&');

// Call API
fetch(`${endpoint}?${query}`)
    .then(response => response.json()) // Parse response as JSON
    .then(data => {
        // Loop through results
        data.results.forEach(result => {
            let contract_award_id = result.award_id;
            console.log(contract_award_id);
        });  
    }); 
<?php

// Define the endpoint and parameters
$endpoint = 'https://www.highergov.com/api-external/contract/';
$api_key = 'your-api-key-here';

$params = http_build_query([
    'api_key' => $api_key,
    'last_modified_date' => '2023-07-06',
   'search_id' => 'z9zi90apiU_Zyl3T2CUZa',    
    'page_number' => '1',
]);

// Initialize cURL
$ch = curl_init();

// Set the options
curl_setopt($ch, CURLOPT_URL, $endpoint.'?'.$params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);

// Execute the cURL session
$response = curl_exec($ch);

// Close the cURL session
curl_close($ch);

// Convert the response into an associative array
$data = json_decode($response, true);

// Loop through each item in the 'results' array
foreach ($data['results'] as $result) {
    $contract_award_id = $result['award_id'];
}

If you have the below search in :

Federal Contract Opportunities
contact us
documentation
contact
here