@ipregistry/client
    Preparing search index...

    Class IpregistryClient

    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.

    Index
    • 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.

      Type Parameters

      • const F extends string

      Parameters

      • options: LookupOptions & { fields: F }

        Optional. Additional options for the lookup operation.

      Returns Promise<ApiResponse<SelectedFields<AutonomousSystem, F>>>

      A Promise resolving to an ApiResponse containing the RequesterAutonomousSystem information.

    • 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.

      Parameters

      • Optionaloptions: LookupOptions

        Optional. Additional options for the lookup operation.

      Returns Promise<ApiResponse<AutonomousSystem>>

      A Promise resolving to an ApiResponse containing the RequesterAutonomousSystem information.

    • Parameters

      Returns Promise<ApiResponse<AutonomousSystem>>

      Pass a LookupOptions object instead, e.g. client.originLookupAsn({ fields: 'name' }).

    • 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.

      Type Parameters

      • const F extends string

      Parameters

      • options: LookupOptions & { fields: F }

        Optional. Additional options for the lookup operation.

      Returns Promise<ApiResponse<SelectedFields<RequesterIpInfo, F>>>

      A Promise resolving to an ApiResponse containing the RequesterIpInfo.

    • 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.

      Parameters

      • Optionaloptions: LookupOptions

        Optional. Additional options for the lookup operation.

      Returns Promise<ApiResponse<RequesterIpInfo>>

      A Promise resolving to an ApiResponse containing the RequesterIpInfo.

    • Parameters

      Returns Promise<ApiResponse<RequesterIpInfo>>

      Pass a LookupOptions object instead, e.g. client.originLookupIp({ fields: 'location' }).

    • Parses user agent strings and returns detailed information about them.

      Parameters

      • userAgents: string[]

        An array of user agent strings to parse.

      • Optionaloptions: LookupOptions

      Returns Promise<ApiResponse<UserAgent[]>>

      A Promise resolving to an ApiResponse containing an array of UserAgent information.

    • Parameters

      • ...userAgents: string[]

      Returns Promise<ApiResponse<UserAgent[]>>

      Pass the user agents as an array instead, e.g. client.parseUserAgents([userAgent1, userAgent2]).