You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-11Lines changed: 28 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,32 +45,37 @@ function handleResponse(response) {
45
45
console.log(response);
46
46
}
47
47
48
-
//Query geolocation for the calling machine's IP address with an API key (optional, if you're using "Request Origin" feature at IP Geolocation API)
48
+
//Get geolocation for the calling machine's IP address with an API key (optional, if you're using "Request Origin" feature at IP Geolocation API)
49
49
getGeolocation(handleResponse, "YOUR_API_KEY");
50
50
51
-
//To use the "Request Origin" feature at IP Geolocation API, you skip the API key parameter.
51
+
//Don't pass the API key if you're using the "Request Origin" feature at IP Geolocation API
52
52
getGeolocation(handleResponse);
53
53
54
54
// Toggle API calls' async behavior. By default, async is true.
55
55
setAsync(false)
56
56
57
-
//Query geolocation for an IP address e.g., "1.1.1.1"
57
+
//Get geolocation for an IP address "1.1.1.1"
58
58
setIPAddressParameter("1.1.1.1");
59
59
getGeolocation(handleResponse, "YOUR_API_KEY");
60
60
61
-
// Query only specific geolocation fields e.g., "country_code2,time_zone,currency" for the calling machine's IP address
61
+
// Get geolocation for an IP address "1.1.1.1" in Russian language **
62
+
setLanguageParameter("ru");
63
+
setIPAddressParameter("1.1.1.1");
64
+
getGeolocation(handleResponse, "YOUR_API_KEY");
65
+
66
+
// Get the specific geolocation fields "country_code2,time_zone,currency" for the calling machine's IP address
62
67
setFieldsParameter("geo,time_zone,currency");
63
68
getGeolocation(handleResponse, "YOUR_API_KEY");
64
69
65
-
//Query only specific fields like "country_code2,time_zone,currency" for an IP address like "1.1.1.1" and skip the "ip" field in the response
70
+
//Get the specified geolocaiton fields like "country_code2,time_zone,currency" for an IP address "1.1.1.1" and skip the "ip" field in the response
66
71
setFieldsParameter("geo,time_zone,currency");
67
72
setIPAddressParameter("1.1.1.1");
68
73
setExcludesParameter("ip");
69
74
getGeolocation(handleResponse, "YOUR_API_KEY");
70
75
```
71
76
## Time Zone API
72
77
73
-
Here are a few different ways of querying Time Zone information from IP Geolocation API.
78
+
Here are a few examples to query Time Zone information from Timezone API.
74
79
75
80
```javascript
76
81
// Function to handle the response from IP Geolocation API.
@@ -79,24 +84,25 @@ function handleResponse(response) {
79
84
console.log(response);
80
85
}
81
86
82
-
//Query time zone information for the calling machine's IP address with an API key (optional, if you're using "Request Origin" feature at IP Geolocation API)
87
+
//Get time zone information for the calling machine's IP address with an API key (optional, if you're using "Request Origin" feature at IP Geolocation API)
83
88
getTimezone(handleResponse, "YOUR_API_KEY");
84
89
85
-
//To use the "Request Origin" feature at IP Geolocation API, you skip the API key parameter.
90
+
//Don't pass the API key if you're using the "Request Origin" feature at IP Geolocation API
86
91
getTimezone(handleResponse);
87
92
88
93
// Toggle API calls' async behavior. By default, async is true.
89
94
setAsync(false)
90
95
91
-
//Query time zone information for an IP address e.g., "1.1.1.1"
96
+
//Get time zone information for an IP address "1.1.1.1" and geolocation information in Italian language **
92
97
setIPAddressParameter("1.1.1.1");
98
+
setLanguageParameter("it");
93
99
getTimezone(handleResponse, "YOUR_API_KEY");
94
100
95
-
//Query time zone infomration for a time zone ID like "America/New_York"
101
+
//Get time zone infomration for a time zone "America/New_York"
96
102
setTimezoneParameter("America/Los_Angeles");
97
103
getTimezone(handleResponse, "YOUR_API_KEY");
98
104
99
-
//Query time zone information by latitude and longitude of the location
105
+
//Get time zone information by coordinates of the location
100
106
setCoordinatesParameter("31.4816", "74.3551");
101
107
getTimezone(handleResponse, "YOUR_API_KEY");
102
108
```
@@ -135,3 +141,14 @@ Here is a sample code to use IP Geolocation API using JQuery SDK:
135
141
});
136
142
</script>
137
143
```
144
+
145
+
** IPGeolocation provides geolocation information in the following languages:
0 commit comments