Weather - Get Daily Historical Normals

用來取得特定位置的過去每日正常溫度、濕度和冷卻/熱度日資訊等氣候數據。

Get Daily Historical Normals API 是一項 HTTP GET 要求,會傳回過去每日正常溫度、濕度和冷卻/熱度日資訊,以及指定座標位置當天的氣象數據。 歷史常態是特定位置的溫度和濕度的30年平均值。 如同 climatology 的標準做法,30 年平均涵蓋 1991-2020 年,此數據將用於 10 年,然後在 2030 年重設。 一般而言,根據位置而定,過去 5 到 40 年的時間可能會有歷史數據可用。

GET https://atlas.microsoft.com/weather/historical/normals/daily/json?api-version=1.1&query={query}&startDate={startDate}&endDate={endDate}
GET https://atlas.microsoft.com/weather/historical/normals/daily/json?api-version=1.1&query={query}&startDate={startDate}&endDate={endDate}&unit={unit}

URI 參數

名稱 位於 必要 類型 Description
format
path True

JsonFormat

所需的回應格式。 僅支援 json 格式。

api-version
query True

string

Azure 地圖服務 API 的版本號碼。

endDate
query True

string

date

ISO 8601 格式的結束日期,例如 2019-10-28。 支援的日期範圍是 1 到 31 個行事曆天,因此請務必指定 startDate 和 endDate,其不超過最多 31 天 (,亦即:startDate=2012-01-01&endDate=2012-01-31) 。

query
query True

number[]

指定為逗號分隔字串的適用查詢,後面接著經度,例如 “47.641268,-122.125679”。

startDate
query True

string

date

ISO 8601 格式的開始日期,例如 2019-10-27。 支援的日期範圍是 1 到 31 個行事曆天,因此請務必指定 startDate 和 endDate,其不超過最多 31 天 (,亦即:startDate=2012-01-01&endDate=2012-01-31) 。

unit
query

WeatherDataUnit

指定以計量單位或英制單位傳回數據。 預設值為計量。

要求標頭

名稱 必要 類型 Description
x-ms-client-id

string

指定哪一個帳戶用於搭配 Microsoft Entra ID 安全性模型使用。 它代表 Azure 地圖服務 帳戶的唯一標識符,可以從 Azure 地圖服務 管理平面帳戶 API 擷取。 若要在 Azure 地圖服務 中使用 Microsoft Entra ID 安全性,請參閱下列文章以取得指引。

回應

名稱 類型 Description
200 OK

DailyHistoricalNormalsResult

確定

Other Status Codes

ErrorResponse

發生意外錯誤。

安全性

AADToken

這些是 Microsoft Entra OAuth 2.0 流程。 與 Azure 角色型存取控制配對時,可用來控制對 REST API 的存取 Azure 地圖服務。 Azure 角色型訪問控制可用來指定一或多個 Azure 地圖服務 資源帳戶或子資源的存取權。 任何使用者、群組或服務主體都可以透過內建角色或由一或多個許可權組成的自定義角色來授與存取權,以 Azure 地圖服務 REST API。

若要實作案例,建議您檢視 驗證概念。 總而言之,此安全性定義提供一個解決方案,可透過能夠針對特定 API 和範圍進行存取控制的物件,將應用程式模型化 () 。

備註

  • 此安全性定義需要使用x-ms-client-id 標頭來指出應用程式要求存取權 Azure 地圖服務 資源。 這可以從 地圖服務管理 API 取得。

Authorization URL專屬於 Azure 公用雲端實例。 主權雲端具有唯一的授權 URL 和 Microsoft Entra ID 組態。 * 透過 Azure 入口網站、PowerShell、CLI、Azure SDK 或 REST API,從 Azure 管理平面設定 Azure 角色型存取控制。 * Azure 地圖服務 Web SDK 的使用方式允許針對多個使用案例設定應用程式。

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名稱 Description
https://atlas.microsoft.com/.default https://atlas.microsoft.com/.default

subscription-key

這是當您 Create Azure 入口網站 中的 Azure 地圖服務 帳戶或使用PowerShell、CLI、Azure SDK 或 REST API 時所佈建的共用密鑰。

使用此金鑰時,任何應用程式都可以存取所有 REST API。 換句話說,此金鑰可作為發行帳戶中的主要金鑰。

對於公開的應用程式,我們建議使用機密用戶端應用程式方法來存取 Azure 地圖服務 REST API,以便安全地儲存密鑰。

Type: apiKey
In: query

SAS Token

這是透過 Azure 管理平面透過 Azure 入口網站、PowerShell、CLI、Azure SDK 或 REST API,從 Azure 地圖服務 資源上的列出 SAS 作業建立共用存取簽章令牌。

使用此令牌時,任何應用程式都有權使用 Azure 角色型訪問控制進行存取,並精細控制到期、速率和區域 (特定令牌的使用) 。 換句話說,SAS 令牌可用來允許應用程式以比共用密鑰更安全的方式控制存取。

對於公開的應用程式,我們建議在 地圖帳戶資源 上設定允許的來源特定清單,以限制轉譯濫用,並定期更新 SAS 令牌。

Type: apiKey
In: header

範例

Successful Daily Historical Normals Request

Sample Request

GET https://atlas.microsoft.com/weather/historical/normals/daily/json?api-version=1.1&query=39.952583,-75.165222&startDate=2012-01-20&endDate=2012-01-22

Sample Response

