Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WeatherAPI Examples

Code examples for integrating WeatherAPI.com in popular languages and frameworks.

WeatherAPI License: MIT npm

🚀 Get Your Free API Key

Sign up at weatherapi.com/signup.aspx — no credit card required. 100,000 calls/month free.


📁 Examples

Language / Framework Directory Description
JavaScript (Fetch) javascript/ Vanilla JS using the Fetch API
Node.js nodejs/ Node.js with axios
Python python/ Python with requests library
Python (Async) python-async/ Python with aiohttp
PHP php/ PHP with cURL
Ruby ruby/ Ruby with net/http
Go go/ Go with net/http
Java java/ Java with HttpClient
C# (.NET) csharp/ C# with HttpClient
Swift swift/ Swift with URLSession
Kotlin kotlin/ Kotlin with OkHttp
Rust rust/ Rust with reqwest
React react/ React hooks weather widget
Next.js nextjs/ Next.js API routes + SSR
Vue.js vuejs/ Vue 3 Composition API
Express.js expressjs/ Express.js REST proxy
Django django/ Django views + templates
Flask flask/ Flask REST API
Laravel laravel/ Laravel controller + blade
Spring Boot spring-boot/ Spring Boot REST controller
Claude AI (MCP) mcp/ Use WeatherAPI inside Claude

🤖 AI Integration

WeatherAPI works natively with Claude and other AI assistants via MCP:

{
  "mcpServers": {
    "weatherapi": {
      "command": "npx",
      "args": ["-y", "weatherapi-mcp"],
      "env": {
        "WEATHERAPI_KEY": "your_api_key_here"
      }
    }
  }
}

See the mcp/ directory for full setup instructions.


📖 API Reference


🛠️ Endpoints Covered

Each example demonstrates:

  • ✅ Current weather
  • ✅ 3-day forecast
  • ✅ Hourly breakdown
  • ✅ Air quality index
  • ✅ Weather alerts
  • ✅ Location search
  • ✅ Error handling
  • ✅ Authentication

📄 License

MIT — free to use in personal and commercial projects.


💬 Support

About

No description, website, or topics provided.

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages