IPGeoLocation
v1.5.3

IP地理位置库。
以Delphi语言实现,它使用Fluent接口的概念来指导库的使用。
图书馆是使用“ IP-Goolocation”解决方案市场的主要参与者开发的,该市场附在批准的提供商列表中。
基于IP地址的地理位置是一种用于使用其IP地址连接到Internet的设备的地理位置的技术。该机制取决于该设备的IP地址出现在其各自位置,邮政地址,城市,国家,地区或地理坐标的数据库中,这是可以记录的一些细节级别。
有关更多信息:IPS地理位置
该技术广泛使用:
地理营销
内容方向
访问控制(内容/服务)
安全
| 提供者 | 网站 | API | 免费请求 |
|---|---|---|---|
| IP2Location | https://www.ip2location.com | https://api.ip2location.com/v2 | 10,000年 |
| ipgeolocation | https://ipgeolocation.io | https://api.ipgeolocation.io/ipgeo | 每天1,500 |
| IPSTACK | https://ipstack.com | http://api.ipstack.com | 每月10,000 |
| ipify | https://geo.ipify.org | https://geo.ipify.org/api/v1 | 每月1,000 |
| ipapi | https://ipapi.com | http://api.ipapi.com/api | 10,000年 |
| ipinfo | https://ipinfo.io | https://ipinfo.io | 每月50,000 |
| ipgeolocationapi | https://ipgeolocationapi.com | https://api.ipgeolocationapi.com/geolocate | 无限 |
| ipwhois | https://ipwhois.io | http://ipwhois.app | 每月10,000 |
| ipdig | https://ipdig.io | https://ipdig.io | 无限 |
| ipdata | https://ipdata.co | https://api.ipdata.co | 每天1,500 |
| iplabstack | https://labstack.com/ip | https://ip.labstack.com/api/v1 | 每月10,000 |
| iptwist | https://iptwist.com | https://iptwist.com | 每月1,000 |
| IP-API | https://ip-api.com | http://ip-api.com | 无限 |
| DB-IP | https://db-ip.com | http://api.db-ip.com/v2 | 无限 |
使用boss (delphi的依赖性anager)您可以自动安装库。
boss install github.com/antoniojmsjr/IPGeoLocation
项目>选项> Delphi编译器>目标>所有配置>搜索路径
..IPGeoLocationSource
uses IPGeoLocation, IPGeoLocation.Interfaces, IPGeoLocation.Types; var
lMsgError: string;
lGeoLocation: IGeoLocation;
begin
try
lGeoLocation := TIPGeoLocation.New
.IP[ ' 201.86.220.241 ' ]
.Provider[TIPGeoLocationProviderKind.IPInfo]
// .SetTimeout(5000) //[OPCIONAL]
// .SetAPIKey('TOKEN') //[OPCIONAL]: VERIFICAR ARQUIVO: APIKey.inc
.Request
// .SetResultLanguageCode('pt-br') //[OPCIONAL]
.Execute;
Application.MessageBox(PWideChar(lGeoLocation.ToJSON), ' JSON ' , MB_OK + MB_ICONINFORMATION); // JSON COM O RESULTADO DA GEOLOCALIZAÇÃO
except
on E: EIPGeoLocationRequestException do
begin
lMsgError := Concat(lMsgError, Format( ' IP: %s ' , [E.IP]), sLineBreak);
lMsgError := Concat(lMsgError, Format( ' IPVersion: %s ' , [E.IPVersion]), sLineBreak);
lMsgError := Concat(lMsgError, Format( ' Provider: %s ' , [E.Provider]), sLineBreak);
lMsgError := Concat(lMsgError, Format( ' DateTime: %s ' , [DateTimeTostr(E.DateTime)]), sLineBreak);
lMsgError := Concat(lMsgError, Format( ' Kind: %s ' , [E.Kind.AsString]), sLineBreak);
lMsgError := Concat(lMsgError, Format( ' URL: %s ' , [E.URL]), sLineBreak);
lMsgError := Concat(lMsgError, Format( ' Method: %s ' , [E.Method]), sLineBreak);
lMsgError := Concat(lMsgError, Format( ' Status Code: %d ' , [E.StatusCode]), sLineBreak);
lMsgError := Concat(lMsgError, Format( ' Status Text: %s ' , [E.StatusText]), sLineBreak);
lMsgError := Concat(lMsgError, Format( ' Message: %s ' , [E.Message]));
Application.MessageBox(PWideChar(lMsgError), ' A T E N Ç Ã O ' , MB_OK + MB_ICONERROR);
end ;
on E: Exception do
begin
Application.MessageBox(PWideChar(E.Message), ' A T E N Ç Ã O ' , MB_OK + MB_ICONERROR);
end ;
end ;
end ;

IPGeoLocation是免费的,开源软件