📖 To learn more, take a look at our complete API

📤 Example Request

  1. Generate an api key below👇

  2. Install node-fetch & add the GOOEY_API_KEY to your environment variables.
    Never store the api key in your code and don't use direcly in the browser.

$ npm install node-fetch
$ export GOOEY_API_KEY=sk-xxxx
  1. Use this sample code to call the API.
    If you encounter any issues, write to us at [email protected] and make sure to include the full code snippet and the error message.
import fetch from 'node-fetch';

const payload = {
  "input_prompt": "\ud83c\udf31 What are the best rice varieties for the Kharif season?",
  "messages": [
    {
      "role": "user",
      "content": "what is best weather to grow rice?"
    },
    {
      "role": "assistant",
      "content": "Welcome to Farmer.CHAT. I'm an AI \ud83e\udd16 designed to help farmers and extension agents. Send me a text or \ud83c\udf99\ufe0fvoice note with any farming question and I'll give you an answer based on recommendations and best practices from other farmers like you. I'm constantly trying to improve, so please give me your feedback by tapping the \ud83d\udc4d\ud83c\udffe \ud83d\udc4e\ud83c\udffd buttons.  \n\nPlease respond with \"\u2705 I Agree\" to let us know you understand that your messages will be retained to start using this service. \n<button gui-action=\"disable_feedback\" gui-target=\"input_prompt\">\u2705 I Agree</button>"
    },
    {
      "role": "user",
      "content": "\u2705 I Agree"
    },
    {
      "role": "assistant",
      "content": "Thank you for agreeing! \ud83d\ude0a\n\nNow, let me answer your question about the **best weather to grow rice** \ud83c\udf3e:\n\nThe search results don't directly cover rice, but here's what I know based on best farming practices:\n\n### \ud83c\udf21\ufe0f Best Weather Conditions for Rice:\n\n1. **Temperature**: Rice grows best in **warm weather** between **20\u00b0C to 37\u00b0C**. The ideal temperature is around **25\u00b0C to 30\u00b0C**.\n\n2. **Rainfall**: Rice needs **plenty of water** \ud83d\udca7. It thrives in areas with **150\u2013200 cm of annual rainfall**. That's why it's mainly grown during the **monsoon season (Kharif)** in India (June\u2013July sowing).\n\n3. **Humidity**: Rice loves **high humidity** (above 60%). This helps in proper growth and grain filling.\n\n4. **Sunlight**: Rice needs **good sunlight** \u2600\ufe0f for at least 4\u20136 hours a day, especially during the grain-filling stage.\n\n5. **Season**: In India, rice is mainly grown in two seasons:\n   - **Kharif (June\u2013November)** \u2013 most common\n   - **Rabi/Summer (January\u2013May)** \u2013 in irrigated areas\n\n### \u26a0\ufe0f Conditions to Avoid:\n- Temperatures **below 15\u00b0C** can damage the crop\n- **Frost** is very harmful to rice\n- **Drought or dry spells** during flowering reduce yield\n\n---\n\nTo help you better, could you share your **location**, **gender**, and **other crops you grow**? This will help me give more tailored advice! \ud83d\ude4f\n\n---\n\nHere are some follow-up questions you might find helpful:\n\n\ud83c\udf31 What are the best rice varieties for the Kharif season?\n\ud83d\udca7 How much water does rice need during different growth stages?\n\ud83d\udc1b What are common pests in rice and how to control them?\n\n<button gui-target=\"input_prompt\">\ud83c\udf31 What are the best rice varieties for the Kharif season?</button>\n<button gui-target=\"input_prompt\">\ud83d\udca7 How much water does rice need during different growth stages?</button>\n<button gui-target=\"input_prompt\">\ud83d\udc1b What are common pests in rice and how to control them?</button>"
    }
  ]
};

async function gooeyAPI() {
  const response = await fetch("https://api.gooey.ai/v2/agent?example_id=nuwsqmzp", {
    method: "POST",
    headers: {
      "Authorization": "bearer " + process.env["GOOEY_API_KEY"],
      "Content-Type": "application/json",
    },
    body: JSON.stringify(payload),
  });

  if (!response.ok) {
    throw new Error(response.status);
  }

  const result = await response.json();
  console.log(response.status, result);
}

gooeyAPI();
  1. Generate an api key below👇

  2. Install requests & add the GOOEY_API_KEY to your environment variables.
    Never store the api key in your code.

