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

Discover more amazing content handpicked just for you

Code
javascript

Fetching Chuck Norris Jokes from API in JavaScript

No preview available for this content.

Jan 26, 2024
Read More

Discussion 0

Please sign in to join the discussion.

No comments yet. Start the discussion!