{
  "openapi": "3.1.0",
  "info": {
    "title": "GrantPulse API",
    "description": "Grant discovery and application intelligence API, plus IRS Form 990-based nonprofit/funder financial intelligence. 12 endpoints powered by Grants.gov, USASpending.gov, live IRS public records (EO Business Master File + SOI Form 990/990-PF Annual Extracts), 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.",
    "version": "1.2.0",
    "contact": {
      "url": "https://grantpulse.theaslangroupllc.com"
    }
  },
  "servers": [
    {
      "url": "https://grantpulse.theaslangroupllc.com"
    }
  ],
  "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"
      }
    },
    "/api/grant/org-intel": {
      "get": {
        "summary": "Nonprofit financial intelligence (IRS Form 990)",
        "description": "Nonprofit financial lookup from live IRS public data (EO Business Master File + SOI Form 990 Annual Extract) \u2014 revenue/expense/asset trend, officer compensation, spending ratio, deterministic red flags, plus web-grounded watchdog context. Public-domain alternative to paid nonprofit databases.",
        "operationId": "grantOrgIntel",
        "security": [
          {
            "x402": []
          }
        ],
        "parameters": [
          {
            "name": "ein",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{9}$"
            },
            "description": "9-digit EIN. Usable alone (financials are EIN-indexed nationwide) or with state for BMF registration detail."
          },
          {
            "name": "org_name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Organization legal name. Requires state."
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "2-letter US state code or full name \u2014 required with org_name; optional with ein (EIN queries fall back to a nationwide BMF search automatically)."
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Nonprofit financial profile with trend, red flags, and narrative"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.2,
        "x-agent-use-case": "due-diligence"
      }
    },
    "/api/grant/funder-990": {
      "get": {
        "summary": "Private foundation giving intelligence (IRS Form 990-PF)",
        "description": "Foundation giving intelligence from live IRS public data (EO Business Master File + SOI Form 990-PF Annual Extract) \u2014 grants-paid trend, conservative IRC 4942 payout status (appears_to_meet / possible_shortfall_signal / unable_to_verify \u2014 never asserts non-compliance), geographic/program focus, deterministic red flags. Public-domain alternative to paid foundation databases.",
        "operationId": "grantFunder990",
        "security": [
          {
            "x402": []
          }
        ],
        "parameters": [
          {
            "name": "ein",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{9}$"
            },
            "description": "9-digit EIN. Usable alone (financials are EIN-indexed nationwide) or with state for BMF registration detail."
          },
          {
            "name": "org_name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Foundation legal name. Requires state."
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "2-letter US state code or full name \u2014 required with org_name; optional with ein (EIN queries fall back to a nationwide BMF search automatically)."
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Foundation giving profile with payout compliance, trend, and red flags"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.25,
        "x-agent-use-case": "due-diligence"
      }
    }
  }
}
