First API request and response
📖 Scenario: You are building a simple program to get the current weather from a public API. This will help you learn how to make your first API request and see the response.
🎯 Goal: Learn how to send a GET request to a weather API and display the temperature from the response.
📋 What You'll Learn
Use the
requests library to make an API callSend a GET request to the URL
https://api.weatherapi.com/v1/current.json?key=demo&q=LondonExtract the temperature in Celsius from the JSON response
Print the temperature with a friendly message
💡 Why This Matters
🌍 Real World
APIs let programs get live data from websites and services. Weather apps use APIs to show current weather.
💼 Career
Knowing how to make API requests is a key skill for developers working with web services, mobile apps, or data integration.
Progress0 / 4 steps