Weather API

Weather-aware AI agents that answer before your customers check another app

Travelers ask about destination weather. Event planners need forecasts. Logistics teams check conditions along routes. Your AI agent fetches live weather data from WeatherAPI.com, including current conditions, multi-day forecasts, and severe alerts, all inside the conversation.

Chosen by 800+ global brands across industries

Six weather endpoints, one smart conversation

From live conditions to historical records and sunrise times, your AI agent pulls precise weather data for any location worldwide and delivers it naturally within customer chats.

Fetch Current Conditions

A customer asks 'What is the weather in Mumbai right now?' Your agent calls the current.json endpoint and returns temperature, humidity, wind speed, and a condition description. Live weather data delivered in seconds without the customer opening a separate app.

Multi-Day Forecast

Traveler planning a weekend trip asks about weather for the next five days. The agent queries forecast.json with the destination and day count, returning daily highs, lows, precipitation chances, and hourly breakdowns for trip planning.

Historical Weather Lookup

An insurance adjuster asks about conditions on a specific past date. Your agent fetches history.json for that location and date, providing temperature, wind, and precipitation data. Verified historical records for claims, research, or event analysis.

Location Search

Customer types a partial city name or misspells the location. The agent uses the search.json endpoint to autocomplete and resolve the query to the correct location with latitude, longitude, region, and country. Accurate results even with imprecise input.

Astronomy Data Retrieval

A photography enthusiast asks about sunset time at a specific location. The agent calls astronomy.json and returns sunrise, sunset, moonrise, and moonset times for any date. Niche but valuable data for outdoor planning conversations.

Severe Weather Alerts

Safety-conscious customers ask about active warnings in their area. The agent queries alerts.json and returns any current weather alerts including type, severity, and duration. Proactive safety information delivered through your existing chat channel.

Weather API

Use Cases

Weather intelligence meets customer conversations

Travel agencies, event companies, logistics firms, and outdoor businesses all field weather questions daily. See how your AI agent handles them automatically.

Travel Agency Destination Briefings

A customer planning a trip to Bali asks 'Will it rain next week there?' Your AI Agent calls the forecast endpoint for Bali with a 7-day window, retrieves daily precipitation probabilities and temperature ranges, and presents a travel-friendly weather summary. The customer books with confidence. Your agents do not spend ten minutes looking up weather for every inquiry.

Outdoor Event Weather Monitoring

An event organizer messages 'Are there any weather warnings for Central Park this Saturday?' Your AI Agent checks alerts.json for active warnings and pulls the forecast for the event date. It reports clear skies with mild winds or warns about incoming storms. The organizer makes venue decisions based on live data. No separate weather app, no manual checking, just a quick chat response.

Logistics Route Weather Assessment

A fleet dispatcher asks about conditions along a delivery route spanning three cities. Your AI Agent queries current conditions and forecasts for each waypoint, identifying a snowstorm warning in the second city. It recommends rerouting or delaying the shipment. The dispatcher adjusts the schedule before a truck gets stranded. Proactive weather intelligence woven into operational decisions.

Try
Weather API

Weather API

FAQs

Frequently Asked Questions

What location formats does the Weather API accept for queries?

The API is flexible with location input. It accepts city names like 'Mumbai,' ZIP codes, latitude and longitude pairs like '12.97,77.59,' or city-region combinations. Your agent passes whatever the customer types, and the API resolves it. If the location is ambiguous, the agent uses the search endpoint to confirm the correct match first.

How many days of forecast data can the agent retrieve?

The forecast endpoint supports up to 10 days of future weather data depending on your WeatherAPI.com plan. Each forecast day includes high and low temperatures, precipitation, wind conditions, and hourly breakdowns. Your agent requests only the number of days the customer needs, keeping responses focused and relevant.

Can the agent look up weather from past dates for insurance or legal purposes?

Yes. The history endpoint returns weather data for any specific date on or after January 1, 2010. It provides temperature, wind, precipitation, and hourly details for the requested location and date. This is useful for insurance claims, event documentation, agricultural records, and legal proceedings.

Does the agent include air quality data in weather responses?

Yes, when configured. The current, forecast, and history endpoints support an aqi=yes parameter that returns air quality index data alongside standard weather information. Your agent can include or exclude this data based on the customer's question or your default configuration preferences.

How quickly does the weather data update?

WeatherAPI.com updates current conditions in near real-time, typically every 10 to 15 minutes. Forecast data refreshes multiple times daily. Since your agent fetches data live with each conversation query, customers always receive the most recent conditions available. No stale or cached weather information.

Can the agent serve weather data in languages other than English?

