> ## Documentation Index
> Fetch the complete documentation index at: https://docs.plantpredict.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a weather file

> Retrieves a single weather file's metadata (provider, location, time range, status). To fetch the actual hourly records, call `GET /Weather/{weatherId}/Detail`.



## OpenAPI

````yaml /api-docs/api-reference/plantpredict-api.yaml get /Weather/{weatherId}
openapi: 3.1.0
info:
  title: PlantPredict API
  version: 12.13.0
  description: >
    ## What is PlantPredict?


    PlantPredict is an industry-leading performance modeling platform for
    utility-scale

    solar power plants. It predicts energy yield across the full project
    lifecycle —

    from early-stage site prospecting through detailed engineering and
    operational

    monitoring. The same engine that powers the PlantPredict web UI is fully
    exposed

    via this REST API, enabling automation of complex, high-time-resolution
    energy

    predictions without any UI interaction.


    ## Domain Model — read this first


    Understanding the object hierarchy is essential before calling the API:


    - **Weather** — A weather file (hourly irradiance, temperature, wind, etc.)
    for a
      geographic location. Imported from a provider (e.g. SolarAnywhere, Meteonorm) or
      uploaded manually. Weather files live in a company-wide library and are referenced
      by Predictions.

    - **Module** — A PV module definition parameterized with electrical
    characteristics
      (STC power, temperature coefficients, single-diode model parameters, IAM curves,
      etc.). Modules live in a company-wide library.

    - **Inverter** — An inverter definition with efficiency curves,
    voltage/power ratings,
      and optional kVA derating curves. Inverters live in a company-wide library.

    - **Project** — A named location (lat/lon) that acts as a container for one
    or more
      Predictions. Holds geographic metadata (country, elevation, UTC offset) and a status.

    - **Prediction** — The core simulation configuration nested under a Project.
    Defines
      the simulation period, model selections (transposition, air mass, degradation,
      soiling, shading, spectral shift models), uncertainty error terms, and references
      to a Weather file. A Prediction must be linked to a PowerPlant before it can be run.
      Status values: 0 = Draft, 1 = Active, 2 = Issued, 3 = Archived.

    - **PowerPlant** — The physical plant design attached to a Prediction.
    Describes the
      electrical topology: Blocks → Arrays → Inverters → DC Fields (strings of modules).
      Also includes transformers, transmission lines, energy storage (ESS), availability
      losses, and LGIA export limits.

    - **Shade Scene** — An optional 3D shading model (PVJ format) attached to a
      Prediction's DC Fields. Supports import from PVC or SHD files. Shade and TABT
      (Tracker Angle Back-Tracking) calculations are queued and run asynchronously.

    ## Typical workflow to run a prediction


    1. Ensure a **Weather** file exists (search, download, or import one).

    2. Ensure a **Module** and **Inverter** exist in the library.

    3. **POST /Project** — create a project at the site location.

    4. **POST /Project/{projectId}/Prediction** — create a prediction with model
    settings.

    5. **POST /Project/{projectId}/Prediction/{predictionId}/PowerPlant** —
    attach a plant
       design referencing your module and inverter.
    6. **POST /Project/{projectId}/Prediction/{predictionId}/Run** — queue the
    simulation.

    7. Poll **GET /Project/{projectId}/Prediction/{predictionId}/Overview**
    until
       `status` reaches 2 (complete), then retrieve results via `/ResultSummary`,
       `/ResultDetails`, or `/NodalJson`.

    ## Authentication


    OAuth 2.0 **Client Credentials** flow via AWS Cognito. The spec advertises

    a single `bearerAuth` scheme — fetch a token yourself with the snippet

    below, then either paste it into the in-browser playground or pass it on

    every request as `Authorization: Bearer <token>`.


    > **Why not advertise OAuth2 directly?** Most users have access to the

    > production tenant only, and we don't want to invite anyone to enter

    > long-lived `client_id` / `client_secret` credentials into a third-party

    > documentation site. Keep credentials in your own environment; ship

    > short-lived bearer tokens to wherever they are needed.


    - Token URL:
    `https://terabase-prd.auth.us-west-2.amazoncognito.com/oauth2/token`

    - Scopes: `transactions/get` (read), `transactions/post` (write) — request
      both to access the entire surface.
    - Send credentials as **Basic Auth** in the token request header.


    Example:


    ```bash

    curl -X POST
    'https://terabase-prd.auth.us-west-2.amazoncognito.com/oauth2/token' \
      -u "$PP_CLIENT_ID:$PP_CLIENT_SECRET" \
      -d 'grant_type=client_credentials&scope=transactions/get transactions/post'
    ```


    API credentials (Client ID + Secret) are generated per user by a company
    admin

    inside the PlantPredict UI (gear icon → user profile → Generate API
    Credentials).

    Store them securely — they are shown only once.


    ## Notes


    - All request/response bodies are JSON (`Content-Type: application/json`).

    - The API is stateless — every request must supply complete inputs; there is
    no session.

    - POST operations that create entities return `{"id": <integer>}`.

    - Many integer fields (model types, status codes) map to named enums — use
      `GET /Definitions` to retrieve the full enum catalog at runtime.
    - Long-running operations (Run, Shade calculations, TABT) are asynchronous;
    poll
      the corresponding `ProcessingStatus` endpoint to track progress.
    - Responses may include an `X-Message` header with non-blocking warnings
    (e.g.
      duplicate project name).
