The getResponseJsonData performs the request to the server and converts the response into a JSON object. The getIpGeolocationData gets the location-related data based on the given IP and the return type. The GAS code that follows includes three functions. You can see the available data, which we will read using Google Apps Script. The image above demonstrates the response from this API in JSON format. The query limit, I think, is adequate for the typical Google Sheets user. Once this limit is reached, all of the requests will result in HTTP 403, forbidden, until the quota is cleared. The API is limited to 15,000 queries per hour by default. It uses a database of IP addresses associated with cities and other relevant information like time zone, latitude, and longitude. In this example, we will use the API from freegeoip.app, which provides a free IP geolocation API for software developers. It is exactly what services like Google Analytics offer (of course, they do many other things, too). Why might this process be useful? Consider that every website owner wants to know this kind of information for the people who visit their site. The process of IP geolocation involves mapping the IP address to the country, region (city), latitude/longitude, ISP, and other useful things. As we have seen in the past, the (global) IP address of a device is its unique identifier across the internet. IP geolocation is the process of finding associated geographic coordinates (often expressed as latitude and longitude) of an internet-connected computing or a mobile device using digital information, such as an IP address.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |