> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/maiagent-user-guide/maiagent-user-guide-ja/application/integrate/farmingsearch.md).

# 農業データ照会

## 活用シーン：農業リアルタイムデータ照会アシスタントの構築 <a href="#use-case-build-agriculture-realtime-data-assistant" id="use-case-build-agriculture-realtime-data-assistant"></a>

農家、卸売業者、小売業者などの農業従事者の方や、農業関連の行政機関で政策立案に携わる方が、各種農産物（米、果物、野菜、畜産物など）の市場価格や取引動向を分析・予測する際には、農林水産省が公開している API を介して農産物の取引データをリアルタイムに照会し、さらなるデータ分析や意思決定の効率化に役立てることができます。

## 活用フロー <a href="#application-workflow" id="application-workflow"></a>

### 1. 農産物取引相場照会ツールの作成 <a href="#step1-create-crop-price-query-tool" id="step1-create-crop-price-query-tool"></a>

#### API 設定の取得 <a href="#get-api-config" id="get-api-config"></a>

まず、農業データオープンプラットフォームの API 専用ページから、必要に応じてデータ連携元を取得します。

{% hint style="info" %}
<https://data.moa.gov.tw/api.aspx>
{% endhint %}

ここでは、農産物取引相場をツール構築の例として使用します。Parameters セクションで <mark style="color:blue;">「Try it out」</mark> ボタンをクリックし、続いて <mark style="color:blue;">「Execute」</mark> をクリックすると、API 設定データを取得できます。

<figure><img src="/files/5HIXpH4SlJMVhb68BufT" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/zvIQRXHlFmaP1fUqeA8k" alt=""><figcaption></figcaption></figure>

#### API ツールの作成 <a href="#create-api-tool" id="create-api-tool"></a>

MaiAgent プラットフォームの左側の機能メニューで「ツール」をクリックし、「ツールを追加」をクリックします。

<figure><img src="/files/I0valbpe2ad9iQJDVrDL" alt=""><figcaption></figcaption></figure>

表示名とツール名を入力し、ツールの種類で API を選択して、このツールの説明を記入します。

下部の API 設定では、農業データオープンプラットフォーム上の API 情報画面をスクリーンショットして MaiAgent ツール作成アシスタントに貼り付けることで、API URL、HTTP メソッド、ヘッダー、パラメータ構造の内容をすばやく取得できます。

{% hint style="info" %}
[ツール作成 AI アシスタント](https://chat.maiagent.ai/web-chats/27934296-105a-4f3f-80f0-7e9dcdb638d3)
{% endhint %}

<figure><img src="/files/MHmtt2aelTzwj80E00wS" alt=""><figcaption></figcaption></figure>

* API URL の例：`https://data.moa.gov.tw/api/v1/AgriProductsTransType/`
* HTTP メソッドの例：`GET`
* ヘッダー (JSON) の例：

```
{
  "Accept": "application/json"
}
```

* パラメータ構造 (JSON Schema) の例：

```
{
  "type": "object",
  "required": [
    "Start_time",
    "End_time"
  ],
  "properties": {
    "End_time": {
      "type": "string",
      "description": "查詢結束日期 (格式: 民國年.月.日, 例如: 107.07.10)"
    },
    "Start_time": {
      "type": "string",
      "description": "查詢起始日期 (格式: 民國年.月.日, 例如: 107.07.01)"
    }
  }
}
```

### 2. 農業データ照会 AI アシスタントの作成 <a href="#step2-create-agriculture-data-query-assistant" id="step2-create-agriculture-data-query-assistant"></a>

#### AI アシスタントの作成 <a href="#create-ai-agent" id="create-ai-agent"></a>

MaiAgent プラットフォームの左側の機能メニューで「AI アシスタント」をクリックし、「AI アシスタントを作成」をクリックします。

<figure><img src="/files/4kOjMhShCUWnZ4tOV0s7" alt=""><figcaption></figcaption></figure>

回答モードで「Agent」を選択し、役割指示を入力します。

<figure><img src="/files/DSaGXF7knKZhYqrQV8kn" alt=""><figcaption></figcaption></figure>

#### AI アシスタントへのツールの設定 <a href="#configure-tools-for-assistant" id="configure-tools-for-assistant"></a>

「ツール」タブを選択し、<mark style="color:blue;">「＋ツールを選択」</mark> をクリックします。

<figure><img src="/files/x5IlnNTCMLKPoSA0sG6N" alt=""><figcaption></figcaption></figure>

先ほど作成した農産物取引相場照会ツールを選択し、確認をクリックします。

<figure><img src="/files/e7C5UrikgbXdB4lBNPXT" alt=""><figcaption></figcaption></figure>

### 3. AI アシスタントの本番運用 <a href="#step3-ai-agent-go-live" id="step3-ai-agent-go-live"></a>

これで、AI アシスタントの質問応答インターフェースから直接質問を行い、農産物の取引量や平均価格の変動などの情報をすばやく照会できるようになりました。市場価格や取引動向をリアルタイムに把握し、さらなるデータ分析や意思決定分析の効率化にお役立てください。

<figure><img src="/files/isK1Wf6Qn36x9HHZ6MCu" alt=""><figcaption></figcaption></figure>

また、MaiAgent プラットフォームの「すべての会話」機能から、AI アシスタントが回答する際に呼び出したツールの記録を確認することもできます。

<figure><img src="/files/MtoyXri463bRVs864qGf" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.maiagent.ai/maiagent-user-guide/maiagent-user-guide-ja/application/integrate/farmingsearch.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
