Search2

API Calls

The endpoint allows you to search for opportunities based on specific search parameters.

Authentication and Authorization

Authentication and authorization is not required for search2

Getting Started

Using your API test tool, make a POST call to the following URL: https://api.www.grants.gov/v1/api/search2, with the expected request in the body below, and you will receive a similar sample response.

Expected Request Body: Sample Response
{ "rows": 10, "keyword": "20231011", "oppNum": "TEST-PTS-20231011-OPP1", "eligibilities": "", "agencies": "", "oppStatuses": "forecasted|posted", "aln": "", "fundingCategories": "" } "errorcode": 0, "msg": "Webservice Succeeds", "token": "eyJ0eX……I1NiJ9. ", "data": { "searchParams": { "resultType": "json", "searchOnly": false, "oppNum": "", "aln": "", "sortBy": "", "oppStatuses": "forecasted|posted", "startRecordNum": 0, "eligibilities": "", "fundingInstruments": "", "fundingCategories": "", "agencies": "", "rows": 10, "keyword": "20231011", "keywordEncoded": true }, "hitCount": 1, "startRecord": 0, "oppHits": [ { "id": "219999", "number": "TEST-ABC-20231011-OPP1", "title": "Test-ABC-20231011-Opp1 title!", "agencyCode": "HHS", "agencyName": "Health & Human Services", "openDate": "10/11/2023", "closeDate": "", "oppStatus": "posted", "docType": "synopsis", "alnist": [ "93.223" ] } ], "oppStatusOptions": [ { "label": "posted", "value": "posted", "count": 1 }, { "label": "closed", "value": "closed", "count": 0 }, { "label": "archived", "value": "archived", "count": 0 }, { "label": "forecasted", "value": "forecasted", "count": 0 } ], "dateRangeOptions": [], "suggestion": "20201111", "eligibilities": [ { "label": "County governments", "value": "01", "count": 1 } ], "fundingCategories": [ { "label": "Arts", "value": "AR", "count": 1 } ], "fundingInstruments": [ { "label": "Grant", "value": "G", "count": 1 } ], "agencies": [], "accessKey": "", "errorMsgs": [] } }

Here's a visualization of the high-level response:

ID Number Title Agency Code Agency Open Date Close Date Opportunity Status Document Type ALN List
289999 TEST-PTS-20231011-OPP1 Test-PTS-20231011-Opp1 title! HHS HHS 10/11/2023 posted synopsis 93.223

Curl Samples

URL: Search by Multiple Criteria

The below cURL is a search by fundingCategories, agencies, oppStatuses, and ALN:

curl -k -v -i --location 'https://api.www.grants.gov/v1/api/search2' --header 'Content-Type: application/json' --data '{"fundingCategories": "HL", "": "HHS-NIH11", "oppStatuses": "forecasted"}'

URL: Search by Multiple Criteria with ALN

The below cURL is a search by fundingCategories, agencies, and oppStatuses:

curl -k -v -i --location 'https://api.www.grants.gov/v1/api/search2' --header 'Content-Type: application/json' --data '{"fundingCategories": "HL", "agencies": "HHS", "oppStatuses": "forecasted", "aln": "93.866"}'

URL: Search by Combined Statuses and Keywords

You might want to send combined statuses as an array or as separate key-value pairs based on your backend handling. Below is an example that treats combined statuses as an array:

curl -k -v -i --location 'https://api.www.grants.gov/v1/api/search2' --header 'Content-Type: application/json' --data '{"oppStatuses": ["closed| archived"], "keywords": "points"}'