openapi: 3.1.0
info:
  title: FlashGrant AI Search API
  description: Search 35,000+ medical grants by diagnosis or keyword. Returns structured grant data with application tiers and direct links.
  version: 1.0.0
servers:
  - url: https://flashgrant.com/api/v1/ai
paths:
  /search:
    get:
      operationId: searchGrants
      summary: Search medical grants by diagnosis or keyword
      description: Query the FlashGrant database for grants matching a diagnosis, condition, or keyword. Returns grant details including foundation, amount, application tier, and links.
      parameters:
        - name: q
          in: query
          description: Search query (e.g., "rett syndrome", "childhood leukemia", "transplant assistance")
          required: false
          schema:
            type: string
        - name: diagnosis
          in: query
          description: Filter by diagnosis category (e.g., "cancer", "autism", "rare disease", "diabetes")
          required: false
          schema:
            type: string
        - name: limit
          in: query
          description: Number of results to return (1-50, default 20)
          required: false
          schema:
            type: integer
            default: 20
        - name: offset
          in: query
          description: Pagination offset
          required: false
          schema:
            type: integer
            default: 0
      responses:
        '200':
          description: Grant search results
          content:
            application/json:
              schema:
                type: object
                properties:
                  source:
                    type: string
                  attribution:
                    type: string
                  query:
                    type: string
                  total_results:
                    type: integer
                  grants:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        foundation:
                          type: string
                        diagnosis:
                          type: string
                        amount:
                          type: string
                        tier:
                          type: string
                          enum: [A, B, C]
                        tier_label:
                          type: string
                        region:
                          type: string
                        description:
                          type: string
                        how_to_apply:
                          type: string
                        apply_url:
                          type: string
