> ## Documentation Index
> Fetch the complete documentation index at: https://solarium-1f74f072.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Township Climate

> 依座標查詢最近鄉鎮市的 12 個月 NASA POWER 氣候資料，並以 pvlib 計算最佳仰角。
前端 Results.tsx 用此取代靜態 TW_IRRADIANCE 三區常數與硬編碼 GOAL_ADJ。
回傳：(
  township_code, county_name,
  monthly_ghi:  [12 floats, kWh/m²/day],
  monthly_temp: [12 floats, °C],
  monthly_wind: [12 floats, m/s],
  best_angle:   int  (pvlib 最佳仰角，南向),
  goal_adj:     [12 floats]  (POA/GHI ratio，乘上 monthly_ghi 得有效輻照)
)



## OpenAPI

````yaml /openapi.json get /api/township
openapi: 3.1.0
info:
  title: Solar Money API
  version: 0.1.0
  description: >-
    Rooftop solar assessment API — buildings, shadows, climate, assessments, and
    vendor matching.
servers:
  - url: https://solarmoney.up.railway.app
    description: Production
security: []
tags:
  - name: Admin
    description: Admin-only operations (JWT or X-Admin-Secret)
  - name: Assessments
    description: Anonymous and authenticated assessment records
  - name: Authentication
    description: User registration and login
  - name: Buildings
    description: Building footprint queries (GBA DB → fallback → OSM)
  - name: Health
    description: Service health checks
  - name: Places
    description: Address autocomplete and geocoding proxies
  - name: Shadows
    description: Shadow geometry and usable roof area
  - name: Terrain & Climate
    description: DEM tiles, township climate, and tilt optimization
  - name: User Account
    description: Endpoints for logged-in users (JWT required)
  - name: Vendors
    description: Vendor listings, applications, and inquiries
paths:
  /api/township:
    get:
      tags:
        - Terrain & Climate
      summary: Get Township Climate
      description: |-
        依座標查詢最近鄉鎮市的 12 個月 NASA POWER 氣候資料，並以 pvlib 計算最佳仰角。
        前端 Results.tsx 用此取代靜態 TW_IRRADIANCE 三區常數與硬編碼 GOAL_ADJ。
        回傳：(
          township_code, county_name,
          monthly_ghi:  [12 floats, kWh/m²/day],
          monthly_temp: [12 floats, °C],
          monthly_wind: [12 floats, m/s],
          best_angle:   int  (pvlib 最佳仰角，南向),
          goal_adj:     [12 floats]  (POA/GHI ratio，乘上 monthly_ghi 得有效輻照)
        )
      operationId: get_township_climate_api_township_get
      parameters:
        - name: lat
          in: query
          required: true
          schema:
            type: number
            title: Lat
        - name: lng
          in: query
          required: true
          schema:
            type: number
            title: Lng
        - name: goal
          in: query
          required: false
          schema:
            type: string
            default: annual
            title: Goal
        - name: monthly_use
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Monthly Use
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````