OpenAgri Weather Service

FastAPI-based weather service providing 5-day forecasts, current conditions, Temperature-Humidity Index (THI) for livestock heat stress, UAV flight condition forecasts, and spray condition assessments. Supports both JSON and JSON-LD/OCSM output formats for linked data interoperability. Part of the OpenAgri EU Horizon Europe project.

Documentation

Specifications

Examples

📝
Example
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-openagri-weather-service-predictionout-example.json
📝
Example
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-openagri-weather-service-weatherdataout-example.json
📝
Example
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-openagri-weather-service-thidataout-example.json
📝
Example
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-openagri-weather-service-sprayforecastresponse-example.json
📝
Example
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-openagri-weather-service-flightstatusforecastresponse-example.json
📝
Example
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-openagri-weather-service-geojsonout-example.json
📝
Example
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-openagri-weather-service-jsonldgraph-example.json
📝
Example
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-openagri-weather-service-authtoken-example.json
📝
Example
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-openagri-weather-service-pointout-example.json
📝
Example
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-openagri-weather-service-validationerror-example.json
📝
Example
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-openagri-weather-service-httpvalidationerror-example.json
📝
Example
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-openagri-weather-service-body-token-auth-token-post-example.json

Schemas & Data

📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-openagri-weather-service-predictionout-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-openagri-weather-service-weatherdataout-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-openagri-weather-service-thidataout-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-openagri-weather-service-sprayforecastresponse-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-openagri-weather-service-flightstatusforecastresponse-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-openagri-weather-service-geojsonout-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-openagri-weather-service-jsonldgraph-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-openagri-weather-service-authtoken-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-openagri-weather-service-pointout-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-openagri-weather-service-validationerror-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-openagri-weather-service-httpvalidationerror-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-openagri-weather-service-body-token-auth-token-post-schema.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-openagri-weather-service-predictionout-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-openagri-weather-service-weatherdataout-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-openagri-weather-service-thidataout-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-openagri-weather-service-sprayforecastresponse-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-openagri-weather-service-flightstatusforecastresponse-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-openagri-weather-service-geojsonout-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-openagri-weather-service-jsonldgraph-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-openagri-weather-service-authtoken-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-openagri-weather-service-pointout-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-openagri-weather-service-validationerror-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-openagri-weather-service-httpvalidationerror-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-openagri-weather-service-body-token-auth-token-post-structure.json

OpenAPI Specification

agstack-openagri-weather-service-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: OpenAgri Weather service
  summary: This is OpenAPI for OpenAgri Weather service
  version: 2.5.0
