1
/
of
1
Course OpenWeatherMap: Public API with HTTP GET
Course OpenWeatherMap: Public API with HTTP GET
Regular price
$499.00 USD
Regular price
$525.00 USD
Sale price
$499.00 USD
Quantity
Couldn't load pickup availability
By the end of this lesson, you will learn how to:
- Organize API request logic in dedicated Service classes
- Use
Http::get()
with query parameters - Check success and parse JSON result
- Extract JSON data safely and process missing values
- Manage errors when APIs fail
- Store API keys in config and environment files
Structure of OpenWeatherMap API
You need to check the documentation for every external third-party API, which, if you're lucky, often leads to dedicated PHP/Laravel packages.
However, in this course, I want to focus on APIs without packages, so you will adopt the skill to use any API in the future.
In the case of OpenWeatherMap, the main API call information for the current weather looks like this:
So, this is a straightforward case: just an API call with...
