1km メッシュ天気予報(中期予報・CSV)
概要
1km格子ごとに計算された天気予報のデータをCSV形式で提供します。 中期予報 (medium range forecast) は1日ごと10日分の天気予報です。 中期予報の天気コードは、"のち" や "時々" など2種類の天気を組み合わせた表現があります。 APIは秒間50リクエストの範囲でご使用いただけます。
エンドポイント
ご契約時、API Keyと共に専用のエンドポイントをご案内します。
GET https://example.com/csv/batch/xxxxxxxxxx_mrf.csv
リクエスト
shell
curl -s "https://example.com/csv/batch/xxxxxxxxxx_mrf.csv" \
-H "X-API-Key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" > xxxxxxxxxx_mrf.csv
レスポンス
CSV
名称 | 概要 | 型 | フォーマット | 欠測時 | サンプル |
---|---|---|---|---|---|
id | リクエスト ID | string | |||
lat | 緯度 | float | |||
lon | 経度 | float | |||
meshcode | メッシュコード | int | 8桁数値 | 3次メッシュコード | |
date | 年月日 | string | 2021/6/1 | ||
hour | 時刻 | int | 0-23 | ||
wx | 天気コード | int | 100-999 | -9999 | 天気コード・アイコン(予報)参照 |
maxtemp | 最高気温(℃) | float | -9999 | ||
mintemp | 最低気温(℃) | float | -9999 | ||
pop | 降水確率(%) | int | -99 |
リクエスト ID
提供データを分類するIDが与えられます。 市町村ごとにCSV提供する際、ここには総務省発行の5桁の市町村コードを含みます。
エラー
ステータス | エラーコード | エラーメッセージ | 内容 |
---|---|---|---|
400 | 400_001 | "key" is required | 必須パラメータ未指定 |
400 | 400_002 | "key" is invalid value | パラメータの型/フォーマット不正 |
400 | 400_003 | "key" is out of range | パラメータ範囲外 |
401 | 401_001 | "X-API-Key" is required | APIキー未指定 |
401 | 401_002 | API Key is invalid value | APIキー不正 |
401 | 401_003 | "Key" is out of range | 利用期限/場所外 |
403 | 403_001 | "key" is out of range | 取得可能範囲外のデータをリクエスト |
404 | 404_001 | Resource is not exist | 存在しないリソース(メソッド、パス)を指定 |
404 | 404_002 | Data is not found | データが存在しない地点/日付を指定 |
429 | 429_001 | Requests is too many | 秒間リクエスト数の許容値オーバー |
500 | 500_001 | an error has occurred | 不明なエラーが発生 |
サンプル
レスポンス(正常)
csv
id,lat,lon,meshcode,date,wx,maxtemp,mintemp,pop
01101,43.062638,141.353921,64414278,2021/06/01,100,18,8,20
01101,43.062638,141.353921,64414278,2021/06/02,201,21,11,30
.....
レスポンス(異常)
json
{
"requestId": "xxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx==",
"errors": [
{
"code": "401_001",
"message": "request is unauthorized"
}
]
}