---
title: "POST /weather-data:fetch"
method: POST
path: "/weather-data:fetch"
tags: ["WeatherData"]
---

# POST /weather-data:fetch

`POST /weather-data:fetch`

Returns a list of WeatherData.

## Query parameters

- `api-version` string, required

## Request body

- WeatherDataProviderRequest — Schema of weather data provider request.
  - `credentials` ApiKeyAuthCredentials — AuthCredentials abstract base class for Auth Purpose.
    - `kind` 'OAuthClientCredentials' | 'ApiKeyAuthCredentials', required — Enum for different types of AuthCredentials supported.
    - `apiKey` KeyVaultProperties, required — Properties of the key vault.
      - `keyVaultUri` string, required — Uri of the key vault.
      - `keyName` string, required — Name of Key Vault key.
      - `keyVersion` string, required — Version of Key Vault key.
  - `locations` WeatherLocation[] — List of locations for which weather data need to be fetched from the provider.
    - `type` 'LatLong' | 'IataCode' | 'IcaoCode' | 'PlaceId' | 'PostalKey', required — Location Type eg. LatLong/IataCode/IcaoCode/Placeid/PostalKey.
    - `value` string, required — Location Value eg. "10,-25" for LocationType Type "LatLong".
  - `extensionId` string, required — Id of the extension to be used for the providerInput. eg. DTN.ClearAg.
  - `extensionApiName` string, required — Extension api name to which request is to be made.
  - `language` string — Language (IETF BCP 47 language tag) in which search results should be returned by the data provider. Examples: 'en-US', 'es', 'es-MX', 'fr-FR'.
  - `startTimeHours` integer — Start of time range. Hour 0 represents the current hour. (Only applicable for DTN.ClearAg extension.)
  - `endTimeHours` integer — End of time range. (Only applicable for DTN.ClearAg extension.)
  - `duration` integer — Specifies for how many days the daily forecast responses are returned. Available values are 1, 5, 10, 25 and 45. (Only applicable for Azure Weather Maps extension.)
  - `units` string, required — Units for which request to data provider is to be sent. Supported values are 'e' for English units, 'm' for Metric units, 'h' for Hybrid units (UK) and 's' for Metric SI units.
  - `additionalParams` AdditionalProviderParameters — Schema of additional parameters for weather data provider request.
    - `iconResolution` string — Icon Resolution (Only applicable for AzureWeatherMaps).
    - `details` boolean — Details (Only applicable for AzureWeatherMaps).

## Response `200`

Success

