NationGraph RFPs API

The RFPs API from NationGraph — 5 operation(s) for rfps.

OpenAPI Specification

nationgraph-rfps-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Nationgraph Accounts RFPs API
  version: 0.2.36
tags:
- name: RFPs
paths:
  /api/v3/rfps/search:
    post:
      tags:
      - RFPs
      summary: Search Rfps
      description: 'Search for RFPs with extensive filtering on both RFP and institution fields.


        Performs efficient database-level JOIN between RFPs and Institutions.

        All filters are passed in the request body.


        **Text Search:**

        - include_words: Keywords to search in title/description

        - exclude_words: Keywords to exclude from results

        - keyword_logic: "AND" (all words match) or "OR" (any word matches)


        **RFP Status & Dates:**

        - status: "active", "expired", or "no_due_date"

        - start_date/end_date: Filter by due date range

        - min_days_remaining/max_days_remaining: Filter by days until due


        **Institution Filters:**

        - institution_name: Partial match on institution name

        - selected_states: Filter by state codes (e.g., ["CA", "TX"])

        - selected_counties: Filter by county names

        - selected_cities: Filter by cities (format: "state-city")

        - selected_institution_types: Filter by type (e.g., "higher_education")

        - selected_labels: Filter by institution labels

        - min_population/max_population: Filter by population range


        **Pagination:**

        - offset: Starting position (default: 0)

        - limit: Results per page (default: 100, max: 10000)'
      operationId: search_rfps_api_v3_rfps_search_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RFPRequestFilters'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RFPsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /api/v3/rfps/institutions:
    get:
      tags:
      - RFPs
      summary: Get Rfp Institutions
      operationId: get_rfp_institutions_api_v3_rfps_institutions_get
      security:
      - HTTPBearer: []
      parameters:
      - name: search
        in: query
        required: true
        schema:
          type: string
          minLength: 2
          maxLength: 200
          title: Search
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RFPInstitutionOptionsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v3/rfps/{unique_id}:
    get:
      tags:
      - RFPs
      summary: Get Rfps By Entity
      description: 'Get RFPs for a specific entity (unique_id).

        Returns all RFPs associated with the given unique_id.'
      operationId: get_rfps_by_entity_api_v3_rfps__unique_id__get
      security:
      - HTTPBearer: []
      parameters:
      - name: unique_id
        in: path
        required: true
        schema:
          type: string
          title: Unique Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/internal/rfps/{id}:
    get:
      tags:
      - RFPs
      summary: Get Rfp
      operationId: get_rfp_api_internal_rfps__id__get
      security:
      - HTTPBearer: []
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
          title: Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RFPResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/internal/rfps/search:
    post:
      tags:
      - RFPs
      summary: Search Rfps
      description: 'Search RFPs.


        The ``query`` field accepts a websearch-style query string evaluated against

        the RFP search vector (title + description, english config, stemming on).

        See RFPSearchFilters docstring for syntax.


        All filters are optional. Empty body returns paginated RFPs sorted by the

        default order (``due_date_asc``). At ~2.4M rows the RFP table is small

        enough that fully unbounded queries are fine; this differs from the PO

        endpoint, which requires at least one bounding filter.'
      operationId: search_rfps_api_internal_rfps_search_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RFPSearchFilters'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponse_RFPResponse_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
components:
  schemas:
    RFPs:
      properties:
        id:
          type: integer
          title: Id
        unique_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Unique Id
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
        agency:
          anyOf:
          - type: string
          - type: 'null'
          title: Agency
        due_date:
          anyOf:
          - type: string
          - type: 'null'
          title: Due Date
        rfp_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Rfp Url
        created_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Created At
        updated_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Updated At
        institution_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Institution Name
        institution_city:
          anyOf:
          - type: string
          - type: 'null'
          title: Institution City
        institution_state:
          anyOf:
          - type: string
          - type: 'null'
          title: Institution State
        institution_type:
          anyOf:
          - type: string
          - type: 'null'
          title: Institution Type
        source_id:
          anyOf:
          - type: integer
          - type: 'null'
          title: Source Id
        label:
          anyOf:
          - type: string
          - type: 'null'
          title: Label
        county:
          anyOf:
          - type: string
          - type: 'null'
          title: County
        street:
          anyOf:
          - type: string
          - type: 'null'
          title: Street
        latitude:
          anyOf:
          - type: number
          - type: 'null'
          title: Latitude
        longitude:
          anyOf:
          - type: number
          - type: 'null'
          title: Longitude
        geo_shape:
          anyOf:
          - type: string
          - type: 'null'
          title: Geo Shape
        county_fips_code:
          anyOf:
          - type: string
          - type: 'null'
          title: County Fips Code
        population:
          anyOf:
          - type: number
          - type: 'null'
          title: Population
        entity_understanding:
          anyOf:
          - type: string
          - type: 'null'
          title: Entity Understanding
        is_active:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Is Active
        favicon_path:
          anyOf:
          - type: string
          - type: 'null'
          title: Favicon Path
        last_processed_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Processed At
        homepage_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Homepage Url
        contact_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Contact Url
        institution_rfp_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Institution Rfp Url
        meeting_minute_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Meeting Minute Url
        budget_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Budget Url
        strategic_plan_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Strategic Plan Url
        procurement_guideline_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Procurement Guideline Url
        press_release_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Press Release Url
        open_data_portal_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Open Data Portal Url
        youtube_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Youtube Url
        foia_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Foia Url
        homepage_url_status:
          anyOf:
          - type: string
          - type: 'null'
          title: Homepage Url Status
        contact_url_status:
          anyOf:
          - type: string
          - type: 'null'
          title: Contact Url Status
        rfp_url_status:
          anyOf:
          - type: string
          - type: 'null'
          title: Rfp Url Status
        meeting_minute_url_status:
          anyOf:
          - type: string
          - type: 'null'
          title: Meeting Minute Url Status
        budget_url_status:
          anyOf:
          - type: string
          - type: 'null'
          title: Budget Url Status
        strategic_plan_url_status:
          anyOf:
          - type: string
          - type: 'null'
          title: Strategic Plan Url Status
        press_release_url_status:
          anyOf:
          - type: string
          - type: 'null'
          title: Press Release Url Status
        procurement_guideline_url_status:
          anyOf:
          - type: string
          - type: 'null'
          title: Procurement Guideline Url Status
        open_data_portal_url_status:
          anyOf:
          - type: string
          - type: 'null'
          title: Open Data Portal Url Status
        youtube_url_status:
          anyOf:
          - type: string
          - type: 'null'
          title: Youtube Url Status
        foia_url_status:
          anyOf:
          - type: string
          - type: 'null'
          title: Foia Url Status
        score:
          anyOf:
          - type: number
          - type: 'null'
          title: Score
        relevance_score:
          anyOf:
          - type: number
          - type: 'null'
          title: Relevance Score
        decay_score:
          anyOf:
          - type: number
          - type: 'null'
          title: Decay Score
      type: object
      required:
      - id
      title: RFPs
      description: Pydantic model for RFP API responses with full institution data.
    PaginatedResponse_RFPResponse_:
      properties:
        results:
          items:
            $ref: '#/components/schemas/RFPResponse'
          type: array
          title: Results
        total:
          type: integer
          title: Total
        offset:
          type: integer
          title: Offset
        limit:
          type: integer
          title: Limit
      type: object
      required:
      - results
      - total
      - offset
      - limit
      title: PaginatedResponse[RFPResponse]
    RFPRequestFilters:
      properties:
        include_words:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Include Words
        exclude_words:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Exclude Words
        keyword_logic:
          anyOf:
          - type: string
          - type: 'null'
          title: Keyword Logic
          default: OR
        status:
          anyOf:
          - type: string
          - type: 'null'
          title: Status
          default: active
        start_date:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Start Date
        end_date:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: End Date
        min_days_remaining:
          anyOf:
          - type: integer
          - type: 'null'
          title: Min Days Remaining
        max_days_remaining:
          anyOf:
          - type: integer
          - type: 'null'
          title: Max Days Remaining
        institution_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Institution Name
        institutions_include:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Institutions Include
        selected_states:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Selected States
        selected_counties:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Selected Counties
        selected_cities:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Selected Cities
        selected_institution_types:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Selected Institution Types
        selected_labels:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Selected Labels
        min_population:
          anyOf:
          - type: integer
          - type: 'null'
          title: Min Population
        max_population:
          anyOf:
          - type: integer
          - type: 'null'
          title: Max Population
        sort_by:
          anyOf:
          - type: string
          - type: 'null'
          title: Sort By
          default: due_date
        sort_order:
          anyOf:
          - type: string
          - type: 'null'
          title: Sort Order
          default: asc
        offset:
          anyOf:
          - type: integer
          - type: 'null'
          title: Offset
          default: 0
        limit:
          anyOf:
          - type: integer
          - type: 'null'
          title: Limit
          default: 100
      type: object
      title: RFPRequestFilters
      description: Request model for RFP search with all filters.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    RFPsResponse:
      properties:
        rfps:
          items:
            $ref: '#/components/schemas/RFPs'
          type: array
          title: Rfps
        total_count:
          anyOf:
          - type: integer
          - type: 'null'
          title: Total Count
      type: object
      required:
      - rfps
      title: RFPsResponse
      description: Response model for RFP search endpoints
    RFPSearchFilters:
      properties:
        query:
          anyOf:
          - type: string
            maxLength: 2000
          - type: 'null'
          title: Query
        status:
          anyOf:
          - $ref: '#/components/schemas/RFPStatus'
          - type: 'null'
        due_after:
          anyOf:
          - type: string
            format: date
          - type: 'null'
          title: Due After
        due_before:
          anyOf:
          - type: string
            format: date
          - type: 'null'
          title: Due Before
        institution_ids:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Institution Ids
        states:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: States
        source_tables:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Source Tables
        sort:
          type: string
          enum:
          - due_date_asc
          - due_date_desc
          - updated_desc
          - relevance
          title: Sort
          default: due_date_asc
        offset:
          type: integer
          title: Offset
          default: 0
        limit:
          type: integer
          title: Limit
          default: 100
      type: object
      title: RFPSearchFilters
      description: "Search filters for RFPs.\n\nThe ``query`` field accepts a websearch-style query string evaluated against\nthe ``search_vector`` column (covers title + description, tokenized with\nthe ``english`` config — stemming enabled, stop words filtered).\n\nQuery syntax:\n    bare words:    \"content filter\"           AND of both words\n    quoted phrase: '\"content filtering\"'      exact phrase match\n    OR:            \"filter OR cybersecurity\"  literal OR keyword\n    exclude:       \"filter -demo\"             prefix - to exclude\n    combined:      '\"content filter\" -demo -test'\n\nStemming means ``filter`` matches ``filter``, ``filters``, ``filtering``,\n``filtered``. Unlike the PO endpoint (which uses ``simple`` config),\nword boundaries here are at the tokenizer level — phrase syntax handles\nexact matching when needed.\n\nAt least one of ``institution_ids`` or ``query`` must be supplied — the\nendpoint rejects requests with both empty."
    RFPResponse:
      properties:
        id:
          type: integer
          title: Id
        rfp_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Rfp Id
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
        agency:
          anyOf:
          - type: string
          - type: 'null'
          title: Agency
        due_date:
          anyOf:
          - type: string
            format: date
          - type: 'null'
          title: Due Date
        rfp_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Rfp Url
        source_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Source Url
        created_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Created At
        updated_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Updated At
        institution_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Institution Id
        institution_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Institution Name
        institution_state:
          anyOf:
          - type: string
          - type: 'null'
          title: Institution State
        institution_type:
          anyOf:
          - type: string
          - type: 'null'
          title: Institution Type
        status:
          anyOf:
          - $ref: '#/components/schemas/RFPStatus'
          - type: 'null'
        days_until_due:
          anyOf:
          - type: integer
          - type: 'null'
          title: Days Until Due
        relevance:
          anyOf:
          - type: number
          - type: 'null'
          title: Relevance
      type: object
      required:
      - id
      title: RFPResponse
      description: Lean RFP response — drops the institution-metadata bloat from the v3 shape.
    RFPStatus:
      type: string
      enum:
      - active
      - expired
      - no_due_date
      title: RFPStatus
    RFPInstitutionOptionsResponse:
      properties:
        institutions:
          items:
            type: string
          type: array
          title: Institutions
      type: object
      required:
      - institutions
      title: RFPInstitutionOptionsResponse
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer