
IP geolocation library.
Implemented in Delphi language, it uses the concept of fluent interface to guide the use of the library.
Library developed using the main players of the "IP-Goolocation" solution market, attached to the list of approved providers.
IP address -based geolocation is a technique used to estimate the geographical location of a device connected to the internet using its IP address. This mechanism depends that the device's IP address appears in a database with its respective location, postal address, city, country, region or geographical coordinates, which are some of the levels of detail that can be recorded.
For more information: IPS Geolocation
This technology is widely used in:
Geo Marketing
Content direction
Access control (content/services)
Security
| Provider | Website | API | Free Requests |
|---|---|---|---|
| Ip2location | https://www.ip2location.com | https://api.ip2location.com/v2 | 10,000 Yearthly |
| IPGEOLOCATION | https://ipgeolocation.io | https://api.ipgeolocation.io/ipgeo | 1,500 Daily |
| Ipstack | https://ipstack.com | http://api.ipstack.com | 10,000 Monthly |
| Ipify | https://geo.ipify.org | https://geo.ipify.org/api/v1 | 1,000 Monthly |
| Ipapi | https://ipapi.com | http://api.ipapi.com/api | 10,000 Yearthly |
| Ipinfo | https://ipinfo.io | https://ipinfo.io | 50,000 Monthly |
| Ipgeolocationapi | https://ipgeolocationapi.com | https://api.ipgeolocationapi.com/geolocate | Unlimited |
| Ipwhois | https://ipwhois.io | http://ipwhois.app | 10,000 Monthly |
| Ipdig | https://ipdig.io | https://ipdig.io | Unlimited |
| Ipdata | https://ipdata.co | https://api.ipdata.co | 1,500 Daily |
| Iplabstack | https://labstack.com/ip | https://ip.labstack.com/api/v1 | 10,000 Monthly |
| Iptwist | https://iptwist.com | https://iptwist.com | 1,000 Monthly |
| IP-API | https://ip-api.com | http://ip-api.com | Unlimited |
| DB-IP | https://db-ip.com | http://api.db-ip.com/v2 | Unlimited |
Using BOSS (Dependency Anager for Delphi) you can install the library automatically.
boss install github.com/antoniojmsjr/IPGeoLocation
Project> Options> Delphi Compiler> Target> All Configations> Search Path
..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 IS FREE AND OPEN-SOURCE SOFTWARE LICENSED UNDER THE