$ python3 -m pip install requests
$ export GOOEY_API_KEY=sk-xxxx
  1. Use this sample code to call the API.
    If you encounter any issues, write to us at [email protected] and make sure to include the full code snippet and the error message.
import os
import requests

payload = {
    "input_prompt": "🌱 What are the best rice varieties for the Kharif season?",
    "messages": [
        {"role": "user", "content": "what is best weather to grow rice?"},
        {
            "role": "assistant",
            "content": 'Welcome to Farmer.CHAT. I\'m an AI 🤖 designed to help farmers and extension agents. Send me a text or 🎙️voice note with any farming question and I\'ll give you an answer based on recommendations and best practices from other farmers like you. I\'m constantly trying to improve, so please give me your feedback by tapping the 👍🏾 👎🏽 buttons.  \n\nPlease respond with "✅ I Agree" to let us know you understand that your messages will be retained to start using this service. \n<button gui-action="disable_feedback" gui-target="input_prompt">✅ I Agree</button>',
        },
        {"role": "user", "content": "✅ I Agree"},
        {
            "role": "assistant",
            "content": 'Thank you for agreeing! 😊\n\nNow, let me answer your question about the **best weather to grow rice** 🌾:\n\nThe search results don\'t directly cover rice, but here\'s what I know based on best farming practices:\n\n### 🌡️ Best Weather Conditions for Rice:\n\n1. **Temperature**: Rice grows best in **warm weather** between **20°C to 37°C**. The ideal temperature is around **25°C to 30°C**.\n\n2. **Rainfall**: Rice needs **plenty of water** 💧. It thrives in areas with **150–200 cm of annual rainfall**. That\'s why it\'s mainly grown during the **monsoon season (Kharif)** in India (June–July sowing).\n\n3. **Humidity**: Rice loves **high humidity** (above 60%). This helps in proper growth and grain filling.\n\n4. **Sunlight**: Rice needs **good sunlight** ☀️ for at least 4–6 hours a day, especially during the grain-filling stage.\n\n5. **Season**: In India, rice is mainly grown in two seasons:\n   - **Kharif (June–November)** – most common\n   - **Rabi/Summer (January–May)** – in irrigated areas\n\n### ⚠️ Conditions to Avoid:\n- Temperatures **below 15°C** can damage the crop\n- **Frost** is very harmful to rice\n- **Drought or dry spells** during flowering reduce yield\n\n---\n\nTo help you better, could you share your **location**, **gender**, and **other crops you grow**? This will help me give more tailored advice! 🙏\n\n---\n\nHere are some follow-up questions you might find helpful:\n\n🌱 What are the best rice varieties for the Kharif season?\n💧 How much water does rice need during different growth stages?\n🐛 What are common pests in rice and how to control them?\n\n<button gui-target="input_prompt">🌱 What are the best rice varieties for the Kharif season?</button>\n<button gui-target="input_prompt">💧 How much water does rice need during different growth stages?</button>\n<button gui-target="input_prompt">🐛 What are common pests in rice and how to control them?</button>',
        },
    ],
}

response = requests.post(
    "https://api.gooey.ai/v2/agent?example_id=nuwsqmzp",
    headers={
        "Authorization": "bearer " + os.environ["GOOEY_API_KEY"],
    },
    json=payload,
)
assert response.ok, response.content

result = response.json()
print(response.status_code, result)
  1. Generate an api key below👇

  2. Install curl & add the GOOEY_API_KEY to your environment variables.
    Never store the api key in your code.

export GOOEY_API_KEY=sk-xxxx
  1. Run the following curl command in your terminal.
    If you encounter any issues, write to us at [email protected] and make sure to include the full curl command and the error message.
