NSF API search parameters

Reference

The query parameters of the NSF Award API search endpoint as this project has verified them: which filter, which the API rejects or ignores, how tool inputs map to them, and the per-field quoting and name-matching rules.

Status
stable
Trust tier
unverified
Generated
claude-code/claude-opus-5-5, 2026-12-05
Tags
nsf-apisearchparametersupstreamlive-verified

This page lists the query parameters of GET /awards.json as this project uses them. The parameter names and their behaviour come from probes against the live API, not only from the official documentation. Several names that look plausible are rejected, and some accepted names do nothing.1 NSFSearchParams in src/types/nsf-api.types.ts lists every parameter that the client sends. Everything in it was checked against the live service.2

Tool inputs are not API parameters. The tools use friendlier names, and their handlers map them to the names on this page. The Tool input mapping table shows the mapping. For the tool-side view of these filters, see Shared search parameters.

How to read the “Evidence” column:

  • CLAUDE.md means the behaviour is recorded in the “Live API behaviour” notes, which were verified between 2026-10-11 and 2026-12-04. A specific date means CLAUDE.md gives one for that check.1
  • Live suite means tests/live/api.live.test.ts checks it against the real API each week. A filter passes when its total is below the keyword=wildfire baseline and every returned record satisfies the filter.3
  • Code only means the behaviour is stated in the tool schemas or the server instructions, and no live check in the repo covers it.

Schema

Filters the API honours

Parameter Matches Evidence
keyword Free text across award fields. Words separated by spaces match awards that contain any of them; uppercase AND requires all of them. One phrase in double quotes matches exactly; see Keyword syntax. Live suite (as the baseline, and two quoted phrases). AND and quoting rules: code only4
id One award id. id=1114898 returns exactly one record. CLAUDE.md, 2026-12-04. Live suite
ueiNumber Awardee Unique Entity Identifier, for example ED44Y3W6P7B9 Live suite
parentUeiNumber Parent organization UEI, for example NKJGJQYQJKR3 CLAUDE.md, 2026-12-04. Live suite
cfdaNumber Assistance Listing number, for example 47.050. A record lists all its numbers ("47.049, 47.050, 47.076"), and the filter matches a record whose list contains the number. CLAUDE.md, 2026-12-04. Live suite
awardeeName Awardee organization name. Matched as a phrase when quoted. See Phrase quoting. CLAUDE.md. Live suite
awardeeCity Awardee city. A multi-word value matches any of its words, quoted or not. CLAUDE.md. Live suite (Tucson)
awardeeStateCode Two-letter state code, for example AZ Live suite
awardeeCountryCode Two-letter country code, for example US or CA CLAUDE.md, 2026-12-04. Live suite
awardeeZipCode ZIP code. Records can hold ZIP+4 ("708030001"). 85721 matches records whose ZIP starts with 85721. CLAUDE.md, 2026-12-04. Live suite
awardeeDistrictCode Congressional district, state code plus number, for example AZ07 CLAUDE.md, 2026-12-04. Live suite
piFirstName PI first name. Fuzzy on its own. CLAUDE.md. Live suite (paired with piLastName)
piLastName PI last name, matched as a prefix: Roos also matches Roosevelt Live suite
pdPIName PI full name, unquoted. Matches whole words of the PI’s name, so "First Last" finds that person. CLAUDE.md (unquoted). Live suite (whole words)
coPDPI Co-PI name. A full name matches that person. A last name alone matches every Co-PI with that surname. CLAUDE.md. Live suite
startDateStart, startDateEnd Award startDate on or after, on or before (mm/dd/yyyy) CLAUDE.md. Live suite
expDateStart, expDateEnd Award expDate range (mm/dd/yyyy) CLAUDE.md. Live suite
dateStart, dateEnd The record’s date field (the award action date), not startDate CLAUDE.md. Live suite
estimatedTotalAmtFrom, estimatedTotalAmtTo estimatedTotalAmt range in dollars, compared as numbers Live suite
fundsObligatedAmtFrom, fundsObligatedAmtTo fundsObligatedAmt range in dollars, compared as numbers Live suite
fundProgramName Funding program name. Matched as a phrase when quoted. A record can list several programs, separated by commas. CLAUDE.md. Live suite (Ecosystem Studies)
transType Award instrument, for example Standard Grant or Continuing Grant Live suite
perfLocation Performing organization name. Matched as a phrase when quoted. CLAUDE.md. Live suite
perfStateCode Two-letter state code of the place of performance Live suite
perfCountryCode Two-letter country code of the place of performance CLAUDE.md, 2026-12-04. Live suite
ActiveAwards true limits results to active awards CLAUDE.md. Live suite
ExpiredAwards true limits results to expired awards CLAUDE.md. Live suite
offset 0-based record offset CLAUDE.md. See Paging and limits
rpp Records per page CLAUDE.md. See Paging and limits

