AI Natural Language API
Ask any weather question in plain English and receive an intelligent, data-backed answer.
Send a free-text question like "Will it rain in Edinburgh this weekend?" or "What were temperatures in Rome during July 2022?" and our AI interprets the intent, fetches the relevant live or historical data, and returns a natural-language answer plus the underlying JSON. No complex query construction — just ask and receive. Each request consumes 2 Premium API calls.
What You Get with the AI Natural Language API
Plain-English queries
No need to parse location names, dates, or units yourself. The AI handles intent recognition so your integration stays simple.
Live data under the hood
Answers are grounded in real WeatherAI.io data — not hallucinated. The raw JSON is returned alongside the prose answer.
Streaming SSE support
Set Accept: text/event-stream to receive the answer token-by-token as it's generated — ideal for chat-style UIs.
Multi-location & multi-date
Ask about multiple cities or date ranges in one question and receive a unified, structured answer.
Credit-safe billing
If the request is cancelled or errors before completion, your credits are automatically refunded.
Idempotency support
Pass X-Request-Id to safely retry without double-billing — important for unreliable network environments.
Who Uses This API
From startups to enterprise teams, the AI Natural Language API powers a wide range of real-world applications.
AI assistants & chatbots
Give your chatbot or voice assistant real weather intelligence without building a complex weather-query parser from scratch.
Smart home & voice interfaces
Answer spoken weather questions conversationally — "Should I take an umbrella today?" — with a single API call.
Customer support automation
Let a support bot answer weather-related questions for travel, insurance, or logistics customers without human escalation.
Internal analytics tools
Allow analysts to query historical weather in plain English via a natural-language interface instead of writing SQL or API calls.
Request Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| q | string | Required | Your weather question in plain English (JSON body field) | Will it rain in Tokyo next weekend? |
Authenticate every request with the X-API-Key header.
Code Example
Request
curl -X POST "https://api.weatherai.io/v1/ai" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{"q":"Will it rain in Tokyo next weekend?"}'Response
{
"answer": "Tokyo is forecast to have light rain on Saturday with around 60% chance of precipitation. Sunday looks clearer with only 15% chance of rain and highs near 24°C.",
"data": {
"location": { "name": "Tokyo", "country": "Japan" },
"forecast": [{ "date": "2024-04-27", "precipitation": { "chanceOfRain": 60 } }]
},
"summary_error": null
}Response Fields
| Field | Type | Description |
|---|---|---|
| answer | string | Natural-language answer to your question |
| data | object | Raw weather JSON used to generate the answer |
| data.location | object | Location details for the primary query location |
| summary_error | string | null | Set if the AI response failed (credits automatically refunded) |
Related APIs
Start Using the AI Natural Language API Today
Create a free account and get your API key in under a minute. 50 free Premium calls per day. No credit card required.
Get Your Free API Key