Build Your Own Weather Dashboard in Minutes (No API Keys, No Cost)

Build Your Own Weather Dashboard in Minutes (No API Keys, No Cost)

A beginner-friendly guide to creating interactive weather visualizations with Streamlit, Plotly, and free data

Hook

You can build a live weather dashboard in Python without spending a dime or hunting for API keys. Here's how to create something that shows real-time weather data with beautiful interactive charts, all running online.

Why This Matters in 2026

Today (June 30, 2026), data visualization tools have become so accessible that anyone who knows basic Python can build professional-looking dashboards. Tools like Streamlit have removed the barrier of learning web development—you don't need to know HTML, CSS, or JavaScript. That's huge for people who want to turn a quick idea into something real, fast. The Open-Meteo API has also become a go-to source for free weather data, no registration required, making projects like this genuinely frictionless.

What You're Building

A weather dashboard that does this:

  • Shows current conditions (temperature, humidity, wind speed) for any location
  • Displays beautiful charts of temperature trends over the next few days
  • Lets you pick any city on Earth and see live data instantly
  • Runs for free on Streamlit Cloud (Streamlit's hosting service)

The whole thing runs as a web app—just visit a URL and interact with it in your browser. No backend to manage, no servers to worry about.

What You Need

  • Python 3.7 or later installed on your computer
  • A text editor (VS Code, Sublime, whatever you like)
  • A free GitHub account
  • A free Streamlit Cloud account (uses the same GitHub login)
  • That's it. No API keys, no credit cards, no subscriptions.

How It Works (The Idea)

Streamlit turns Python scripts into web apps automatically. You write Python, add a few special commands to make things interactive, and Streamlit handles turning it into a website. Plotly creates the charts—they're interactive, so people can hover over data points and zoom in. Open-Meteo is a free weather API run by volunteers that doesn't require authentication or rate limiting (within reason).

The three pieces fit together: you fetch data from Open-Meteo, process it with Python, display it with Streamlit, and visualize it with Plotly.

Step 1: Install the Tools

Open a terminal and run:

pip install streamlit plotly requests pandas

This installs the libraries you need. requests fetches data from the internet, pandas helps organize it, and streamlit and plotly handle the rest.

Step 2: Create Your Python Script

Create a new file called app.py and paste this:

import streamlit as st
import plotly.graph_objects as go
import requests
import pandas as pd
from datetime import datetime

st.set_page_config(page_title="Weather Dashboard", layout="wide")

st.title("Live Weather Dashboard")

city = st.text_input("Enter a city name:", "London")

if city:
    try:
        geo_url = f"https://geocoding-api.open-meteo.com/v1/search?name={city}&count=1"
        geo_response = requests.get(geo_url).json()
        
        if geo_response["results"]:
            location = geo_response["results"][0]
            lat, lon = location["latitude"], location["longitude"]
            name = location["name"]
            
            weather_url = f"https://api.open-meteo.com/v1/forecast?latitude={lat}&longitude={lon}&current=temperature_2m,humidity,weather_code,wind_speed_10m&hourly=temperature_2m&daily=temperature_2m_max,temperature_2m_min&timezone=auto"
            weather_response = requests.get(weather_url).json()
            
            current = weather_response["current"]
            daily = weather_response["daily"]
            
            col1, col2, col3, col4 = st.columns(4)
            col1.metric("Temperature", f"{current['temperature_2m']}°C")
            col2.metric("Humidity", f"{current['humidity']}%")
            col3.metric("Wind Speed", f"{current['wind_speed_10m']} km/h")
            col4.metric("Location", name)
            
            df = pd.DataFrame({
                "Date": pd.to_datetime(daily["time"]),
                "Max": daily["temperature_2m_max"],
                "Min": daily["temperature_2m_min"]
            })
            
            fig = go.Figure()
            fig.add_trace(go.Scatter(x=df["Date"], y=df["Max"], name="High", mode="lines+markers"))
            fig.add_trace(go.Scatter(x=df["Date"], y=df["Min"], name="Low", mode="lines+markers"))
            fig.update_layout(title="Temperature Forecast", xaxis_title="Date", yaxis_title="Temperature (°C)")
            
            st.plotly_chart(fig, use_container_width=True)
    
    except Exception as e:
        st.error(f"Could not fetch data: {e}")

This script:

  • Lets users type a city name
  • Looks up the city's latitude and longitude
  • Fetches current weather and a forecast from Open-Meteo
  • Displays key metrics (temperature, humidity, wind) in big boxes
  • Plots a chart showing high and low temperatures for the next week

Step 3: Test It Locally

In your terminal, navigate to the folder with app.py and run:

streamlit run app.py

Streamlit opens a browser window. Type a city name and watch it work. You'll see live data appear instantly. Try typing "Tokyo," "New York," or any city on Earth—Open-Meteo has them all.

Step 4: Push to GitHub

Create a new GitHub repository (public, no README needed). Then:

git init
git add app.py
git commit -m "Initial weather dashboard"
git branch -M main
git remote add origin https://github.com/YOUR_USERNAME/REPO_NAME.git
git push -u origin main

Replace YOUR_USERNAME and REPO_NAME with your actual GitHub username and repository name.

Step 5: Deploy to Streamlit Cloud

Go to Streamlit Cloud (it's free and uses your GitHub login). Click "New app" and connect your repository. Streamlit finds your app.py file automatically and deploys it. Within a minute, you get a live URL you can share with anyone.

If you update the code in GitHub, Streamlit automatically redeploys. You never touch a server.

Step 6: Customize (Optional)

You can add more features easily:

  • Show more cities at once
  • Add more chart types (humidity over time, wind patterns)
  • Display alerts for extreme weather
  • Save favorite cities

Streamlit's documentation is excellent and beginner-friendly. The key insight: if you can write Python, Streamlit lets you build a web app without learning web development.

Conclusion

Building a weather dashboard no longer means wrestling with servers, databases, or API authentication. Streamlit handles the boring parts, Plotly makes the charts pretty, and Open-Meteo provides the data free. You can go from idea to deployed app in under an hour. That's a real shift in how accessible data visualization has become.

Merits

  • Completely free—no costs, no API keys, no hidden fees
  • Fast to build—the whole thing takes about an hour
  • Beautiful by default—Plotly charts look professional without tweaking
  • Interactive—users can click, hover, and zoom without any extra work from you
  • Automatically deployed—push code to GitHub, Streamlit redeploys instantly
  • Scalable to real projects—the same approach works for dashboards with thousands of data points
  • No web development skills required—pure Python

Demerits

  • Streamlit Cloud has rate limits and resource caps (free tier is modest)
  • Open-Meteo's free tier has no guaranteed uptime (unlikely to fail, but not SLA-backed)
  • Streamlit reruns the entire script every time a user interacts with it (can be slow for heavy computations)
  • Limited customization of the UI design (you get Streamlit's look, not a fully branded experience)
  • No backend database by default (data doesn't persist unless you build that separately)
  • Performance degrades if you try to fetch massive historical datasets

Caution

The code example above uses placeholders and example API endpoints. Before deploying, test it locally and confirm it works with real data. Open-Meteo is free and reliable but has rate limits—don't call it thousands of times per second. If you add features that require storing user data, remember to set up a proper backend database (Streamlit Cloud can connect to PostgreSQL or other services, but that's beyond the scope here). Proceed at your own risk and test thoroughly before sharing the link publicly.

Frequently asked questions

  • What happens if Open-Meteo goes down?
  • Can I add user accounts and save favorite cities?
  • How many people can use the dashboard at once?
  • Can I add more cities to compare side by side?
  • Is the data real-time or cached?
  • How do I add more charts and visualizations?
  • Can I customize the colors and fonts?
  • What if Streamlit Cloud is too slow for my use case?

Tags

#streamlit #datavisualization #python #plotly #weather #webapps #datascience #opendata

Responses

Sign in to leave a response.

Loading…