servers:
  - url: https://api.plantpredict.terabase.energy
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Definitions
    description: Enum and model type definitions
  - name: Projects
    description: Solar project management
  - name: Predictions
    description: Energy prediction configuration and execution
  - name: PowerPlant
    description: Power plant design (blocks, arrays, inverters, transformers)
  - name: TimeSeries
    description: Custom time series data inputs
  - name: Results
    description: Prediction results — summary, details, nodal, average energy
  - name: FinancialModel
    description: Financial model parameters and cashflow results
  - name: Reports
    description: Report generation and export
  - name: ShadeScene
    description: 3D shade scene management and calculations
  - name: Weather
    description: Weather file import, download, and management
  - name: Inverters
    description: Inverter library management
  - name: Modules
    description: PV module library and single-diode parameter generation
  - name: ASHRAE
    description: ASHRAE climate station lookup
  - name: System
    description: System version and maintenance status
  - name: Company
    description: Company settings and user management
  - name: Country
    description: Reference country data
paths:
  /Weather/{weatherId}:
    get:
      tags:
        - Weather
      summary: Get a weather file
      description: >-
        Retrieves a single weather file's metadata (provider, location, time
        range, status). To fetch the actual hourly records, call `GET
        /Weather/{weatherId}/Detail`.
      operationId: getWeather
      parameters:
        - name: weatherId
          in: path
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Weather file
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WeatherFile'
              examples:
                postman-weather:
                  value:
                    status: 1
                    distance: 0
                    locality: Oxford
                    stateProvince: Nebraska
                    stateProvinceCode: NE
                    country: United States
                    countryCode: US
                    region: North America
                    source: Book2.xlsx
                    stationName: ''
                    format: 3
                    stationCode: null
                    latitude: 40.1932678
                    longitude: -99.7152252
                    elevation: 665
                    timeZone: -6
                    timestampDefinition: 0
                    timestampDefinitionOriginal: 0
                    timeInterval: 60
                    startDate: '2005-01-01T00:00:00'
                    endDate: '2005-01-01T23:00:00'
                    globalHorizontalIrradianceSum: 0.6
                    diffuseHorizontalIrradianceSum: 0.6
                    directNormalIrradianceSum: 0
                    planeOfArrayIrradianceSum: null
                    averageAirTemperature: 6.55
                    maxAirTemperature: 8.25
                    averageRelativeHumidity: 79.56
                    averageWindSpeed: 3.25
                    averagePrecipitableWater: null
                    averageDewpoint: null
                    averageSoilingLoss: null
                    rainfallSum: 4.57
                    weatherDataModelVersion: 8.1.2.15989
                    dataProvider: 4
                    pLevel: 0
                    windSensorHeight: 10
                    weatherDetails: null
                    dataType: 1
                    customerName: ''
                    apiLocked: false
                    apiDownloaded: false
                    weatherFileKey: 00000000-0000-0000-0000-000000000000
                    offsetMinutes: 0
                    usingSytemKey: false
                    moduleTilt: null
                    moduleAzimuth: null
                    trackingType: null
                    trackingBacktrackingType: 0
                    minimumTrackingLimitAngleD: 0
                    maximumTrackingLimitAngleD: null
                    trackerPitchAngleD: 0
                    trackerStowAngle: 0
                    groundCoverageRatio: null
                    id: 68915
                    name: Meteonorm - 40.193N - 99.715W
                    description: null
                    companyId: 1042
                    company: null
                    ownerId: 5093
                    owner:
                      claims: []
                      logins: []
                      roles: []
                      company: null
                      companyId: 1042
                      firstName: Jesse
                      lastName: Milam
                      jobTitle: Software Developer
                      createdByUserId: 5091
                      createdByUser: null
                      status: 1
                      settings: null
                      costCenter: null
                      migrationAgreementAcceptance: true
                      clientCredentialsCreatedOnUTC: '2022-07-05T20:04:50.863'
                      userWeatherDownloads: null
                      email: jmilam@terabase.energy
                      id: 5093
                    createdDate: '2022-12-22T20:20:16.477'
                    lastModified: '2022-12-22T20:20:16.477'
                    lastModifiedById: 5093
                    lastModifiedBy:
                      claims: []
                      logins: []
                      roles: []
                      company: null
                      companyId: 1042
                      firstName: Jesse
                      lastName: Milam
                      jobTitle: Software Developer
                      createdByUserId: 5091
                      createdByUser: null
                      status: 1
                      settings: null
                      costCenter: null
                      migrationAgreementAcceptance: true
                      clientCredentialsCreatedOnUTC: '2022-07-05T20:04:50.863'
                      userWeatherDownloads: null
                      email: jmilam@terabase.energy
                      id: 5093
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    WeatherFile:
      type: object
      required:
        - name
        - latitude
        - longitude
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        status:
          type: integer
          enum:
            - 0
            - 1
            - 2
            - 3
            - 4
            - 5
            - 6
          x-enum-varnames:
            - Unknown
            - DraftPrivate
            - DraftShared
            - Active
            - Retired
            - Global
            - GlobalRetired
          description: LibraryStatusEnum
        source:
          type: integer
          enum:
            - 0
            - 1
            - 2
            - 3
            - 4
            - 5
            - 6
            - 7
            - 8
            - 9
          x-enum-varnames:
            - Unknown
            - Meteonorm
            - CPRSolarAnywhere
            - NSRDBPSM
            - NSRDBSUNY
            - NSRDBMTS2
            - SolarGIS
            - NASA
            - Solcast
            - PVGIS
          description: WeatherSourceTypeAPIEnum
        stationName:
          type: string
        stationCode:
          type: string
        format:
          type: integer
          enum:
            - 1
            - 2
            - 3
            - 4
            - 5
            - 6
            - 7
            - 8
            - 9
            - 10
            - 11
            - 12
            - 13
            - 14
            - 15
          x-enum-varnames:
            - SolarProspectorCSV
            - NRELTMY3
            - MeteonormTMY3
            - V3Tier
            - AWS
            - EPW
            - GeoModelSolar
            - SolarAnywhere
            - PlantPredict
            - TMY3
            - SolarGIS
            - NASA
            - V3TierVaisala
            - Solcast
            - PVGIS
          description: WeatherFormat
        latitude:
          type: number
        longitude:
          type: number
        elevation:
          type: number
        timeZone:
          type: number
        timestampDefinition:
          type: integer
          enum:
            - 0
            - 1
            - 2
            - 3
          x-enum-varnames:
            - Undefined
            - IntervalEnd
            - IntervalBegin
            - IntervalMiddle
          description: WeatherTimestampDefinitionEnum
        timeInterval:
          type: integer
        startDate:
          type: string
          description: >-
            ISO-8601 datetime as returned by the PlantPredict API. May or may
            not include a timezone offset; treat as server-local when no offset
            is present.
        endDate:
          type: string
          description: >-
            ISO-8601 datetime as returned by the PlantPredict API. May or may
            not include a timezone offset; treat as server-local when no offset
            is present.
        dataProvider:
          type: integer
          enum:
            - 1
            - 2
            - 3
            - 4
            - 5
            - 6
            - 7
            - 8
            - 9
            - 10
            - 11
            - 12
            - 13
            - 14
            - 15
            - 16
            - 17
            - 18
            - 19
            - 20
            - 21
            - 22
            - 23
          x-enum-varnames:
            - NREL
            - AWSTruepower
            - WindLogics
            - Meteonorm
            - V3TIER
            - SolarAnywhere
            - GeoModelSolar
            - GeoSUNAfrica
            - SoDa
            - HelioClim
            - SolarResourceAssessment
            - EnergyPlus
            - Other
            - Customer
            - SolarProspector
            - GlobalFED
            - NSRDB
            - WhiteBoxTechnologies
            - SolarGIS
            - NASA
            - V3TIERVaisala
            - Solcast
            - PVGIS
          description: WeatherDataProvider
        dataType:
          type: integer
          enum:
            - 0
            - 1
            - 2
            - 3
            - 4
            - 5
            - 6
            - 7
            - 8
            - 9
            - 10
          x-enum-varnames:
            - SyntheticMonthly
            - Satellite
            - GroundCorrected
            - Measured
            - TMY3
            - TGY
            - TMY
            - PSM
            - SUNY
            - MTS2
            - CZ2010
          description: WeatherDataType
        country:
          type: string
        countryCode:
          type: string
        stateProvince:
          type: string
        stateProvinceCode:
          type: string
        locality:
          type: string
        region:
          type: string
        globalHorizontalIrradianceSum:
          type: number
        diffuseHorizontalIrradianceSum:
          type: number
        directNormalIrradianceSum:
          type: number
        planeOfArrayIrradianceSum:
          type: number
        averageAirTemperature:
          type: number
        averageWindSpeed:
          type: number
        weatherDetails:
          type: array
          items:
            type: object
        pLevel:
          type: number
        windSensorHeight:
          type: number
        offsetMinutes:
          type: integer
        moduleTilt:
          type: number
        moduleAzimuth:
          type: number
        trackingType:
          type: integer
          enum:
            - 0
            - 1
            - 2
          x-enum-varnames:
            - FixedTilt
            - HorizontalTracker
            - SeasonalTilt
          description: DCFieldTrackingTypeEnum
        groundCoverageRatio:
          type: number
        companyId:
          type: integer
          readOnly: true
        createdDate:
          type: string
          readOnly: true
          description: >-
            ISO-8601 datetime as returned by the PlantPredict API. May or may
            not include a timezone offset; treat as server-local when no offset
            is present.
  responses:
    Unauthorized:
      description: >-
        Missing or invalid bearer token. The response body is empty and no
        `Content-Type` header is set; the 401 status code is the only signal.
        Fetch a fresh token (see the **Authentication** section of the API
        description) and retry.
    NotFound:
      description: >-
        The referenced resource does not exist or is not accessible to the
        caller.
      content:
        text/plain:
          schema:
            type: string
          example: Project not found.
    ServerError:
      description: |
        Unexpected server-side error. The body is usually a plain-text message
        but its structure is not guaranteed — treat it as opaque diagnostic
        text. Common causes: database constraint violation, downstream
        service timeout, internal exception. Retry-safe for idempotent
        requests; for non-idempotent ones, verify state before retrying.
      content:
        text/plain:
          schema:
            type: string
          example: An error has occurred.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Pass `Authorization: Bearer <token>` on every request. See the
        **Authentication** section of the API description for how to fetch a
        token.

````