Weather App Using External API in Node.js — a practical guide to Node.js weather API project with clear examples you can reuse in real projects.
Weather App Using External API in Node.js — 29/55 in the Node.js series. Full playlist companion: Node.js complete course on YouTube. Prefer one article? Read the complete Node.js tutorial.
Short description
Practice fetch, env keys, and JSON parsing by building a weather lookup tool. Keep API keys out of source control.
Weather CLI sketch
const city = process.argv[2] || 'London';
const key = process.env.WEATHER_API_KEY;
async function weather(city) {
const url = `https://api.example.com/weather?q=${encodeURIComponent(city)}&appid=${key}`;
const res = await fetch(url);
const data = await res.json();
console.log(city, data);
}
weather(city);