Package io.ipdata.client.service
Interface IpdataService
-
public interface IpdataServicePrimary interface for accessing the ipdata.co API.Provides methods for looking up geolocation, threat intelligence, and other metadata for IP addresses. Supports single IP lookups, bulk lookups, and selective field retrieval.
Also exposes single-field accessors (e.g.
getCountryName,getCity) inherited fromIpdataInternalSingleFieldClient.- See Also:
Ipdata.builder()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AsnModelasn(String ip)List<IpdataModel>bulk(List<String> ips)Retrieves IP data for multiple IP addresses in a single request.Currencycurrency(String ip)StringgetCallingCode(String ip)StringgetCity(String ip)StringgetContinentCode(String ip)StringgetCountryCode(String ip)StringgetCountryName(String ip)StringgetEmojiFlag(String ip)StringgetEmojiUnicode(String ip)IpdataModelgetFields(String ip, IpdataField<?>... fields)Retrieves only the specified fields for the given IP address.StringgetFlag(String ip)StringgetIp(String ip)doublegetLatitude(String ip)doublegetLongitude(String ip)StringgetOrganisation(String ip)StringgetPostal(String ip)IpdataModelipdata(String ip)Retrieves the full IP data model for the given IP address.booleanisEu(String ip)ThreatModelthreat(String ip)TimeZonetimeZone(String ip)
-
-
-
Method Detail
-
ipdata
IpdataModel ipdata(String ip) throws IpdataException
Retrieves the full IP data model for the given IP address.- Parameters:
ip- an IPv4 or IPv6 address- Returns:
- the full geolocation and metadata for the IP
- Throws:
IpdataException- if the API call fails
-
bulk
List<IpdataModel> bulk(List<String> ips) throws IpdataException
Retrieves IP data for multiple IP addresses in a single request.- Parameters:
ips- list of IPv4 or IPv6 addresses- Returns:
- a list of IP data models, one per input address
- Throws:
IpdataException- if the API call fails
-
getFields
IpdataModel getFields(String ip, IpdataField<?>... fields) throws IpdataException
Retrieves only the specified fields for the given IP address.Fields are sorted before querying to maximize cache hit rates when caching is enabled.
- Parameters:
ip- an IPv4 or IPv6 addressfields- one or more fields to retrieve (e.g.IpdataField.ASN,IpdataField.CURRENCY)- Returns:
- a partial IP data model containing only the requested fields
- Throws:
IpdataException- if the API call failsIllegalArgumentException- if no fields are specified
-
getIp
String getIp(String ip) throws IpdataException
- Throws:
IpdataException
-
isEu
boolean isEu(String ip) throws IpdataException
- Throws:
IpdataException
-
getCity
String getCity(String ip) throws IpdataException
- Throws:
IpdataException
-
getCountryName
String getCountryName(String ip) throws IpdataException
- Throws:
IpdataException
-
getCountryCode
String getCountryCode(String ip) throws IpdataException
- Throws:
IpdataException
-
getContinentCode
String getContinentCode(String ip) throws IpdataException
- Throws:
IpdataException
-
getLongitude
double getLongitude(String ip) throws IpdataException
- Throws:
IpdataException
-
getLatitude
double getLatitude(String ip) throws IpdataException
- Throws:
IpdataException
-
getOrganisation
String getOrganisation(String ip) throws IpdataException
- Throws:
IpdataException
-
getPostal
String getPostal(String ip) throws IpdataException
- Throws:
IpdataException
-
getCallingCode
String getCallingCode(String ip) throws IpdataException
- Throws:
IpdataException
-
getFlag
String getFlag(String ip) throws IpdataException
- Throws:
IpdataException
-
getEmojiFlag
String getEmojiFlag(String ip) throws IpdataException
- Throws:
IpdataException
-
getEmojiUnicode
String getEmojiUnicode(String ip) throws IpdataException
- Throws:
IpdataException
-
asn
AsnModel asn(String ip) throws IpdataException
- Throws:
IpdataException
-
timeZone
TimeZone timeZone(String ip) throws IpdataException
- Throws:
IpdataException
-
currency
Currency currency(String ip) throws IpdataException
- Throws:
IpdataException
-
threat
ThreatModel threat(String ip) throws IpdataException
- Throws:
IpdataException
-
-