{
  "results": [
    {
      "date": "2012-01-20T00:00:00-04:00",
      "temperature": {
        "maximum": {
          "value": 4.4,
          "unit": "C",
          "unitType": 17
        },
        "minimum": {
          "value": -3.7,
          "unit": "C",
          "unitType": 17
        },
        "average": {
          "value": 0.4,
          "unit": "C",
          "unitType": 17
        }
      },
      "degreeDaySummary": {
        "heating": {
          "value": 18,
          "unit": "C",
          "unitType": 17
        },
        "cooling": {
          "value": 0,
          "unit": "C",
          "unitType": 17
        }
      },
      "precipitation": {
        "value": 2.5,
        "unit": "mm",
        "unitType": 3
      }
    },
    {
      "date": "2012-01-21T00:00:00-04:00",
      "temperature": {
        "maximum": {
          "value": 4.5,
          "unit": "C",
          "unitType": 17
        },
        "minimum": {
          "value": -3.7,
          "unit": "C",
          "unitType": 17
        },
        "average": {
          "value": 0.4,
          "unit": "C",
          "unitType": 17
        }
      },
      "degreeDaySummary": {
        "heating": {
          "value": 18,
          "unit": "C",
          "unitType": 17
        },
        "cooling": {
          "value": 0,
          "unit": "C",
          "unitType": 17
        }
      },
      "precipitation": {
        "value": 2.5,
        "unit": "mm",
        "unitType": 3
      }
    },
    {
      "date": "2012-01-22T00:00:00-04:00",
      "temperature": {
        "maximum": {
          "value": 4.5,
          "unit": "C",
          "unitType": 17
        },
        "minimum": {
          "value": -3.7,
          "unit": "C",
          "unitType": 17
        },
        "average": {
          "value": 0.4,
          "unit": "C",
          "unitType": 17
        }
      },
      "degreeDaySummary": {
        "heating": {
          "value": 18,
          "unit": "C",
          "unitType": 17
        },
        "cooling": {
          "value": 0,
          "unit": "C",
          "unitType": 17
        }
      },
      "precipitation": {
        "value": 2.3,
        "unit": "mm",
        "unitType": 3
      }
    }
  ]
}

定義

名稱 Description
DailyHistoricalNormals
DailyHistoricalNormalsResult
DegreeDaySummary
ErrorAdditionalInfo

資源管理錯誤其他資訊。

ErrorDetail

錯誤詳細數據。

ErrorResponse

錯誤回應

JsonFormat

所需的回應格式。 僅支援 json 格式。

UnitType

與所顯示單位類型相關聯的數值標識碼。 可用於單元翻譯。 如需詳細資訊,請參閱 Azure 地圖服務 中的天氣服務

WeatherDataUnit

指定以計量單位或英制單位傳回數據。 預設值為計量。

WeatherUnit

與天氣相關的指定單位特定值。

WeatherUnitMaxMinAvg

傳回的溫度值。

DailyHistoricalNormals

名稱 類型 Description
date

string

以 ISO 8601 格式顯示的目前觀察日期和時間,例如 2019-10-27T19:39:57-08:00。

degreeDaySummary

DegreeDaySummary

熱度或冷卻度日資訊的摘要

precipitation

WeatherUnit

(已經下降的相等) 的雨量。

temperature

WeatherUnitMaxMinAvg

溫度值。

DailyHistoricalNormalsResult

名稱 類型 Description
nextLink

string

是傳回之功能下一頁的連結。 如果是最後一頁,則沒有此欄位。

results

DailyHistoricalNormals[]

每個要求日期的歷史常態。

DegreeDaySummary

名稱 類型 Description
cooling

WeatherUnit

平均溫度高於 65 度 F/ 18 度 C 的度數。

heating

WeatherUnit

平均溫度低於 65 度 F/ 18 度 C 的度數。

ErrorAdditionalInfo

資源管理錯誤其他資訊。

名稱 類型 Description
info

object

其他資訊。

type

string

其他信息類型。

ErrorDetail

錯誤詳細數據。

名稱 類型 Description
additionalInfo

ErrorAdditionalInfo[]

錯誤其他資訊。

code

string

錯誤碼。

details

ErrorDetail[]

錯誤詳細資料。

message

string

錯誤訊息。

target

string

錯誤目標。

ErrorResponse

錯誤回應

名稱 類型 Description
error

ErrorDetail

error 物件。

JsonFormat

所需的回應格式。 僅支援 json 格式。

名稱 類型 Description
json

string

JavaScript 物件表示法數據交換格式

UnitType

與所顯示單位類型相關聯的數值標識碼。 可用於單元翻譯。 如需詳細資訊,請參閱 Azure 地圖服務 中的天氣服務

名稱 類型 Description
0

Integer

1

Integer

10

Integer

11

Integer

12

Integer

13

Integer

14

Integer

15

Integer

16

Integer

17

Integer

18

Integer

19

Integer

2

Integer

20

Integer

21

Integer

22

Integer

3

Integer

31

Integer

4

Integer

5

Integer

6

Integer

7

Integer

8

Integer

9

Integer

WeatherDataUnit

指定以計量單位或英制單位傳回數據。 預設值為計量。

名稱 類型 Description
imperial

string

以單位傳回數據。 一些單位的機率系統範例為Fahrenheit和英哩。

metric

string

以計量單位傳回數據。 計量系統的一些範例單位為攝氏和公里。

WeatherUnit

與天氣相關的指定單位特定值。

名稱 類型 Description
unit

string

傳回值的單位類型。

unitType

UnitType

與所顯示單位類型相關聯的數值標識碼。 可用於單元翻譯。 如需詳細資訊,請參閱 Azure 地圖服務 中的天氣服務

value

number

四捨五入值。

WeatherUnitMaxMinAvg

傳回的溫度值。

名稱 類型 Description
average

WeatherUnit

時間週期的平均溫度。

maximum

WeatherUnit

時間週期的溫度上限。

minimum

WeatherUnit

時間週期的最低溫度。