What is API? / Open weather map,

An API, short for Application Programming Interface, is a set of protocols, tools, and definitions that allow different software applications to communicate and share data with each other. It defines the methods and data formats that applications can use to request and exchange information, making it possible for developers to integrate functionalities from one application into another without having to reinvent the wheel.

It basically helps you to access to the internet server and get information without you move your mouse and access to the website.

A lot of websites provide us API service. Let`s look at the open weather map API and grasp how it works like. Open weather map is a website providing information about current weather and forecast weather.

https://openweathermap.org/

https://openweathermap.org/api/one-call-3#current

You can make api call accessing to the url below.

https://api.openweathermap.org/data/3.0/onecall?lat={lat}&lon={lon}&exclude={part}&appid={API key}

This url will provide us the weather information as in JSON format. We can extract the data from it, and extracting from the JSON data is called parse. Parse JSON data.

This method can be applied to many projects.

コメントする

メールアドレスが公開されることはありません。 が付いている欄は必須項目です