{
  "openapi": "3.1.0",
  "info": {
    "title": "GrantPulse API",
    "description": "Grant discovery and application intelligence API. 8 endpoints powered by Grants.gov, USASpending.gov, and Claude. All endpoints require x402 payment (USDC on Base mainnet). Flagship match endpoint includes Instrumentl, Grants.gov, and Candid Foundation Directory tool links. Grant writer endpoint includes writing tool links + Amazon grant writing books. All require x402 micropayment (USDC on Base).",
    "version": "1.1.0",
    "contact": {
      "url": "https://grantpulse-three.vercel.app"
    }
  },
  "servers": [
    {
      "url": "https://grantpulse-three.vercel.app"
    }
  ],
  "components": {
    "securitySchemes": {
      "x402": {
        "type": "apiKey",
        "in": "header",
        "name": "PAYMENT-SIGNATURE",
        "description": "x402 micropayment signature. Omit to receive 402 with payment requirements. Sign and retry to receive data."
      }
    }
  },
  "paths": {
    "/api/grant/match": {
      "get": {
        "summary": "Personalized grant matching",
        "description": "Flagship grant discovery \u2014 matches org type and mission to federal (Grants.gov), state, and foundation grants. Includes fit scores, quick wins, SBIR/STTR flag, and funding strategy.",
        "operationId": "grantMatch",
        "security": [
          {
            "x402": []
          }
        ],
        "parameters": [
          {
            "name": "org_type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "nonprofit | small_business | individual | public_university | private_university | state_government | local_government | tribal | for_profit | other"
          },
          {
            "name": "mission",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "location",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sector",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "arts | health | education | environment | technology | agriculture | community | housing | science"
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Personalized grant match report"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.15,
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Follow with /api/grant/apply for application strategy; response includes Instrumentl/Candid/Grants.gov tool links"
      }
    },
    "/api/grant/federal": {
      "get": {
        "summary": "Federal grant search",
        "description": "Live Grants.gov opportunity search with CFDA numbers, award ranges, deadlines, eligibility, and past award context from USASpending.gov.",
        "operationId": "grantFederal",
        "security": [
          {
            "x402": []
          }
        ],
        "parameters": [
          {
            "name": "keyword",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "eligibility",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Federal grant opportunities with agency intelligence"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.1,
        "x-agent-use-case": "on-demand"
      }
    },
    "/api/grant/state": {
      "get": {
        "summary": "State grant programs",
        "description": "State-level grant programs by US state and sector with agency links and application calendar.",
        "operationId": "grantState",
        "security": [
          {
            "x402": []
          }
        ],
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sector",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "org_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "State grant programs with application calendar"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.1,
        "x-agent-use-case": "on-demand"
      }
    },
    "/api/grant/foundation": {
      "get": {
        "summary": "Foundation grant intelligence",
        "description": "Private, family, community, and corporate foundation grants with mission alignment scoring, LOI strategy, and cultivation approach.",
        "operationId": "grantFoundation",
        "security": [
          {
            "x402": []
          }
        ],
        "parameters": [
          {
            "name": "mission",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "location",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "org_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Foundation grant intelligence with cultivation strategy"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.12,
        "x-agent-use-case": "on-demand"
      }
    },
    "/api/grant/eligibility": {
      "get": {
        "summary": "Grant eligibility analysis",
        "description": "Criterion-by-criterion eligibility check \u2014 honest verdict, hard disqualifiers, gray areas, questions to ask the program officer.",
        "operationId": "grantEligibility",
        "security": [
          {
            "x402": []
          }
        ],
        "parameters": [
          {
            "name": "grant_name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "org_type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "org_profile",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agency",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Eligibility verdict with criterion-by-criterion analysis"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.1,
        "x-agent-use-case": "on-demand"
      }
    },
    "/api/grant/apply": {
      "get": {
        "summary": "Grant application strategy",
        "description": "What it takes to WIN \u2014 funder priorities, review criteria with weights, winning narrative elements, budget strategy, timeline, red flags.",
        "operationId": "grantApply",
        "security": [
          {
            "x402": []
          }
        ],
        "parameters": [
          {
            "name": "grant_name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agency",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "org_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "mission",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Grant application strategy with review criteria and narrative guidance"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.15,
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Response includes Instrumentl/GrantStation/Candid writing tool links"
      }
    },
    "/api/grant/deadline": {
      "get": {
        "summary": "Grant deadline tracker",
        "description": "Deadline calendar \u2014 urgent (closing within 30 days), closing soon, upcoming, rolling, and annual grant calendar.",
        "operationId": "grantDeadline",
        "security": [
          {
            "x402": []
          }
        ],
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "org_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 90
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Grant deadline calendar"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.08,
        "x-agent-use-case": "scheduled"
      }
    },
    "/api/grant/writer": {
      "get": {
        "summary": "Grant narrative drafting",
        "description": "Professional grant narrative sections \u2014 problem statement, project description, evaluation plan, budget narrative, org background \u2014 ready to customize.",
        "operationId": "grantWriter",
        "security": [
          {
            "x402": []
          }
        ],
        "parameters": [
          {
            "name": "section",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "problem_statement",
                "project_description",
                "evaluation_plan",
                "budget_narrative",
                "org_background",
                "executive_summary",
                "goals_objectives"
              ]
            }
          },
          {
            "name": "org_type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "mission",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "grant_name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "org_description",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project_description",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Drafted narrative section ready to customize"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.2,
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Highest-price endpoint ($0.20) \u2014 includes grant writing books (Amazon) and tool links"
      }
    },
    "/api/grant/eu": {
      "get": {
        "summary": "EU funding intelligence",
        "description": "Horizon Europe, ERC, structural funds (ERDF/ESF+), and all EC grant programmes with consortium guidance and National Contact Point advice",
        "operationId": "grantEU",
        "security": [
          {
            "x402": []
          }
        ],
        "parameters": [
          {
            "name": "org_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sector",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "mission",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "EU member state"
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "EU funding intelligence report"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.12,
        "x-agent-use-case": "on-demand"
      }
    },
    "/api/grant/global": {
      "get": {
        "summary": "Global development funding",
        "description": "World Bank active projects, UN agency grants, bilateral donors (USAID/GIZ/FCDO/JICA), and major foundations with IATI transparency context",
        "operationId": "grantGlobal",
        "security": [
          {
            "x402": []
          }
        ],
        "parameters": [
          {
            "name": "sector",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "org_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "mission",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Global development funding intelligence report"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.15,
        "x-agent-use-case": "on-demand"
      }
    }
  }
}
