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是免費的,開源軟件