DeveloperBreeze

Fetching Weather Information from OpenWeatherMap API

const apiKey = 'YOUR_API_KEY';
const city = 'New York';
const apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}`;
fetch(apiUrl)
    .then(response => response.json())
    .then(data => console.log('Weather Information:', data))
    .catch(error => console.error('Error:', error));

Continue Reading

Handpicked posts just for you — based on your current read.

Discussion 0

Please sign in to join the discussion.

No comments yet. Start the discussion!