Sources for the table: CLAUDE.md,1 the live suite,3 and the value examples in the fixtures.5

Parameters the API rejects

The API answers each of these names with HTTP 200 and AwardAPI-002 Invalid parameter(s) {...}. The client turns that answer into a thrown error.1

Rejected name Use instead
startDateFrom, startDateTo, expDateFrom, expDateTo (the *From/*To date spellings) startDateStart/startDateEnd, expDateStart/expDateEnd
awardsDateStart, awardsDateEnd dateStart/dateEnd
awardeeOrganization awardeeName
estimatedAwardAmountFrom, estimatedAwardAmountTo estimatedTotalAmtFrom/estimatedTotalAmtTo
perfState perfStateCode
nsfOrganization, nsfDirectorateName, awardType, fundingAgencyCode, awardingAgencyCode No replacement
sortBy, sortDir No replacement. Results always come newest startDate first. See Paging and limits.

The tool inputs startDateFrom, startDateTo, expDateFrom and expDateTo are valid tool arguments. The handlers rename them before the request, so these spellings never reach the API.6

Parameters the API accepts but ignores

The tools don’t offer any of these.1

Parameter Live behaviour How the server handles it
printFields Ignored. Full records always come back. The probe script sends it to both the search and the detail endpoint. The tools have their own printFields input. The server applies it after the response, with pickFields on the normalized record, and never sends it upstream.7
agency agency=NSF changes nothing. Removed from search_nsf_awards in 2.0 (see Migrating from 1.x).8
awardAgencyCode Returns 0 results for every value (verified 2026-10-20). Not offered
primaryProgram Returns 0 results for every value (verified 2026-10-20). Not offered
projectOutcomesOnly projectOutcomesOnly=true returns 0. Not offered. Records carry hasOutcomesReport instead.

An ignored parameter is hard to spot, because the response looks like a normal result. The probe script finds one by comparing totals: an ignored parameter returns the same total as the unfiltered baseline.9 The development guide asks contributors to check any new parameter against the live API before they add it to NSFSearchParams.10

Tool input mapping

The SDK validates tool arguments and applies their defaults. The handlers then build the API query:611127

API parameter search_nsf_awards search_by_institution search_by_pi
keyword, id, ueiNumber, parentUeiNumber, cfdaNumber, awardeeCountryCode, awardeeZipCode, awardeeDistrictCode, pdPIName, dateStart, dateEnd, fundsObligatedAmtFrom, fundsObligatedAmtTo, fundProgramName, transType, perfLocation, perfStateCode, perfCountryCode same name not offered not offered
awardeeName awardeeName institutionName (required) institution
awardeeCity awardeeCity city not offered
awardeeStateCode awardeeStateCode stateCode stateCode
pdPIName (from search_by_pi) (see first row) not offered "<firstName> <lastName>", or lastName alone when no first name is given
piFirstName, piLastName piFirstName, piLastName not offered piLastName only, set to lastName when no first name is given; never piFirstName
coPDPI coPDPI not offered With includeCoPIs only: "<firstName> <lastName>", or lastName when no first name is given
startDateStart, startDateEnd startDateFrom, startDateTo startDateFrom, startDateTo startDateFrom, startDateTo
expDateStart, expDateEnd expDateFrom, expDateTo expDateFrom, expDateTo expDateFrom, expDateTo
estimatedTotalAmtFrom, estimatedTotalAmtTo same name same name not offered
ActiveAwards / ExpiredAwards status, or the deprecated includeExpired status status
offset offset offset offset (sent only without includeCoPIs)
rpp limit limit limit (sent only without includeCoPIs)

With includeCoPIs, search_by_pi runs two full searches through searchAllPages: one by PI name (the same pdPIName, and for a surname alone piLastName, as the default mode) and one by coPDPI. Each search gets the same institution, state, date and status filters. The handler keeps only awards that name the person as PI or Co-PI, sorts them, and pages them locally.12 See search_by_pi.

Status flags

statusParams maps the tool’s status to the API flags:7

status API parameters sent
active ActiveAwards=true
expired ExpiredAwards=true
all, or absent neither flag
absent, with includeExpired: false (search_nsf_awards only) ActiveAwards=true

The two flags split the result set. The ActiveAwards=true count plus the ExpiredAwards=true count equals the unfiltered count.1 The live suite checks this for keyword=wildfire. It also checks that every ActiveAwards record has activeAwd true, and every ExpiredAwards record has activeAwd false.3

Phrase quoting

awardeeName, perfLocation and fundProgramName match any word of an unquoted multi-word value. Quoting the value makes the API match the phrase. The client therefore wraps a value of these three fields in double quotes when it contains whitespace. It first removes any double quotes inside the value, and it leaves single-word values unquoted.11314

Quoting works per field, and the client never quotes the other fields:114

Field Unquoted Quoted
awardeeName, perfLocation, fundProgramName Matches any word Matches the phrase (the client quotes these)
pdPIName "First Last" matches that PI Returns nothing
coPDPI Full name matches that person Returns nothing
piLastName Matches surnames that start with the value3 Matches more
awardeeCity Matches any word Matches any word

The tool schemas tell callers to pair awardeeCity (or city) with a state code for this reason.4

Name matching

These rules were verified against the live API:13

  • coPDPI with a full name ("First Last") matches that person. A last name alone matches every Co-PI with that surname, so it returns at least as many awards.
  • piFirstName on its own is fuzzy.1
  • piLastName is a prefix match: piLastName=Roos also returns PIs named Roosevelt.312
  • Unquoted pdPIName with "First Last" matches whole words of the PI’s name, so every award it returns names that person. piFirstName plus piLastName is looser: because piLastName is a prefix match and piFirstName is fuzzy, it returns more awards, including other people whose surname starts with the searched one. They differ whenever another PI’s surname starts with the searched one, or the fuzzy first name matches someone else.3
  • For a surname alone, pdPIName plus piLastName returns fewer awards than piLastName alone and no longer matches the longer surnames (Roos without Roosevelt).3

search_by_pi therefore sends pdPIName="<first> <last>" for a full name, and pdPIName plus piLastName for a surname alone.12 The server instructions pass the main rules on to the model.15 Because the API’s name matching is loose, search_by_pi with includeCoPIs checks each merged record locally. It keeps a record only when every word of the requested name appears in one person’s name: pdPIName, a pi entry or a coPDPI entry. Both names are normalized to Unicode NFC, case is ignored, ’ and ‘ count as ', and the names are split into words at spaces, ,, ., (, ), hyphens and dashes, so a hyphenated surname such as Jimenez-Sandoval matches.12

Keyword syntax

keyword takes a small query syntax. The tool schema and the server instructions describe it, and the schema rejects the forms the API mishandles:415

  • Words separated by spaces match awards that contain any of them. Uppercase AND between words requires all of them, for example CAREER AND "machine learning".
  • One phrase in double quotes matches exactly.
  • The API reads everything from the first double quote to the last as one phrase. Two quoted phrases, such as "wildfire smoke" "air quality", therefore match almost nothing; the live suite checks that they return under a fifth of the single phrase’s count.3 Join a quoted phrase to other words with AND instead ("wildfire smoke" AND health).
  • An unmatched double quote or parenthesis fails upstream with a generic AwardAPI-004 notice.4

The schema rejects an unmatched double quote, an unmatched parenthesis and more than one quoted phrase before any request is sent, with the messages listed in Errors. Award types such as CAREER, REU or SBIR are spread over many programs, so the fundProgramName description points callers to keyword for them.4

Dates

The API takes dates as mm/dd/yyyy.1 The tools accept mm/dd/yyyy or yyyy-mm-dd, and the client normalizes every date parameter with normalizeToNSFDate:16

  • mm/dd/yyyy and m/d/yyyy are padded to mm/dd/yyyy.
  • yyyy-mm-dd is rewritten as written, so the result doesn’t depend on the server’s time zone.
  • An ISO date-time with an explicit zone (Z or +hh:mm) names an instant, and the client uses its UTC calendar day. A date-time without a zone uses the date as written.
  • An impossible date such as 2020-02-30 or 13/01/2020 is rejected, never rolled over to the next valid date.

Bad dates fail before any request is made. The tool schema rejects them with Invalid date: expected mm/dd/yyyy or yyyy-mm-dd. It also rejects a reversed range, with <from> (<date>) is after <to> (<date>). A reversed amount range fails with <from> (<n>) is greater than <to> (<n>).4 If an invalid date still reaches the client, it throws Invalid date for <field>: <value> (expected mm/dd/yyyy or yyyy-mm-dd). Dropping the filter instead would return unfiltered results that look filtered.13

Empty values

The client trims every string parameter. It drops parameters that are undefined, null, empty or only whitespace, so an empty tool argument never becomes an empty filter. It keeps 0 and false.14

Examples

A phrase field is quoted, and a city is not:

awardeeName=University of Arizona  ->  awardeeName="University of Arizona"
fundProgramName=Ecosystem Studies  ->  fundProgramName="Ecosystem Studies"
awardeeCity=Baton Rouge            ->  awardeeCity=Baton Rouge   (matches any word)

A rejected parameter, from the fixture invalid-parameter.json:5

{
  "response": {
    "serviceNotification": [
      {
        "notificationCode": "AwardAPI-002",
        "notificationMessage": "Invalid parameter(s) sent in the request. Invalid Parameter(s) {awardeeOrganization}",
        "notificationType": "ERROR"
      }
    ]
  }
}

The client throws this as AwardAPI-002: Invalid parameter(s) sent in the request. Invalid Parameter(s) {awardeeOrganization}.

Probing a parameter by hand, as scripts/probe-nsf-api.sh does:9

B=https://www.research.gov/awardapi-service/v1
curl -s "$B/awards.json?keyword=wildfire&startDateStart=01/01/2020&startDateEnd=12/31/2020&rpp=2"   # filters
curl -s "$B/awards.json?keyword=wildfire&startDateFrom=01/01/2020&startDateTo=12/31/2020&rpp=2"     # AwardAPI-002
  1. NSF API Integration and Live API behaviour notes in CLAUDE.md ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10 ↩11

  2. NSF API type definitions ↩

  3. Live tests of the NSF API client ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9

  4. Tool input and output schemas ↩ ↩2 ↩3 ↩4 ↩5 ↩6

  5. Trimmed real API responses used as test fixtures ↩ ↩2

  6. search_nsf_awards handler ↩ ↩2

  7. Shared tool helpers (status mapping, record shaping) ↩ ↩2 ↩3

  8. README ↩

  9. Raw curl probes of API parameters ↩ ↩2

  10. Development guide ↩

  11. search_by_institution handler ↩

  12. search_by_pi handler ↩ ↩2 ↩3 ↩4 ↩5

  13. NSF API client ↩ ↩2

  14. Unit tests of the NSF API client ↩ ↩2 ↩3

  15. Server factory and server instructions ↩ ↩2

  16. Date normalization ↩

Sources

  1. NSF API Integration and Live API behaviour notes in CLAUDE.md api-behaviour
  2. NSF API client api-client
  3. NSF API type definitions api-types
  4. Date normalization date-utils
  5. Tool input and output schemas tool-schema
  6. search_nsf_awards handler search-tool
  7. search_by_institution handler institution-tool
  8. search_by_pi handler pi-tool
  9. Shared tool helpers (status mapping, record shaping) shared-tools
  10. Server factory and server instructions server
  11. Live tests of the NSF API client live-api-tests
  12. Unit tests of the NSF API client client-tests
  13. Trimmed real API responses used as test fixtures fixtures
  14. Raw curl probes of API parameters probe-script
  15. README readme
  16. Development guide dev-guide