{
  "schema_version": "1.0",
  "name": "rural-resource-locator",
  "display_name": "USDA Rural Resource Locator",
  "description": "Returns rural classification and USDA Rural Development program availability for a US ZIP code. Covers USDA Section 502 housing loans (Direct and Guaranteed), Section 515 Rural Rental Housing, Community Facilities grants, Water & Waste Disposal grants, Business & Industry loan guarantees, and ReConnect broadband grants. Includes income-based eligibility screening by household size. Data from Census Geocoding API + USDA Rural Development program rules.",
  "endpoint": "https://bacapi-rural-resource-api.workers.dev/rural",
  "method": "GET",
  "payment": {
    "protocol": "x402",
    "network":  "base",
    "currency": "USDC",
    "amount":   "0.08"
  },
  "routes": [
    {
      "path":        "/rural",
      "description": "Full rural profile: rural classification, available USDA programs, useful links, and next steps",
      "parameters": { "zip": "string — 5-digit ZIP (required)" }
    },
    {
      "path":        "/rural/programs",
      "description": "List all USDA Rural Development programs applicable to this area with descriptions and income requirements",
      "parameters": { "zip": "string — 5-digit ZIP (required)" }
    },
    {
      "path":        "/rural/eligibility",
      "description": "Income-based USDA program eligibility screening by household income and size",
      "parameters": {
        "zip":    "string — 5-digit ZIP (required)",
        "income": "number — annual household income in USD (required)",
        "size":   "integer — household size 1-8 (optional, default 4)"
      }
    }
  ],
  "response_shape": {
    "profile": {
      "zip":               "string",
      "state":             "string | null",
      "county":            "string | null",
      "coordinates":       "{ lat, lng } | null",
      "state_rural_pct":   "string — state-level % rural",
      "rural_indicators":  "object",
      "usda_programs_available": "string[]",
      "useful_links":      "object",
      "next_steps":        "string[]"
    },
    "eligibility": {
      "household":              "{ income, size }",
      "eligibility":            "{ guaranteed_eligible, direct_eligible, very_low_income, low_income, moderate_income, estimated_area_median }",
      "programs_likely_eligible":"string[]",
      "disclaimer":             "string"
    }
  },
  "example_request": "GET /rural/eligibility?zip=39401&income=48000&size=3",
  "example_response": {
    "data": {
      "zip":      "39401",
      "state":    "MS",
      "county":   "Forrest",
      "household": { "income": 48000, "size": 3 },
      "eligibility": {
        "guaranteed_eligible":    true,
        "direct_eligible":        true,
        "low_income":             true,
        "moderate_income":        true,
        "estimated_area_median":  72000
      },
      "programs_likely_eligible": [
        "USDA Section 502 Guaranteed Loan",
        "USDA Section 502 Direct Loan",
        "USDA Section 515 Rural Rental"
      ]
    },
    "meta": { "source": "Census Geocoding API + USDA Rural Development", "priced_at": "0.08 USDC" }
  },
  "tags": ["usda","rural","housing","loans","agriculture","poverty","eligibility","community-facilities","broadband","rural-development"],
  "category": "agriculture"
}
