GET /awards.json
API Endpoint
The NSF Award API search endpoint, which returns one page of award records that match a set of query parameters, with a total match count.
/awards.{format} is the search endpoint of the public NSF Award API. The server always asks for the JSON format, so every search it makes is a GET of https://www.research.gov/awardapi-service/v1/awards.json with query parameters.12 The API needs no authentication and serves public data only.3
One request returns one page of full award records plus a total match count. The server never shows these raw records to a model. The client in src/client/nsf-api-client.ts does four things before the tools see a page. It prepares the query (dates, page size, phrase quoting). It turns in-band errors into thrown errors. It normalizes each record. It works out whether more pages exist. This page describes the endpoint as the project uses it and has verified it. For the parameters, see Search parameters. For the body, see Response format. For offset, rpp and the 10,000 cap, see Paging and limits.
Caveat: the API reports a rejected request as HTTP 200 with a serviceNotification, not as an error status. A client that only checks the status code reads a typo in a parameter name as “no matching awards”.3
Request
| Part | Value |
|---|---|
| Method | GET |
| URL | https://www.research.gov/awardapi-service/v1/awards.json (base URL configurable with NSF_API_BASE_URL) |
| Query | Search filters, offset (0-based record offset) and rpp (records per page). See Search parameters. |
| Headers sent by the client | Accept: application/json and User-Agent: nsf-awards-mcp/<version> |
| Authentication | None |
The client builds the query in prepareParams before every request:2
- It trims string values and drops
undefined,null, empty and whitespace-only values. It keeps0andfalse.4 - It normalizes the six date parameters (
startDateStart,startDateEnd,expDateStart,expDateEnd,dateStart,dateEnd) tomm/dd/yyyy. If a date can’t be parsed, it throwsInvalid date for <field>: <value> (expected mm/dd/yyyy or yyyy-mm-dd)and sends nothing. - It clamps
rppto whole numbers from 1 to the page cap. The cap is 25 forsearchAwards, which every tool page uses. For the remainder request ofsearchAllPages, the cap ismaxRecords(default 250). It then shortensrppso that the page ends at record 10,000. See Paging and limits. - It wraps multi-word values of
awardeeName,perfLocationandfundProgramNamein double quotes, so that the API matches the phrase. See Search parameters.
Response
The body is a JSON object with one response key:5
| Path | Type | Meaning |
|---|---|---|
response.award |
array of award records | The records of this page, ordered by startDate, newest first. Every scalar value is a string. |
response.metadata.offset |
number | The offset of this page. |
response.metadata.rpp |
number | The page size of this request. |
response.metadata.totalCount |
number | Total matches, capped at 10000. |
response.serviceNotification |
array | Present when the API rejects the request. Each entry has notificationCode, notificationMessage and notificationType. |
The client’s searchAwards returns { awards, totalResults, hasMore }:2
awardsare the records afternormalizeAward. Amounts become numbers, flags become booleans, and people are parsed. See Response format.totalResultsismetadata.totalCount, converted to a number because XML bodies carry it as a string. When the count is missing, it isoffset + awards.length.hasMoreisoffset + awards.length < min(totalCount, 10000). WhentotalCountis missing,hasMoreis true when the page is full.
How the server uses it
| Caller | Request pattern |
|---|---|
| search_nsf_awards | One page per tool call. Tool inputs map to API parameters in toSearchParams.6 |
| search_by_institution | One page per call, with institutionName sent as awardeeName. |
| search_by_pi | One page per call with pdPIName ("<first> <last>", or the last name alone together with piLastName). With includeCoPIs, it makes two full searches through searchAllPages: one by PI name and one by coPDPI. It then merges, filters and pages them locally.7 |
searchAllPages fetches a first page of 25 records to learn the total. It refuses searches with more than 250 matches. Otherwise it fetches the remainder in one large page, and caches that full result set for 5 minutes (search_by_pi merges two of them, the PI side and the Co-PI side). The API serves pages larger than 25 when asked (rpp=250 returned 250 records, verified 2026-12-04), so the remainder usually takes one request.3 See Paging and limits and NSF API client.
Failures and retries
| Situation | What the client does |
|---|---|
serviceNotification of type ERROR (for example AwardAPI-002 for an unknown parameter) or FATAL (for example AwardAPI-004 past record 10,000) |
Throws <code>: <message>. Several notices are joined with ; . See Response format. |
Network error, timeout (ECONNABORTED), HTTP 429 or any 5xx |
Retries with exponential backoff (1 s, then 2 s), up to NSF_API_MAX_RETRIES times (default 2). Each attempt has a timeout of NSF_API_TIMEOUT_MS (default 15000 ms). |
| Other HTTP error statuses (for example 400 or 404) | No retry. Throws NSF API search failed (HTTP <status>).4 |
| Retries exhausted | Throws NSF API search failed (HTTP <status>), NSF API search failed (timed out) or NSF API search failed (<network error message>). |
| Client cancels the tool call | Not retried. Throws NSF API search was cancelled. |
| Body that is neither JSON nor XML, or empty | Throws Failed to parse NSF API response. |
Body without a response object (an HTML error page, {}, a proxy’s JSON error) |
Not retried. Throws Unexpected NSF API response (no "response" object, content-type <type>) instead of reporting no results.4 |
The retry and timeout settings come from the client constructor. The messages come from toError, assertNoServiceError, assertNSFResponse and parseResponse.2 The tools turn every thrown error into an isError tool result. See Errors and Configuration.
Live verification
This project checks the endpoint in two ways:
- CLAUDE.md records the behaviour that was verified against the live API between 2026-10-11 and 2026-12-04. That record covers parameter names, quoting, status flags, ordering, the 10,000 cap and AwardAPI-004.3
- The live suite
tests/live/api.live.test.tsruns weekly in the “Live NSF API” workflow, and on demand. It checks most filters against the unfilteredkeyword=wildfirebaseline: the filtered total must be smaller than the baseline, and every returned record must satisfy the filter. A few tests work differently. Every wildfire awardee is in the US, soawardeeCountryCode=USis checked only record by record. For both country codes, the suite also searches forCAwith no keyword and checks that total against the 10,000 cap instead of the baseline.idmust return exactly the one record. The PI and Co-PI name tests search without a keyword and compare a full name with a last name alone. Apart from the single-recordidtest, it never asserts exact counts.89
scripts/probe-nsf-api.sh sends raw curl probes of each parameter. For each request it prints the HTTP status, totalCount, the number of records and the first award id. An ignored parameter returns the same total as the unfiltered baseline.10
Examples
A raw request, as the development guide suggests for telling a server bug from an upstream change:11
curl -s -G https://www.research.gov/awardapi-service/v1/awards.json \
--data-urlencode keyword=wildfire --data-urlencode rpp=1
A trimmed response for keyword=wildfire&rpp=3, from the fixture search-wildfire-page.json. One record is shown, with most fields removed:12
{
"response": {
"award": [
{
"id": "2535052",
"title": "EPSCoR Graduate Fellowship Program (EGFP): Graduate fellowships to propel wildfire research in Montana",
"awardeeName": "University of Montana",
"awardeeStateCode": "MT",
"estimatedTotalAmt": "1113000",
"fundsObligatedAmt": "1113000",
"activeAwd": "true",
"startDate": "03/15/2027",
"expDate": "02/28/2030",
"parentUeiNumber": ""
}
],
"metadata": {
"offset": 0,
"rpp": 3,
"totalCount": 981
}
}
}
The same search through the client. The server sends limit as rpp:
search_nsf_awards { "keyword": "wildfire", "limit": 5 }
-> GET /awards.json?keyword=wildfire&offset=0&rpp=5
-
NSF Award API documentation (research.gov) ↩
-
NSF API Integration and Live API behaviour notes in CLAUDE.md ↩ ↩2 ↩3 ↩4
-
NSF API type definitions ↩
-
search_nsf_awards handler ↩
-
search_by_pi handler ↩
-
Live tests of the NSF API client ↩
-
Weekly live API workflow ↩
-
Raw curl probes of API parameters ↩
-
Development guide ↩
-
Trimmed real API responses used as test fixtures ↩