Yes. The API supports a language parameter with two-letter codes like 'hi' for Hindi, 'es' for Spanish, or 'fr' for French. The condition text, such as 'Partly cloudy,' is returned in the selected language. Your agent can auto-detect the customer's language preference and pass the appropriate code.

What happens if the customer asks about a location that does not exist?

The API returns an error with code 1006 and message 'No matching location found.' Your agent handles this gracefully by asking the customer to verify the location name, suggesting corrections based on the search endpoint's autocomplete results, and offering to try nearby cities or regions instead.

Is there a limit to how many weather queries the agent can make?

Query limits depend on your WeatherAPI.com subscription plan. Free plans offer up to 1 million calls per month. Paid plans increase limits and unlock additional features like extended forecasts and historical data. Your agent makes one API call per weather question, so typical conversational volumes are well within standard plan limits.

How to add Tools to your AI Agent

Supercharge your AI Agent with Tool Integrations

Don't limit your AI Agent to basic conversations. Watch how to configure and add powerful tools making your agent smarter and more functional.

Real results, real customers, real stories

“We're saving an average of 4,000+ calls a month.”
Implementing an Agent revolutionized our customer service channels and our service to Indiana business owners. We're saving an average of 4,000+ calls a month and can now provide 24x7x365 customer service️ along with our business services.
Lindsey Roark Mayes
Ex-Director of SOS IT (State of Indiana)
“Cutting down on staff needing to email back.”
Since our launch of Tars Agents, we've had more than 5k interactions with them from individuals on the website. We saw prospects interacting with the Agent regarding application timelines, tuition, curriculum, and other items that may come through an email. This provides another avenue of access to our team while cutting down on staff needing to email back.
Levi Eastwood
Marketing Director of UCI Merage School
“Powerful tool - and there's so much more still to explore!”
I love the flexibility of the TARS chatbot design tool. The ability to drop in a new gambit and easily de-link and re-link gambits before and after it saves HOURS of time lost if I had to regenerate from scratch. TARS stands out for its flexibility, consistent performance, and outstanding support.
Aaron Rittmaster
Founder
“I like the product.”
Takes those boring forms and allows you to make the collecting of customer information enjoyable for the user. It has a lot of value and I see the company constantly working on improving it.
Pierre Rattini
Director of Marketing
“Very responsive and supportive Team”
I love how supportive and responsive the team members are. The chatbots are not difficult to build once you have an idea of what you are doing, and this is so based on the backend work Tars has completed. Also, they are flexible to the clients' requests.
Keisha Cameron
Product Manager
“Easy for cooperation and open to agreement.”
One of the biggest qualities of TARS is their ability to truly understand their clients' needs. They took the time to thoroughly assess our requirements, offering valuable insights and recommendations that we hadn't even considered. This level of personalized attention made a significant difference in the success of our project.
Milica Petrovic
Customer Care Project Associate
“Great service”
The guys at Tars are so passionate about bots and maximum engagement. Tars is overall a great product with really nice people there to help me engage and automate conversations I would have otherwise missed.
Nigel Gosling
Health Coach
“Best in class for lead generation”
TARS is an essential tool within our lead gen strategy. I started to use it a couple years ago, and the platform evolved to focus on results. You can integrate your Google Analytics, Facebook Pixel, and AdWords conversion tag to track results and measure your campaign. You can also integrate with Zapier, which opens a lot of possibilities. Compared with static landing pages, we have seen an increase in conversions and more engagement.
Leonardo Wolff
Founder
“Very professional and cooperative”
Building an automated chat that our customers actually used and reduced calls amount.
Maryam Alhaddad
Customer Journey Designer
“Flexibility and good service”
Tars platform is very flexible, so you can do pretty much any flux you desire. Also integrates with any third party through APIs with a very simple and easy-to-use interface. Also tars team is great! Always at disposal and brings suggestions and solutions for any issue encountered during the process of building the chatbot.
Lucas Von Lachmann
Process Manager
“Deserved The title of the Best Chatbot of the Year”
If you are building chatbots, you cannot go wrong with TARS. I have been with this company since their beginning. Seen how they have grown. I have tested a lot of bots, but this one is still the best out there. We use WhatsApp a lot for our business. And what I like best is that I can have 1 chatbot for website and for my WhatsApp. I especially appreciate their support team as well. Whenever I am stuck, they quickly reply to my questions.
MJ Felix
Chairman
“Advanced integration, easy to use, and very customizable.”
This chatbot does everything from AI integration to complete customization and is excellent for lead conversion in most industries. I think the pre-formatted templates are an excellent boost to get started quickly. The team is also excellent.
Rachel Rowling
Chief Operating Officer
“The chatbot implementation has exceeded expectations!”
The implementation has delivered 24/7 customer support and is proving its value by reducing Contact center calls by around 5% in just four months of operation. Beyond enhancing the e-care experience, the chatbot is driving impressive business results, achieving a remarkable 20% month-on-month growth.
Victor Pereira
Customer Care and CX Manager
“We're saving an average of 4,000+ calls a month.”
Implementing an Agent revolutionized our customer service channels and our service to Indiana business owners. We're saving an average of 4,000+ calls a month and can now provide 24x7x365 customer service️ along with our business services.
Lindsey Roark Mayes
Ex-Director of SOS IT (State of Indiana)
“Cutting down on staff needing to email back.”
Since our launch of Tars Agents, we've had more than 5k interactions with them from individuals on the website. We saw prospects interacting with the Agent regarding application timelines, tuition, curriculum, and other items that may come through an email. This provides another avenue of access to our team while cutting down on staff needing to email back.
Levi Eastwood
Marketing Director of UCI Merage School
“Powerful tool - and there's so much more still to explore!”
I love the flexibility of the TARS chatbot design tool. The ability to drop in a new gambit and easily de-link and re-link gambits before and after it saves HOURS of time lost if I had to regenerate from scratch. TARS stands out for its flexibility, consistent performance, and outstanding support.
Aaron Rittmaster
Founder
“I like the product.”
Takes those boring forms and allows you to make the collecting of customer information enjoyable for the user. It has a lot of value and I see the company constantly working on improving it.
Pierre Rattini
Director of Marketing
“Very responsive and supportive Team”
I love how supportive and responsive the team members are. The chatbots are not difficult to build once you have an idea of what you are doing, and this is so based on the backend work Tars has completed. Also, they are flexible to the clients' requests.
Keisha Cameron
Product Manager
“Easy for cooperation and open to agreement.”
One of the biggest qualities of TARS is their ability to truly understand their clients' needs. They took the time to thoroughly assess our requirements, offering valuable insights and recommendations that we hadn't even considered. This level of personalized attention made a significant difference in the success of our project.
Milica Petrovic
Customer Care Project Associate
“Great service”
The guys at Tars are so passionate about bots and maximum engagement. Tars is overall a great product with really nice people there to help me engage and automate conversations I would have otherwise missed.
Nigel Gosling
Health Coach
“Best in class for lead generation”
TARS is an essential tool within our lead gen strategy. I started to use it a couple years ago, and the platform evolved to focus on results. You can integrate your Google Analytics, Facebook Pixel, and AdWords conversion tag to track results and measure your campaign. You can also integrate with Zapier, which opens a lot of possibilities. Compared with static landing pages, we have seen an increase in conversions and more engagement.
Leonardo Wolff
Founder
“Very professional and cooperative”
Building an automated chat that our customers actually used and reduced calls amount.
Maryam Alhaddad
Customer Journey Designer
“Flexibility and good service”
Tars platform is very flexible, so you can do pretty much any flux you desire. Also integrates with any third party through APIs with a very simple and easy-to-use interface. Also tars team is great! Always at disposal and brings suggestions and solutions for any issue encountered during the process of building the chatbot.
Lucas Von Lachmann
Process Manager
“Deserved The title of the Best Chatbot of the Year”
If you are building chatbots, you cannot go wrong with TARS. I have been with this company since their beginning. Seen how they have grown. I have tested a lot of bots, but this one is still the best out there. We use WhatsApp a lot for our business. And what I like best is that I can have 1 chatbot for website and for my WhatsApp. I especially appreciate their support team as well. Whenever I am stuck, they quickly reply to my questions.
MJ Felix
Chairman
“Advanced integration, easy to use, and very customizable.”
This chatbot does everything from AI integration to complete customization and is excellent for lead conversion in most industries. I think the pre-formatted templates are an excellent boost to get started quickly. The team is also excellent.
Rachel Rowling
Chief Operating Officer
“The chatbot implementation has exceeded expectations!”
The implementation has delivered 24/7 customer support and is proving its value by reducing Contact center calls by around 5% in just four months of operation. Beyond enhancing the e-care experience, the chatbot is driving impressive business results, achieving a remarkable 20% month-on-month growth.
Victor Pereira
Customer Care and CX Manager

Privacy & Security

We’ll never let you lose sleep over privacy and security concerns

At Tars, we take privacy and security very seriously. We are compliant with GDPR, ISO, SOC 2, and HIPAA.

GDPR
ISO
SOC 2
HIPAA

Still scrolling? We both know you're interested.

Let's chat about AI Agents the old-fashioned way. Get a demo tailored to your requirements.

Schedule a Demo