- WeatherDataProviderResponse — Schema of Weather Data Provider Response.
  - `weatherMetadata` WeatherMetadata, required — Schema of Weather Metadata.
    - `extensionVersion` string, required — Version of the weather data extension.
    - `weatherDataType` string, required — Type of weather data (forecast/historical).
    - `extensionId` string, required — Id of the extension to be used for the providerInput. eg. DTN.ClearAg.
    - `extensionApiName` string, required — Extension api name to which request is to be made.
    - `language` string — Language (IETF BCP 47 language tag) in which search results should be returned by the data provider. Examples: 'en-US', 'es', 'es-MX', 'fr-FR'.
    - `startTimeHours` integer — Start of time range. Hour 0 represents the current hour. (Only applicable for DTN.ClearAg extension.)
    - `endTimeHours` integer — End of time range. (Only applicable for DTN.ClearAg extension.)
    - `duration` integer — Specifies for how many days the daily forecast responses are returned. Available values are 1, 5, 10, 25 and 45. (Only applicable for Azure Weather Maps extension.)
    - `units` string, required — Units for which request to data provider is to be sent. Supported values are 'e' for English units, 'm' for Metric units, 'h' for Hybrid units (UK) and 's' for Metric SI units.
    - `additionalParams` AdditionalProviderParameters — Schema of additional parameters for weather data provider request.
      - `iconResolution` string — Icon Resolution (Only applicable for AzureWeatherMaps).
      - `details` boolean — Details (Only applicable for AzureWeatherMaps).
  - `status` 'Succeeded' | 'Failed' | 'PartiallySucceeded' — Indicates a Succeeded, Failed, or PartiallySucceeded response.
  - `locations` WeatherLocationData[] — List of weather data for all the weather locations.
    - `location` WeatherLocation — Schema of Location data.
      - `type` 'LatLong' | 'IataCode' | 'IcaoCode' | 'PlaceId' | 'PostalKey', required — Location Type eg. LatLong/IataCode/IcaoCode/Placeid/PostalKey.
      - `value` string, required — Location Value eg. "10,-25" for LocationType Type "LatLong".
    - `requestCompletionTime` string — Request Completion Time in Utc of the location.
    - `lastRefreshedDateTime` string, date-time — Date-time when resource was last requested, sample format: yyyy-MM-ddTHH:mm:ssZ.
    - `data` WeatherDataForPassthrough — Schema of weather data.
      - `additionalAttributes` object — A collection of key value pairs that belongs to the resource. Each pair must not have a key greater than 50 characters and must not have a value greater than 250 characters. Note: A maximum of 100 key value pairs can be provided for a resource and only string and numeral values are supported.
      - `wetBulbTemperature` Measures — Schema for storing measurement readings and unit.
        - `unit` string — Data unit.
        - `value` number[] — Data values.
      - `cloudCover` Measures — Schema for storing measurement readings and unit.
        - `unit` string — Data unit.
        - `value` number[] — Data values.
      - `dayOfWeek` string[] — Day of week.
      - `dayOrNight` string[] — This data field indicates whether it is daytime or nighttime based on the Local Apparent Time of the location.
      - `expirationTime` string[] — Expiration time in Utc format.
      - `iconCode` integer[] — This number is the key to the weather icon lookup. The data field shows the icon number that is matched to represent the observed weather conditions.
      - `iconCodeExtend` integer[] — Code representing full set sensible weather.
      - `hasPrecipitation` boolean[] — Indicates whether there is precipitation or not.
      - `pressureMeanSeaLevel` Measures — Schema for storing measurement readings and unit.
        - `unit` string — Data unit.
        - `value` number[] — Data values.
      - `relativeHumidity` Measures — Schema for storing measurement readings and unit.
        - `unit` string — Data unit.
        - `value` number[] — Data values.
      - `temperature` Measures — Schema for storing measurement readings and unit.
        - `unit` string — Data unit.
        - `value` number[] — Data values.
      - `temperatureDewPoint` Measures — Schema for storing measurement readings and unit.
        - `unit` string — Data unit.
        - `value` number[] — Data values.
      - `temperatureFeelsLike` Measures — Schema for storing measurement readings and unit.
        - `unit` string — Data unit.
        - `value` number[] — Data values.
      - `temperatureHeatIndex` Measures — Schema for storing measurement readings and unit.
        - `unit` string — Data unit.
        - `value` number[] — Data values.
      - `temperatureWindChill` Measures — Schema for storing measurement readings and unit.
        - `unit` string — Data unit.
        - `value` number[] — Data values.
      - `uvDescription` string[] — The UV Index Description which complements the UV Index value by providing an associated level of risk of skin damage due to exposure (-2 = Not Available, -1 = No Report, 0 to 2 = Low, 3 to 5 = Moderate, 6 to 7 = High, 8 to 10 = Very High, 11 to 16 = Extreme).
      - `uvIndex` number[] — Hourly maximum UV index.
      - `validTimeLocal` string[] — Time forecast is valid in local apparent time.
      - `validTime` string[] — Time forecast is valid in Utc format.
      - `visibility` Measures — Schema for storing measurement readings and unit.
        - `unit` string — Data unit.
        - `value` number[] — Data values.
      - `windDirection` Measures — Schema for storing measurement readings and unit.
        - `unit` string — Data unit.
        - `value` number[] — Data values.
      - `windGust` Measures — Schema for storing measurement readings and unit.
        - `unit` string — Data unit.
        - `value` number[] — Data values.
      - `windSpeed` Measures — Schema for storing measurement readings and unit.
        - `unit` string — Data unit.
        - `value` number[] — Data values.
      - `wxPhraseLong` string[] — Hourly sensible weather phrase containing longer description.
      - `wxPhraseShort` string[] — Hourly sensible weather phrase containing short description.
  - `errors` WeatherDataErrors — Model for errors encountered for all failed locations.
    - `locations` ErrorForLocation[] — List of errors encountered for all failed locations.
      - `location` WeatherLocation — Schema of Location data.
        - `type` 'LatLong' | 'IataCode' | 'IcaoCode' | 'PlaceId' | 'PostalKey', required — Location Type eg. LatLong/IataCode/IcaoCode/Placeid/PostalKey.
        - `value` string, required — Location Value eg. "10,-25" for LocationType Type "LatLong".
      - `code` integer — Status code returned by data provider.
      - `description` string — Description of the error.
      - `retryable` boolean — Flag suggesting if retry attempt with same request body should be made to fetch required data.

## Other responses

- `default` — Error

---

[API](https://skmtc.net/azure/apis/agrifood-agfoodplatform.md) · [All operations](https://skmtc.net/azure/apis/agrifood-agfoodplatform/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/agrifood-agfoodplatform/revisions/33cf1de6e0c4/schema)
