/// <summary>
        ///     Displays geographic information about a supplied IP address including city, country, latitude, longitude and more.
        /// </summary>
        /// <param name="host">The host address to find the location of.</param>
        /// <param name="externalServiceUri">API uri</param>
        /// <returns></returns>
        public async Task <GeoIpData> GetGeoIpData(string host, string externalServiceUri)
        {
            var activityJson = await _apiProcessor.GetResponseContent(externalServiceUri, "geoiplocation", host);

            var data = JsonSerializer.Deserialize <GeoIpData>(activityJson);

            return(data);
        }
Beispiel #2
0
        /// <summary>
        ///     Find the reverse DNS entry (PTR) for a given IP. This is generally the server or host name.
        /// </summary>
        /// <param name="ipAddress">The IP address to retrieve the reverse DNS record for.</param>
        /// <returns></returns>
        public async Task <ViewDnsReverseDnsResponse> GetReverseDnsData(string ipAddress)
        {
            var parameters = new StringBuilder();

            parameters.Append("?ip=" + ipAddress);
            parameters.Append("&apikey=" + ApiKey);
            parameters.Append("&output=json");

            var activityJson = await _apiProcessor.GetResponseContent("reversedns", parameters.ToString());

            var data = JsonSerializer.Deserialize <ViewDnsReverseDnsResponse>(activityJson);

            return(data);
        }
Beispiel #3
0
        /// <summary>
        /// Displays geographic information about a supplied IP address including city, country, latitude, longitude and more.
        /// </summary>
        /// <param name="ipAddress">The ip address to find the location of.</param>
        /// <returns></returns>
        public async Task <FreeGeoIpResponse> GetGeoIpData(string ipAddress)
        {
            var activityJson = await _apiProcessor.GetResponseContent("json", ipAddress);

            var data = JsonSerializer.Deserialize <FreeGeoIpResponse>(activityJson);

            return(data);
        }
Beispiel #4
0
        public async Task <object> GetRdapData(string ipAddress)
        {
            var activityJson = await _apiProcessor.GetResponseContent("ip", ipAddress);

            object data = JsonSerializer.Deserialize(activityJson, null);

            return(data);
        }
Beispiel #5
0
        /// <summary>
        ///     Checks whether a domain name is available for registration.
        /// </summary>
        /// <param name="domainName">The domain name to check for availability.</param>
        /// <returns></returns>
        public async Task <WhoisXmlApiDomainAvailabilityResponse> GetDomainAvailabilityData(string domainName)
        {
            var parameters = new StringBuilder();

            parameters.Append("?domainName=" + domainName);
            parameters.Append("&apikey=" + ApiKey);
            parameters.Append("&outputFormat=json");

            var activityJson = await _apiProcessor.GetResponseContent("", parameters.ToString());

            var data = JsonSerializer.Deserialize <WhoisXmlApiDomainAvailabilityResponse>(activityJson);

            return(data);
        }