Constructs an IpregistryClient instance for API operations.
The API key as a string or an IpregistryConfig instance for custom configurations.
Optional
cache: IpregistryCacheOptional. An instance implementing the IpregistryCache interface for caching responses.
Optional
requestHandler: IpregistryRequestHandlerOptional. A custom handler for API requests.
Performs a batch lookup of Autonomous System Numbers (ASNs) and returns their information or errors. This method can leverage caching to avoid unnecessary API requests.
An array of ASNs (Autonomous System Numbers) to lookup.
Optional. Additional options for the lookup operation.
A Promise resolving to an ApiResponse containing an array of AutonomousSystem or LookupError objects.
Performs a batch lookup of IP addresses and returns their information or errors.
Similar to batchLookupAsns
, this method also supports caching.
An array of IP addresses to lookup.
Optional. Additional options for the lookup operation.
A Promise resolving to an ApiResponse containing an array of IpInfo or LookupError objects.
Retrieves the current cache instance used by the client.
The IpregistryCache instance used for caching responses.
Looks up information for a single Autonomous System Number (ASN).
The ASN to lookup.
Optional. Additional options for the lookup operation.
A Promise resolving to an ApiResponse containing the AutonomousSystem information.
Looks up information for a single IP address.
The IP address to lookup.
Optional. Additional options for the lookup operation.
A Promise resolving to an ApiResponse containing the IpInfo.
Performs a lookup for the ASN information of the originating request's IP address. This is particularly useful for understanding the ASN of the caller itself. Note: Caching is incompatible with this method. Every call will incur a remote request to the Ipregistry API, which may consume credits or incur costs depending on your plan.
Optional. Additional options for the lookup operation.
A Promise resolving to an ApiResponse containing the RequesterAutonomousSystem information.
Performs a lookup for the IP information of the originating request's IP address.
Useful for obtaining the caller's own IP information.
Similar to originLookupAsn
, this method does not support caching, and each invocation results in a remote
API request to Ipregistry. This ensures that the most current information is retrieved but also means that
each call will consume credits.
Optional. Additional options for the lookup operation.
A Promise resolving to an ApiResponse containing the RequesterIpInfo.
Parses user agent strings and returns detailed information about them.
An array of user agent strings to parse.
A Promise resolving to an ApiResponse containing an array of UserAgent information.
The main client for interacting with the Ipregistry API. This class provides methods for looking up IP information, ASN details, parsing user agents, and more.