畜産クラウド_牛飼養頭数・施設数等データ取得API:検索条件指定

提供ベンダー
システム名
オープンデータ
利用条件
無償オプションAPI(申込必要)

概要

API名称
畜産クラウド_牛飼養頭数・施設数等データ取得API:検索条件指定
カテゴリー
説明

畜産クラウド全国推進協議会が提供する、牛の飼養頭数・施設数・と畜頭数・出生頭数・死亡頭数・輸入頭数等の届出情報統計です。

APIの利用にあたっては利用規約への同意の上、別途利用申請が必要です。
ご利用の際は以下の「農業データ連携基盤(WAGRI)利⽤・変更申請ページ」からご申請をお願い申し上げます。
https://wagri-subscription.db.naro.go.jp/ords/r/prd/subscription/pre-registration

データの更新頻度
毎月1日、15日の21時ごろ

リクエスト

URL

https://api.wagri2.net/MaffOpenData/market/LivestockNotificationInfoStatistics/?$Filter={レスポンスデータ定義の名称} eq {値}

説明

登録されている畜産クラウドの牛の飼養頭数や施設数等のデータをOdataによるフィルター検索で指定して取得できます。 

HTTPメソッド
GET
パラメータ

レスポンスデータ定義の「名称」を検索条件としてパラメータに追加して下さい。

呼出例

https://api.wagri2.net/MaffOpenData/market/LivestockNotificationInfoStatistics/?$filter=AggregateTypeCode eq ’02’ and TargetYearMonth eq ‘2021-01’ and Prefecture eq ‘宮城県’ and Breed eq ‘ホルスタイン種’
※「集計種別コード(AggregateTypeCode)」が02(都道府県別・牛の種別・性別の飼養頭数)かつ、「年月(TargetYearMonth)」が2021-01かつ、「都道府県(Prefecture)」が宮城県かつ、「品種(Breed)」がホルスタイン種で検索する場合

レスポンス

レイアウト

レスポンスデータ定義
畜産届出情報統計

名称 値の説明
AggregateName 集計名称 string Required
Max Length: 12
AggregateTypeCode 集計種別コード string, null Max Length: 2
Breed 品種 string Required
Max Length: 13
City 市区町村 string, null Max Length: 20
FileName ファイル名 string Required
Max Length: 255
Gender 性別 string, null Max Length: 1
ImportedFrom 輸入元 string, null Max Length: 7
InformationUpdateDate 報告更新日時 string Required
Format: date-time
LivestockNotificationInfoId 畜産届出情報ID string, null  
Month integer, null Minimum: 1
Maximum: 12
MonthAge 月齢 string, null Max Length: 5
Number 頭数/施設数 integer, null Maximum: 9999999
NumberNonNumeric 頭数/施設数(非数値) string, null Max Length: 10
Prefecture 都道府県 string, null Max Length: 6
TargetYearMonth 年月 string Required
Max Length: 7
Year integer Required
Maximum: 9999
YearOnYear 対前年比(%) number, null Format: Number(10,1)
YearOnYearNonNumeric 対前年比(非数値) string, null Max Length: 10

レスポンス説明
畜産届出情報統計

レスポンス例
{
    "AggregateName": "令和5年1月末時点",
    "AggregateTypeCode": "02",
    "Breed": "ホルスタイン種",
    "City": null,
    "FileName": "Type_Sex_BreedingNumber_pref_202301.xlsx",
    "Gender": "雄",
    "ImportedFrom": null,
    "InformationUpdateDate": "2023-03-07T05:38:39",
    "LivestockNotificationInfoId": "02-令和5年1月末時点-宮城県--雄-ホルスタイン種---2023-01",
    "Month": 1,
    "MonthAge": null,
    "Number": 823,
    "NumberNonNumeric": null,
    "Prefecture": "宮城県",
    "TargetYearMonth": "2023-01",
    "Year": 2023,
    "YearOnYear": null,
    "YearOnYearNonNumeric": null,
    "id": "API~MaffOpenData~Private~LivestockNotificationInfoStatistics~1~02~令和5年1月末時点~宮城県~~雄~ホルスタイン種~~~2023-01",
    "_Owner_Id": "ac31a63b-e520-4cb0-8573-7ca34c2f269c"
}

 

ステータスコード
コード 名称 値の説明
400 Bad Request リクエストが不正です。
403 Forbidden リソースのアクセスが禁止されています。
500 Internal Server Error サーバー内部でエラーが発生しました。
401 Unauthorized 認証情報が不正です。

 

サンプルソースコード

プログラム記述例(WAGRI共通)
import requests
url = "https://api.wagri.net/API/Public/AgriculturalLand/SearchByCityCode"
payload = {
'CityCode': '432041'
}
headers = {
'X-Authorization': 'アクセストークン',
}
response = requests.get(url, headers=headers, params=payload)
print(response.text)

 

プログラム記述例(個別API)

前に戻る
上部へスクロール