paths:
  /api/data/forecast5:
    get:
      summary: Get Weather Forecast5Days
      operationId: get_weather_forecast5days_api_data_forecast5_get
      security:
        - HTTPBearer: []
      parameters:
        - name: lat
          in: query
          required: true
          schema:
            type: number
            title: Lat
        - name: lon
          in: query
          required: true
          schema:
            type: number
            title: Lon
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PredictionOut'
                title: Response Get Weather Forecast5Days Api Data Forecast5 Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/linkeddata/forecast5:
    get:
      summary: Get Weather Forecast5Days Ld
      operationId: get_weather_forecast5days_ld_api_linkeddata_forecast5_get
      security:
        - HTTPBearer: []
      parameters:
        - name: lat
          in: query
          required: true
          schema:
            type: number
            title: Lat
        - name: lon
          in: query
          required: true
          schema:
            type: number
            title: Lon
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/data/weather:
    get:
      summary: Get Weather
      operationId: get_weather_api_data_weather_get
      security:
        - HTTPBearer: []
      parameters:
        - name: lat
          in: query
          required: true
          schema:
            type: number
            title: Lat
        - name: lon
          in: query
          required: true
          schema:
            type: number
            title: Lon
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WeatherDataOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/data/thi:
    get:
      summary: Get Thi
      operationId: get_thi_api_data_thi_get
      security:
        - HTTPBearer: []
      parameters:
        - name: lat
          in: query
          required: true
          schema:
            type: number
            title: Lat
        - name: lon
          in: query
          required: true
          schema:
            type: number
            title: Lon
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/THIDataOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/linkeddata/thi:
    get:
      summary: Get Thi Ld
      operationId: get_thi_ld_api_linkeddata_thi_get
      security:
        - HTTPBearer: []
      parameters:
        - name: lat
          in: query
          required: true
          schema:
            type: number
            title: Lat
        - name: lon
          in: query
          required: true
          schema:
            type: number
            title: Lon
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JSONLDGraph'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/data/flight_forecast5:
    get:
      summary: Get Flight Forecast For All Uavs
      operationId: get_flight_forecast_for_all_uavs_api_data_flight_forecast5_get
      security:
        - HTTPBearer: []
      parameters:
        - name: lat
          in: query
          required: true
          schema:
            type: number
            title: Lat
        - name: lon
          in: query
          required: true
          schema:
            type: number
            title: Lon
        - name: uavmodels
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
              - type: 'null'
            title: Uavmodels
        - name: status_filter
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
              - type: 'null'
            title: Status Filter
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FlightStatusForecastResponse'
                title: >-
                  Response Get Flight Forecast For All Uavs Api Data Flight
                  Forecast5 Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/linkeddata/flight_forecast5:
    get:
      summary: Get Flight Forecast For All Uavs Ld
      operationId: get_flight_forecast_for_all_uavs_ld_api_linkeddata_flight_forecast5_get
      security:
        - HTTPBearer: []
      parameters:
        - name: lat
          in: query
          required: true
          schema:
            type: number
            title: Lat
        - name: lon
          in: query
          required: true
          schema:
            type: number
            title: Lon
        - name: uavmodels
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
              - type: 'null'
            title: Uavmodels
        - name: status_filter
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
              - type: 'null'
            title: Status Filter
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  '/api/data/flight_forecast5/{uavmodel}':
    get:
      summary: Get Flight Forecast For Uav
      operationId: get_flight_forecast_for_uav_api_data_flight_forecast5__uavmodel__get
      security:
        - HTTPBearer: []
      parameters:
        - name: uavmodel
          in: path
          required: true
          schema:
            type: string
            title: Uavmodel
        - name: lat
          in: query
          required: true
          schema:
            type: number
            title: Lat
        - name: lon
          in: query
          required: true
          schema:
            type: number
            title: Lon
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FlightStatusForecastResponse'
                title: >-
                  Response Get Flight Forecast For Uav Api Data Flight
                  Forecast5  Uavmodel  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  '/api/linkeddata/flight_forecast5/{uavmodel}':
    get:
      summary: Get Flight Forecast For Uav Ld
      operationId: >-
        get_flight_forecast_for_uav_ld_api_linkeddata_flight_forecast5__uavmodel__get
      security:
        - HTTPBearer: []
      parameters:
        - name: uavmodel
          in: path
          required: true
          schema:
            type: string
            title: Uavmodel
        - name: lat
          in: query
          required: true
          schema:
            type: number
            title: Lat
        - name: lon
          in: query
          required: true
          schema:
            type: number
            title: Lon
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/data/spray_forecast:
    get:
      summary: Get Spray Forecast
      operationId: get_spray_forecast_api_data_spray_forecast_get
      security:
        - HTTPBearer: []
      parameters:
        - name: lat
          in: query
          required: true
          schema:
            type: number
            title: Lat
        - name: lon
          in: query
          required: true
          schema:
            type: number
            title: Lon
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SprayForecastResponse'
                title: Response Get Spray Forecast Api Data Spray Forecast Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/linkeddata/spray_forecast:
    get:
      summary: Get Spray Forecast Ld
      operationId: get_spray_forecast_ld_api_linkeddata_spray_forecast_get
      security:
        - HTTPBearer: []
      parameters:
        - name: lat
          in: query
          required: true
          schema:
            type: number
            title: Lat
        - name: lon
          in: query
          required: true
          schema:
            type: number
            title: Lon
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /auth/test:
    get:
      summary: Get Payload
      operationId: get_payload_auth_test_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
      security:
        - HTTPBearer: []
  /auth/token:
    post:
      summary: Token
      operationId: token_auth_token_post
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Body_token_auth_token_post'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthToken'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AuthToken:
      properties:
        jwt_token:
          type: string
          title: Jwt Token
      type: object
      required:
        - jwt_token
      title: AuthToken
    Body_token_auth_token_post:
      properties:
        grant_type:
          anyOf:
            - type: string
              pattern: password
            - type: 'null'
          title: Grant Type
        username:
          type: string
          title: Username
        password:
          type: string
          title: Password
        scope:
          type: string
          title: Scope
          default: ''
        client_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Id
        client_secret:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Secret
      type: object
      required:
        - username
        - password
      title: Body_token_auth_token_post
    FlightStatusForecastResponse:
      properties:
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        uav_model:
          type: string
          title: Uav Model
        status:
          type: string
          title: Status
        weather_source:
          type: string
          title: Weather Source
        location:
          $ref: '#/components/schemas/GeoJSONOut'
        weather_params:
          additionalProperties:
            type: number
          type: object
          title: Weather Params
      type: object
      required:
        - timestamp
        - uav_model
        - status
        - weather_source
        - location
        - weather_params
      title: FlightStatusForecastResponse
    GeoJSONOut:
      properties:
        type:
          $ref: '#/components/schemas/GeoJSONTypeEnum'
        coordinates:
          items: {}
          type: array
          title: Coordinates
      type: object
      required:
        - type
        - coordinates
      title: GeoJSONOut
    GeoJSONTypeEnum:
      type: string
      enum:
        - Point
        - POLYGON
      title: GeoJSONTypeEnum
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    JSONLDGraph:
      properties:
        '@context':
          items:
            anyOf:
              - type: string
              - type: object
          type: array
          title: '@Context'
        '@graph':
          items:
            type: object
          type: array
          title: '@Graph'
      type: object
      required:
        - '@context'
        - '@graph'
      title: JSONLDGraph
    PointOut:
      properties:
        location:
          $ref: '#/components/schemas/GeoJSONOut'
      type: object
      required:
        - location
      title: PointOut
    PredictionOut:
      properties:
        value:
          type: number
          title: Value
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        source:
          type: string
          title: Source
        spatial_entity:
          $ref: '#/components/schemas/PointOut'
        data_type:
          type: string
          title: Data Type
        measurement_type:
          type: string
          title: Measurement Type
      type: object
      required:
        - value
        - timestamp
        - source
        - spatial_entity
        - data_type
        - measurement_type
      title: PredictionOut
    SprayForecastResponse:
      properties:
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        spray_conditions:
          $ref: '#/components/schemas/SprayStatus'
        source:
          type: string
          title: Source
        location:
          $ref: '#/components/schemas/GeoJSONOut'
        detailed_status:
          additionalProperties:
            type: string
          type: object
          title: Detailed Status
      type: object
      required:
        - timestamp
        - spray_conditions
        - source
        - location
        - detailed_status
      title: SprayForecastResponse
    SprayStatus:
      type: string
      enum:
        - optimal
        - marginal
        - unsuitable
      title: SprayStatus
    THIDataOut:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        spatial_entity:
          $ref: '#/components/schemas/PointOut'
        thi:
          type: number
          title: Thi
      type: object
      required:
        - id
        - spatial_entity
        - thi
      title: THIDataOut
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    WeatherDataOut:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        spatial_entity:
          $ref: '#/components/schemas/PointOut'
        data:
          type: object
          title: Data
      type: object
      required:
        - id
        - spatial_entity
        - data
      title: WeatherDataOut
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer