-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathv2-geoip.js
57 lines (56 loc) · 1.32 KB
/
v2-geoip.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Example response from https://elections.api.aclu.org/v2/geoip?ip=38.109.115.130
{
ip: "38.109.115.130",
source: "ipstack",
ok: true,
location: {
latitude: 40.7022705078125,
longitude: -74.01061248779297
},
ipstack_details: {
city: "Manhattan",
region_code: "NY",
region_name: "New York",
zip: "10004",
latitude: 40.7022705078125,
ip: "38.109.115.130",
time_zone: {
gmt_offset: -14400,
current_time: "2020-03-30T19:25:50-04:00",
code: "EDT",
id: "America/New_York",
is_daylight_saving: true
},
continent_code: "NA",
currency: {
symbol: "$",
code: "USD",
plural: "US dollars",
name: "US Dollar",
symbol_native: "$"
},
country_name: "United States",
connection: {
isp: "Cogent Communications",
asn: 174
},
longitude: -74.01061248779297,
country_code: "US",
continent_name: "North America",
type: "ipv4",
location: {
calling_code: "1",
languages: [{
code: "en",
name: "English",
native: "English"
}],
capital: "Washington D.C.",
country_flag_emoji_unicode: "U+1F1FA U+1F1F8",
is_eu: false,
geoname_id: 5125771,
country_flag_emoji: "🇺🇸",
country_flag: "http://assets.ipstack.com/flags/us.svg"
}
}
}