{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/krimskrams-xyz/json-schema/krimskrams-xyz-grant-scan-response-schema.json",
  "title": "GrantScanResponse",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/grant-search_krimskrams_xyz_openapi.json#/components/schemas/GrantScanResponse",
  "properties": {
    "search_count": {
      "type": "integer",
      "title": "Search Count"
    },
    "unique_result_count": {
      "type": "integer",
      "title": "Unique Result Count"
    },
    "retrieved_at": {
      "type": "string",
      "format": "date-time",
      "title": "Retrieved At"
    },
    "source": {
      "type": "string",
      "title": "Source",
      "default": "Grants.gov"
    },
    "source_api": {
      "type": "string",
      "title": "Source Api",
      "default": "https://api.grants.gov/v1/api"
    },
    "searches": {
      "items": {
        "$ref": "#/$defs/GrantSearchResponse"
      },
      "type": "array",
      "title": "Searches"
    },
    "unique_results": {
      "items": {
        "$ref": "#/$defs/GrantOpportunity"
      },
      "type": "array",
      "title": "Unique Results"
    }
  },
  "type": "object",
  "required": [
    "search_count",
    "unique_result_count",
    "retrieved_at",
    "searches",
    "unique_results"
  ],
  "$defs": {
    "GrantOpportunity": {
      "properties": {
        "opportunity_id": {
          "type": "integer",
          "title": "Opportunity Id"
        },
        "opportunity_number": {
          "type": "string",
          "title": "Opportunity Number"
        },
        "title": {
          "type": "string",
          "title": "Title"
        },
        "agency_code": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Agency Code"
        },
        "agency_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Agency Name"
        },
        "status": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Status"
        },
        "open_date": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Open Date"
        },
        "close_date": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Close Date"
        },
        "days_remaining": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Days Remaining"
        },
        "award_floor_usd": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Award Floor Usd"
        },
        "award_ceiling_usd": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Award Ceiling Usd"
        },
        "estimated_total_funding_usd": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Estimated Total Funding Usd"
        },
        "expected_awards": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Expected Awards"
        },
        "cost_sharing_required": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cost Sharing Required"
        },
        "eligibility": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Eligibility"
        },
        "funding_categories": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Funding Categories"
        },
        "funding_instruments": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Funding Instruments"
        },
        "assistance_listings": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Assistance Listings"
        },
        "official_url": {
          "type": "string",
          "title": "Official Url"
        },
        "source_updated_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source Updated At"
        }
      },
      "type": "object",
      "required": [
        "opportunity_id",
        "opportunity_number",
        "title",
        "official_url"
      ],
      "title": "GrantOpportunity"
    },
    "GrantSearchResponse": {
      "properties": {
        "query": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Query"
        },
        "source_hit_count": {
          "type": "integer",
          "title": "Source Hit Count"
        },
        "candidates_evaluated": {
          "type": "integer",
          "title": "Candidates Evaluated"
        },
        "result_count": {
          "type": "integer",
          "title": "Result Count"
        },
        "partial_results": {
          "type": "boolean",
          "title": "Partial Results"
        },
        "retrieved_at": {
          "type": "string",
          "format": "date-time",
          "title": "Retrieved At"
        },
        "source": {
          "type": "string",
          "title": "Source",
          "default": "Grants.gov"
        },
        "source_api": {
          "type": "string",
          "title": "Source Api",
          "default": "https://api.grants.gov/v1/api"
        },
        "results": {
          "items": {
            "$ref": "#/$defs/GrantOpportunity"
          },
          "type": "array",
          "title": "Results"
        }
      },
      "type": "object",
      "required": [
        "query",
        "source_hit_count",
        "candidates_evaluated",
        "result_count",
        "partial_results",
        "retrieved_at",
        "results"
      ],
      "title": "GrantSearchResponse"
    }
  }
}