curl 'https://api.gooey.ai/v2/agent?example_id=nuwsqmzp' \
  -H "Authorization: bearer $GOOEY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "input_prompt": "\ud83c\udf31 What are the best rice varieties for the Kharif season?",
  "messages": [
    {
      "role": "user",
      "content": "what is best weather to grow rice?"
    },
    {
      "role": "assistant",
      "content": "Welcome to Farmer.CHAT. I'"'"'m an AI \ud83e\udd16 designed to help farmers and extension agents. Send me a text or \ud83c\udf99\ufe0fvoice note with any farming question and I'"'"'ll give you an answer based on recommendations and best practices from other farmers like you. I'"'"'m constantly trying to improve, so please give me your feedback by tapping the \ud83d\udc4d\ud83c\udffe \ud83d\udc4e\ud83c\udffd buttons.  \n\nPlease respond with \"\u2705 I Agree\" to let us know you understand that your messages will be retained to start using this service. \n<button gui-action=\"disable_feedback\" gui-target=\"input_prompt\">\u2705 I Agree</button>"
    },
    {
      "role": "user",
      "content": "\u2705 I Agree"
    },
    {
      "role": "assistant",
      "content": "Thank you for agreeing! \ud83d\ude0a\n\nNow, let me answer your question about the **best weather to grow rice** \ud83c\udf3e:\n\nThe search results don'"'"'t directly cover rice, but here'"'"'s what I know based on best farming practices:\n\n### \ud83c\udf21\ufe0f Best Weather Conditions for Rice:\n\n1. **Temperature**: Rice grows best in **warm weather** between **20\u00b0C to 37\u00b0C**. The ideal temperature is around **25\u00b0C to 30\u00b0C**.\n\n2. **Rainfall**: Rice needs **plenty of water** \ud83d\udca7. It thrives in areas with **150\u2013200 cm of annual rainfall**. That'"'"'s why it'"'"'s mainly grown during the **monsoon season (Kharif)** in India (June\u2013July sowing).\n\n3. **Humidity**: Rice loves **high humidity** (above 60%). This helps in proper growth and grain filling.\n\n4. **Sunlight**: Rice needs **good sunlight** \u2600\ufe0f for at least 4\u20136 hours a day, especially during the grain-filling stage.\n\n5. **Season**: In India, rice is mainly grown in two seasons:\n   - **Kharif (June\u2013November)** \u2013 most common\n   - **Rabi/Summer (January\u2013May)** \u2013 in irrigated areas\n\n### \u26a0\ufe0f Conditions to Avoid:\n- Temperatures **below 15\u00b0C** can damage the crop\n- **Frost** is very harmful to rice\n- **Drought or dry spells** during flowering reduce yield\n\n---\n\nTo help you better, could you share your **location**, **gender**, and **other crops you grow**? This will help me give more tailored advice! \ud83d\ude4f\n\n---\n\nHere are some follow-up questions you might find helpful:\n\n\ud83c\udf31 What are the best rice varieties for the Kharif season?\n\ud83d\udca7 How much water does rice need during different growth stages?\n\ud83d\udc1b What are common pests in rice and how to control them?\n\n<button gui-target=\"input_prompt\">\ud83c\udf31 What are the best rice varieties for the Kharif season?</button>\n<button gui-target=\"input_prompt\">\ud83d\udca7 How much water does rice need during different growth stages?</button>\n<button gui-target=\"input_prompt\">\ud83d\udc1b What are common pests in rice and how to control them?</button>"
    }
  ]
}'

🎁 Example Response

{4 Items
"id"
:
string
"rpateofm2trd"
"url"
:
string
"https://gooey.ai/agent/"
"created_at"
:
string
"2026-03-31T09:47:21.665746+00:00"
"output"
:
{15 Items
"final_prompt"
:
[7 Items
0
:
{
}2 Items
1
:
{
}2 Items
2
:
{
}2 Items
3
:
{
}2 Items
4
:
{
}2 Items
5
:
{
}2 Items
6
:
{
}2 Items
]
"output_text"
:
[1 Items
0
:
string
"🌾 **Best rice varieties for Kharif season** depen"
]
"output_audio"
:
[1 Items
0
:
string
"https://storage.googleapis.com/dara-c1b52.appspot."
]
"output_video"
:
NULL
"raw_input_text"
:
string
"🌱 What are the best rice varieties for the Kharif"
"raw_tts_text"
:
[1 Items
0
:
string
"🌾 **Best rice varieties for Kharif season** depen"
]
"raw_output_text"
:
[1 Items
0
:
string
"🌾 **Best rice varieties for Kharif season** depen"
]
"references"
:
[3 Items
0
:
{
}4 Items
1
:
{
}4 Items
2
:
{
}4 Items
]
"final_search_query"
:
string
"You want to know the best rice varieties for the K"
"final_keyword_query"
:
NULL
"output_documents"
:
NULL
"reply_buttons"
:
NULL
"finish_reason"
:
[1 Items
0
:
string
"stop"
]
"metrics"
:
NULL
"called_functions"
:
[
]0 Items
}
}

Please Login to generate the $GOOEY_API_KEY