Frontend/weather

Build a real-time weather widget in under 30 minutes

A weather widget is often the first API integration developers tackle. Here's how to go from zero to a live, production-ready widget using the APlicious /weather namespace — current conditions, 7-day forecast, and optional severe weather alerts.

Get free API key Full docs
01

Get your free API key

Sign up at aplicious.com/auth — no credit card. Your key works immediately for all 34 namespaces including /weather. Copy it from the dashboard.

02

Fetch current conditions

A single GET request returns temperature, humidity, wind, UV index, and condition text.

const res = await fetch(
  'https://aplicious.com/api/v1/weather/current?city=Mumbai',
  { headers: { 'X-API-Key': process.env.LAPI_KEY } }
);
const { data } = await res.json();
// data.temp_c, data.condition, data.humidity, data.wind_kmh
03

Add a 7-day forecast

The /forecast endpoint returns an array of daily objects — just map over them for the forecast strip.

const res = await fetch(
  'https://aplicious.com/api/v1/weather/forecast?city=Mumbai&days=7',
  { headers: { 'X-API-Key': process.env.LAPI_KEY } }
);
const { data } = await res.json();
// data.forecast = [{ date, high_c, low_c, condition, precip_mm }]
04

Cache responses in your backend

Weather data doesn't change every second. Cache the /current response for 10 minutes server-side (Redis, KV, or a simple in-memory TTL cache). This keeps your quota usage minimal and your widget fast.

05

Ship it

Deploy to Vercel, Netlify, or your own server. Set LAPI_KEY as an environment variable — never expose it in client-side code. The widget fetches from your backend, your backend calls APlicious.

Why APlicious?

One key gives you weather plus 32 other APIs. When your widget grows into a full weather app, you can add UV health advice from /wellness, air quality from /health, or location data from /geocode — no new keys, no new billing.

Ready to build?

Free tier · 500 calls/month · No credit card · All 34 APIs included

Get your free API key

More guides

Build a Finance Dashboard with Stocks, SIP & Forex APIs

Read guide

Build a Wellness App — Fasting, Meditation & Health Tracking API

Read guide

Build a Fitness Tracker App with BMI, Macros & Workout APIs

Read guide