dus-ip-geolocation-node-client
Version:
Node.js client for DUS IP Geolocation API
34 lines (33 loc) • 883 B
TypeScript
export interface GeolocationResponse {
asn_name: string;
asn_number: number;
city_name: string;
country: string;
ip: string;
ip_version: number;
is_private: boolean;
iso_code: string;
mnt_by: string;
netname: string;
status: string;
db_version: string;
}
export interface ASN_INFO {
"asn_country_code": string;
"asn_name": string;
"asn_number": number;
}
export interface GeolocationError {
error: string;
}
export declare class DUSIpGeolocationNodeClient {
#private;
constructor(baseUrl: string);
getVersion(): Promise<{
"version": string;
}>;
getGeolocationByIp(ip: string): Promise<GeolocationResponse>;
geolocateMultipleIps(ips: string[]): Promise<GeolocationResponse[]>;
getAsnInfo(asn: number): Promise<ASN_INFO>;
getMultipleAsnInfo(asns: number[]): Promise<ASN_INFO[]>;
}