12/19/2023 0 Comments Ip locator map google![]() IpData = isBlank(ip)? getResponseJsonData('') : getResponseJsonData('' + ip) If the IP is empty, the IP of the Google Server storing the spreadsheet will be used. Send the request to the server and return the JSON data. Declaring the variable that will contain the JSON data returned from the request. ![]() Gets the location-related data based on the given IP and the return type. * getIpGeolocationData(ip = '', returnType = '') * The location-related data based on the given IP and the return type. null or empty string), a combination of city, region, and country will be returned. * Available options: "GEO", "TIME", "CITY", "ZIP", "REGION", "COUNTRY". * returnType A cell or a string value that has the type of data that will be returned. * This function returns location-related data based on an IP. (blank): a combination of the city name, region name, and country name /* Start of the GAS code.The getIpGeolocationData function provides several return options to the user: We have already seen and used the last two functions in the previous GAS post. Finally, the isBlank function checks if the input string is blank, null, or undefined. 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 |