{
  "openapi": "3.1.0",
  "info": {
    "title": "ClimatePulse API",
    "description": "Global climate and weather intelligence API. Open-Meteo real-time weather + AI synthesis. Severe weather assessment, air quality monitoring, wildfire smoke tracking, agricultural grow-day modeling, climate comparison, event weather planning, solar energy forecasting, and hyper-local forecasts. Covers 195 countries with 1km resolution weather data. Serves individuals, agricultural operators, event planners, outdoor recreation agents, and climate-sensitive businesses. Emergency preparedness, air purifier, solar energy, and outdoor gear affiliates included. All endpoints support any language via ?lang=. Pricing: $0.05\u2013$0.15 USDC/call via x402 micropayment.",
    "version": "1.2.0",
    "contact": {
      "url": "https://climatepulse-six.vercel.app"
    }
  },
  "servers": [
    {
      "url": "https://climatepulse-six.vercel.app"
    }
  ],
  "components": {
    "securitySchemes": {
      "x402": {
        "type": "apiKey",
        "in": "header",
        "name": "PAYMENT-SIGNATURE",
        "description": "x402 payment signature. Omit to receive a 402 with payment requirements."
      }
    }
  },
  "paths": {
    "/api/climate/now": {
      "get": {
        "summary": "Current conditions",
        "description": "Hyperlocal current weather with outdoor score, what to wear, hourly highlights, and Amazon + REI gear recommendations.",
        "operationId": "climateNow",
        "security": [
          {
            "x402": []
          }
        ],
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "City name or location (e.g. Denver, CO)"
          },
          {
            "name": "units",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "imperial",
                "metric"
              ]
            },
            "description": "Defaults to imperial (\u00b0F, mph, inches)"
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current conditions with outdoor score and gear recommendations"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.05,
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Real-time conditions \u2014 start here for any weather query; chain to /api/climate/forecast for extended outlook; chain to /api/climate/severe for risk assessment"
      }
    },
    "/api/climate/forecast": {
      "get": {
        "summary": "Multi-day forecast",
        "description": "7-day detailed forecast with per-day outdoor scores, best/worst day identification, packing essentials, and gear recommendations.",
        "operationId": "climateForecast",
        "security": [
          {
            "x402": []
          }
        ],
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 7
            },
            "description": "Number of days (1\u20137, default 7)"
          },
          {
            "name": "units",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "imperial",
                "metric"
              ]
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Multi-day forecast with planning insights and gear links"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.05,
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Extended weather forecast \u2014 chain after /api/climate/now; pairs with BiopPulse /api/bio/migrate for migration timing"
      }
    },
    "/api/climate/activity": {
      "get": {
        "summary": "Activity weather assessment",
        "description": "Go/no-go rating for outdoor activities (hiking, skiing, surfing, cycling, camping, running, golf, beach, fishing) with gear checklist and alternative dates.",
        "operationId": "climateActivity",
        "security": [
          {
            "x402": []
          }
        ],
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "activity",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "hiking",
                "skiing",
                "surfing",
                "cycling",
                "camping",
                "running",
                "golf",
                "beach",
                "fishing"
              ]
            }
          },
          {
            "name": "units",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "imperial",
                "metric"
              ]
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Activity assessment with go/no-go, gear checklist, and alternative dates"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.08,
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Activity weather suitability \u2014 outdoor gear + AllTrails affiliate links included; pairs with TravelPulse for trip planning"
      }
    },
    "/api/climate/severe": {
      "get": {
        "summary": "Severe weather and preparedness",
        "description": "Threat level assessment, active alerts, 24h + 3-day timeline, safety actions, preparedness checklist with Amazon links, shelter guidance, and emergency contacts.",
        "operationId": "climateSevere",
        "security": [
          {
            "x402": []
          }
        ],
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "units",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "imperial",
                "metric"
              ]
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Severe weather assessment with preparedness guide and emergency contacts"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.08,
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Severe weather assessment \u2014 emergency prep affiliate links auto-appended; chain to /api/climate/forecast for forward-looking timeline"
      }
    },
    "/api/climate/compare": {
      "get": {
        "summary": "Location climate comparison",
        "description": "Side-by-side weather comparison for 2\u20134 locations with per-location outdoor scores, pros/cons, week outlooks, and recommendations for vacation, relocation, or outdoor sports.",
        "operationId": "climateCompare",
        "security": [
          {
            "x402": []
          }
        ],
        "parameters": [
          {
            "name": "locations",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated list of 2\u20134 locations (e.g. Miami,Seattle,Denver)"
          },
          {
            "name": "purpose",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comparison purpose (e.g. vacation, relocation, sports)"
          },
          {
            "name": "units",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "imperial",
                "metric"
              ]
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Climate comparison with rankings, per-location breakdown, and recommendations"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.1,
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Climate comparison between cities/regions \u2014 pairs with TravelPulse for relocation or travel planning; solar potential included"
      }
    },
    "/api/climate/air": {
      "get": {
        "summary": "Real-time air quality + health risk assessment",
        "description": "AQI, PM2.5, PM10, ozone, NO2 with WHO guideline comparison and health recommendations. Covers 195 countries.",
        "x-agent-use-case": "on-demand",
        "x-price-usd": 0.05,
        "x-agent-chaining": "Air quality monitoring \u2014 wildfire smoke + AQHI analysis; air purifier + N95 mask affiliates auto-appended; global AQI data",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "City, address, or lat,lon"
          },
          {
            "name": "lang",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "x402Payment": []
          }
        ],
        "responses": {
          "200": {
            "description": "Air quality data with health guidance and affiliate links"
          }
        }
      }
    },
    "/api/climate/smoke": {
      "get": {
        "summary": "Wildfire smoke tracking and respiratory risk assessment",
        "description": "Real-time wildfire smoke plume tracking, AQI impact forecast, and evacuation zone guidance for 195 countries.",
        "x-agent-use-case": "on-demand",
        "x-price-usd": 0.08,
        "x-agent-chaining": "Wildfire smoke tracking \u2014 chain after /api/climate/air for source attribution; emergency prep + air quality affiliates included",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "x402Payment": []
          }
        ],
        "responses": {
          "200": {
            "description": "Smoke forecast with emergency preparedness affiliate links"
          }
        }
      }
    },
    "/api/climate/grow": {
      "get": {
        "summary": "Agricultural grow-day modeling and frost date analysis",
        "description": "Growing degree days (GDD), frost probability, soil temperature, and crop-specific planting windows. Covers all global agricultural zones.",
        "x-agent-use-case": "on-demand",
        "x-price-usd": 0.1,
        "x-agent-chaining": "Agricultural grow-day modeling \u2014 chain with HarvestPulse for full crop planning; soil temperature + frost date + GDD calculation",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "crop",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Target crop or plant type"
          },
          {
            "name": "lang",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "x402Payment": []
          }
        ],
        "responses": {
          "200": {
            "description": "Grow-day model with planting recommendations"
          }
        }
      }
    },
    "/api/climate/event": {
      "get": {
        "summary": "Event weather suitability and planning assessment",
        "description": "Weather suitability scoring for outdoor events, sports, festivals, and gatherings. Covers global venues with historical weather context.",
        "x-agent-use-case": "on-demand",
        "x-price-usd": 0.08,
        "x-agent-chaining": "Event weather planning \u2014 covers outdoor events, sports, gatherings; pairs with StatEdge for sports event weather",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "event_type",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lang",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "x402Payment": []
          }
        ],
        "responses": {
          "200": {
            "description": "Event weather suitability with outdoor gear affiliate links"
          }
        }
      }
    }
  }
}