Difference between revisions of "IP2Geo"

From CDYNE Wiki
Jump to navigation Jump to search
imported>Bdriggers
(JAVA Example)
 
(6 intermediate revisions by 4 users not shown)
Line 19: Line 19:
  
 
===PHP Example===
 
===PHP Example===
<code type=php>
+
<syntaxhighlight lang=php line=line>
  
 
<?php
 
<?php
Line 37: Line 37:
  
 
?>
 
?>
</code>
+
</syntaxhighlight>
  
 
===JAVA Example===
 
===JAVA Example===
<code type=java>
+
<syntaxhighlight lang=java line=line>
  
 
import java.io.ByteArrayOutputStream;
 
import java.io.ByteArrayOutputStream;
Line 90: Line 90:
 
     }
 
     }
 
}
 
}
</code>
+
</syntaxhighlight>
  
 
===VBScript Example===
 
===VBScript Example===
<code type=vbscript>
+
<syntaxhighlight lang=vb line=line>
  
 
Dim request, oXMLHttp, url
 
Dim request, oXMLHttp, url
Line 115: Line 115:
  
 
MsgBox oXMLHTTP.responseText
 
MsgBox oXMLHTTP.responseText
</code>
+
</syntaxhighlight>
  
 
=== CSharp Example ===
 
=== CSharp Example ===
<code type=csharp>
+
<syntaxhighlight lang=csharp line=line>
  
 
/*http://ws.cdyne.com/ip2geo/ip2geo.asmx?wsdl was added as a Web Reference and given the name WSDL*/
 
/*http://ws.cdyne.com/ip2geo/ip2geo.asmx?wsdl was added as a Web Reference and given the name WSDL*/
Line 136: Line 136:
 
             WSDL.IPInformation ipr = ip.ResolveIP("IP ADDRESS", "YOUR LICENSE KEY");
 
             WSDL.IPInformation ipr = ip.ResolveIP("IP ADDRESS", "YOUR LICENSE KEY");
 
              
 
              
             if (String.IsNullOrWhiteSpace(ipr.City))
+
             Console.WriteLine("City: " + (String.IsNullOrEmpty(ipr.City) ? "No Information Found" : ipr.City));
                Console.WriteLine("City: " + "No Information Found");
+
             Console.WriteLine("State: " + (String.IsNullOrEmpty(ipr.StateProvince) ? "No Information Found" : ipr.StateProvince));
             else Console.WriteLine("City: " + ipr.City);
+
             Console.WriteLine("Country: " + (String.IsNullOrEmpty(ipr.Country) ? "No Information Found" : ipr.Country));
            if (String.IsNullOrWhiteSpace(ipr.StateProvince))
+
             Console.WriteLine("Organization: " + (String.IsNullOrEmpty(ipr.Organization) ? "No Information Found" : ipr.Organization));
                Console.WriteLine("State: " + "No Information Found");
 
             else Console.WriteLine("State: " + ipr.StateProvince);
 
            if (String.IsNullOrWhiteSpace(ipr.Country))
 
                Console.WriteLine("Country: " + "No Information Found");
 
             else Console.WriteLine("Country: " + ipr.Country);
 
            if (String.IsNullOrWhiteSpace(ipr.Organization))
 
                Console.WriteLine("Organization: " + "No Information Found");
 
            else Console.WriteLine("Organization: " + ipr.Organization);
 
 
             Console.WriteLine("Latitude: " + ipr.Latitude);
 
             Console.WriteLine("Latitude: " + ipr.Latitude);
 
             Console.WriteLine("Longitude: " + ipr.Longitude);
 
             Console.WriteLine("Longitude: " + ipr.Longitude);
             if (String.IsNullOrWhiteSpace(ipr.AreaCode))
+
             Console.WriteLine("Area Code: " + (String.IsNullOrEmpty(ipr.AreaCode) ? "No Information Found" : ipr.AreaCode));
                Console.WriteLine("Area Code: " + "No Information Found");
+
             Console.WriteLine("Time Zone: " + (String.IsNullOrEmpty(ipr.TimeZone) ? "No Information Found" : ipr.TimeZone));
             else Console.WriteLine("Area Code: " + ipr.AreaCode);
 
            if (String.IsNullOrWhiteSpace(ipr.TimeZone))
 
                Console.WriteLine("Time Zone: " + "No Information Found");
 
            else Console.WriteLine("Time Zone: " + ipr.TimeZone);
 
 
             Console.WriteLine("Daylight Savings: " + ipr.HasDaylightSavings);
 
             Console.WriteLine("Daylight Savings: " + ipr.HasDaylightSavings);
 
             Console.WriteLine("Certainty: " + ipr.Certainty + "%");
 
             Console.WriteLine("Certainty: " + ipr.Certainty + "%");
             if (String.IsNullOrWhiteSpace(ipr.RegionName))
+
             Console.WriteLine("Region Name: " + (String.IsNullOrEmpty(ipr.RegionName) ? "No Information Found" : ipr.RegionName));
                Console.WriteLine("Region Name: " + "No Information Found");
+
             Console.WriteLine("Country Code: " + (String.IsNullOrEmpty(ipr.CountryCode) ? "No Information Found" : ipr.CountryCode));          
             else Console.WriteLine("Region Name: " + ipr.RegionName);
 
            if (String.IsNullOrWhiteSpace(ipr.CountryCode))
 
                Console.WriteLine("Country Code: " + "No Information Found");
 
            else Console.WriteLine("Country Code: " + ipr.CountryCode);
 
 
              
 
              
 
             Console.ReadLine();
 
             Console.ReadLine();
Line 169: Line 153:
 
     }
 
     }
 
}
 
}
</code>
+
</syntaxhighlight>
  
 
=== VB.Net Example ===
 
=== VB.Net Example ===
<code type=vb.net>
+
<syntaxhighlight lang=vbnet line=line>
  
 
'http://ws.cdyne.com/ip2geo/ip2geo.asmx?wsdl was added as a Web Reference and given the name WSDL
 
'http://ws.cdyne.com/ip2geo/ip2geo.asmx?wsdl was added as a Web Reference and given the name WSDL
Line 183: Line 167:
 
         Dim IPR = IP.ResolveIP("IP ADDRESS", "YOUR LICENSE KEY")
 
         Dim IPR = IP.ResolveIP("IP ADDRESS", "YOUR LICENSE KEY")
  
         If (String.IsNullOrWhiteSpace(IPR.City)) Then
+
         Console.WriteLine("City: " & (If(String.IsNullOrEmpty(IPR.City), "No Information Found", IPR.City)))
            Console.WriteLine("City: " + "No Information Found")
+
         Console.WriteLine("State: " & (If(String.IsNullOrEmpty(IPR.StateProvince), "No Information Found", IPR.City)))
         Else : Console.WriteLine("City: " + IPR.City)
+
         Console.WriteLine("Country: " & (If(String.IsNullOrEmpty(IPR.Country), "No Information Found", IPR.Country)))
        End If
+
         Console.WriteLine("Organization: " & (If(String.IsNullOrEmpty(IPR.Organization), "No Information Found", IPR.Organization)))
        If (String.IsNullOrWhiteSpace(IPR.StateProvince)) Then
+
         Console.WriteLine("Latitude: " & IPR.Latitude)
            Console.WriteLine("State: " + "No Information Found")
+
         Console.WriteLine("Longitude: " & IPR.Longitude)
         Else : Console.WriteLine("State: " + IPR.StateProvince)
+
         Console.WriteLine("Area Code: " & (If(String.IsNullOrEmpty(IPR.AreaCode), "No Information Found", IPR.Organization)))
        End If
+
         Console.WriteLine("Time Zone: " & (If(String.IsNullOrEmpty(IPR.TimeZone), "No Information Found", IPR.TimeZone)))
        If (String.IsNullOrWhiteSpace(IPR.Country)) Then
+
         Console.WriteLine("Daylight Savings: " & IPR.HasDaylightSavings)
            Console.WriteLine("Country: " + "No Information Found")
+
         Console.WriteLine("Certainty: " & IPR.Certainty & "%")
         Else : Console.WriteLine("Country: " + IPR.Country)
+
         Console.WriteLine("Region Name: " & (If(String.IsNullOrEmpty(IPR.RegionName), "No Information Found", IPR.RegionName)))
        End If
+
         Console.WriteLine("Country Code: " & (If(String.IsNullOrEmpty(IPR.CountryCode), "No Information Found", IPR.CountryCode)))
        If (String.IsNullOrWhiteSpace(IPR.Organization)) Then
 
            Console.WriteLine("Organization: " + "No Information Found")
 
         Else : Console.WriteLine("Organization: " + IPR.Organization)
 
        End If
 
         Console.WriteLine("Latitude: " + IPR.Latitude.ToString())
 
         Console.WriteLine("Longitude: " + IPR.Longitude.ToString())
 
        If (String.IsNullOrWhiteSpace(IPR.AreaCode)) Then
 
            Console.WriteLine("Area Code: " + "No Information Found")
 
         Else : Console.WriteLine("Area Code: " + IPR.AreaCode)
 
        End If
 
        If (String.IsNullOrWhiteSpace(IPR.TimeZone)) Then
 
            Console.WriteLine("Time Zone: " + "No Information Found")
 
        Else : Console.WriteLine("Time Zone: " + IPR.TimeZone)
 
        End If
 
         Console.WriteLine("Daylight Savings: " + IPR.HasDaylightSavings.ToString())
 
         Console.WriteLine("Certainty: " + IPR.Certainty.ToString() + "%")
 
         If (String.IsNullOrWhiteSpace(IPR.RegionName)) Then
 
            Console.WriteLine("Region Name: " + "No Information Found")
 
         Else : Console.WriteLine("Region Name: " + IPR.RegionName)
 
        End If
 
        If (String.IsNullOrWhiteSpace(IPR.CountryCode)) Then
 
            Console.WriteLine("Country Code: " + "No Information Found")
 
        Else : Console.WriteLine("Country Code: " + IPR.CountryCode)
 
        End If
 
  
 
         Console.ReadLine()
 
         Console.ReadLine()
Line 225: Line 185:
  
 
End Module
 
End Module
</code>
+
</syntaxhighlight>
  
 
=== Web Service source code examples ===
 
=== Web Service source code examples ===
Line 254: Line 214:
 
=== Pricing ===
 
=== Pricing ===
  
Pricing for all CDYNE Web Services is based off a set monthly maintenance fee and a per-transaction fee. CDYNE does not require a contract and there are absolutely no start-up or cancellation fees. CDYNE services are post-pay. Your credit card will not be charged until one month from sign-up date and will be billed monthly thereafter unless you deactivate or cancel services. Net 30 billing is available upon application approval. <br>
+
[http://cdyne.com/pricing/default.aspx?product=4 Pricing]
 
 
[http://www.cdyne.com/products/pricing.aspx?PGID=810827F7-1478-4A20-B46D-C1425ECA46BB Calculate estimated monthly pricing]
 
 
 
{| class="wikitable" cellspacing="5"
 
|-
 
! Service
 
! align="left"| Trans. Min.
 
! align="left"| Trans. Max.
 
! align="left"| Monthly
 
|-
 
 
 
| IP2Geo Monthly Fee
 
|
 
|
 
| $20.00
 
|-
 
 
 
| IP2Geo Trans fee
 
| Zero
 
| 1,000
 
| $0.0200
 
|-
 
 
 
| IP2Geo Trans fee
 
| 1,001
 
| 3,000
 
| $0.0100
 
|-
 
 
 
| IP2Geo Trans fee
 
| 3,001
 
| Unlimited
 
| $0.0090
 
|-
 
 
 
|}
 

Latest revision as of 11:11, 24 January 2019

Web Personalization for One-to-One Web Marketing

The IP2Geo® Web Service resolves IP addresses to Network Owner Name, City, State/Province, and Country. In most U.S. cities, it will also provide extra information such as Area Code and Latitude/Longitude. This service allows for the integration of location & distance information and other geographic intelligence into your application databases, business processes and web sites.

IP2Geo gives you easy access to numerous data points that you can use to impress your clients. From geographically customized menus to log file analysis, your targeted site visitors will be impressed when they see specific information on their location. The real-time technology can even be used to trigger special "preferred location" promotions.

This service is also used to validate users by IP address to weed out hackers and other fraudsters.

All of CDYNE's Web services are built on XML standards and are delivered via a secure Internet connection. This real-time Web service dynamically delivers value-added information at the point of customer interaction or to the client database for true enterprise intelligence, positively affecting the quality of resultant analytics, customer relationships and the bottom line.

DEVELOPER RESOURCES

General Information

IP2Geo - IP Address to Geographic information.

Developer/Tester Information

PHP Example

 1 <?php
 2 
 3 // Create a new soap client 
 4 $client = new SoapClient('http://ws.cdyne.com/ip2geo/ip2geo.asmx?wsdl');
 5  
 6 $param = array(
 7  'ipAddress' => 'IP ADDRESS',
 8  'licenseKey' => 'YOUR LICENSE KEY',
 9 );
10  
11 $result = $client->ResolveIP($param);
12  
13 // View the response from CDYNE
14 print_r ($result);
15 
16 ?>

JAVA Example

 1 import java.io.ByteArrayOutputStream;
 2 import java.io.InputStream;
 3 import java.net.MalformedURLException;
 4 import java.net.URL; 
 5 import java.util.Properties;
 6 import javax.xml.transform.OutputKeys;
 7 import javax.xml.transform.Source;
 8 import javax.xml.transform.Transformer;
 9 import javax.xml.transform.TransformerFactory;
10 import javax.xml.transform.stream.StreamResult;
11 import javax.xml.transform.stream.StreamSource;
12 
13 public final class ResolveIP{     	
14     public static void main(String[] args) { 	
15 
16            try{		
17             URL url = new URL("http://ws.cdyne.com/ip2geo/ip2geo.asmx/ResolveIP?"
18                                + "ipAddress=IP ADDRESS"
19                                + "&licenseKey=YOUR LICENSE KEY");		
20     try{			
21     InputStream in = url.openStream(); 
22     StreamSource source = new StreamSource(in); 			
23     printResult(source);	
24 }catch(java.io.IOException e){			
25     e.printStackTrace();		
26 }		
27 }catch (MalformedURLException e){		
28     e.printStackTrace();	
29             }     
30     }     
31     private static void printResult(Source source) {        
32             try {            
33             ByteArrayOutputStream bos = new ByteArrayOutputStream();
34             StreamResult sr = new StreamResult(bos);
35             Transformer trans = TransformerFactory.newInstance().newTransformer();
36             Properties oprops = new Properties();
37             oprops.put(OutputKeys.OMIT_XML_DECLARATION, "yes");
38             trans.setOutputProperties(oprops);
39             trans.transform(source, sr);            
40             System.out.println("**** Response ******");            
41             System.out.println(bos.toString());   
42 
43             bos.close();
44             System.out.println();        
45     } catch (Exception e) {            
46             }      
47     }
48 }

VBScript Example

 1 Dim request, oXMLHttp, url
 2 url = "http://ws.cdyne.com/ip2geo/ip2geo.asmx"
 3 
 4 request = "<?xml version='1.0' encoding='utf-8'?>" & _
 5 "<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">" & _
 6 "<soap:Body>" & _
 7 "<ResolveIP xmlns=""http://ws.cdyne.com/"">" & _
 8 "<ipAddress>IP ADDRESS</ipAddress>" & _
 9 "<licenseKey>YOUR LICENSE KEY</licenseKey>" & _
10 "</ResolveIP>" & _
11 "</soap:Body>" & _
12 "</soap:Envelope>"
13 
14 Set oXMLHttp = CreateObject("MSXML2.ServerXMLHTTP")
15 oXMLHttp.open "POST", url, False
16 oXMLHttp.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
17 oXMLHttp.send request
18 response = oXMLHttp.responseText
19 
20 MsgBox oXMLHTTP.responseText

CSharp Example

 1 /*http://ws.cdyne.com/ip2geo/ip2geo.asmx?wsdl was added as a Web Reference and given the name WSDL*/
 2 
 3 using System;
 4 using System.Collections.Generic;
 5 using System.Linq;
 6 using System.Text;
 7 using IP2Geo.WSDL;  
 8 namespace IP2Geo
 9 {
10     class Program
11     {
12         static void Main(string[] args)
13         {
14             WSDL.IP2Geo ip = new WSDL.IP2Geo();
15             WSDL.IPInformation ipr = ip.ResolveIP("IP ADDRESS", "YOUR LICENSE KEY");
16             
17             Console.WriteLine("City: " + (String.IsNullOrEmpty(ipr.City) ? "No Information Found" : ipr.City));
18             Console.WriteLine("State: " + (String.IsNullOrEmpty(ipr.StateProvince) ? "No Information Found" : ipr.StateProvince));
19             Console.WriteLine("Country: " + (String.IsNullOrEmpty(ipr.Country) ? "No Information Found" : ipr.Country));
20             Console.WriteLine("Organization: " + (String.IsNullOrEmpty(ipr.Organization) ? "No Information Found" : ipr.Organization));
21             Console.WriteLine("Latitude: " + ipr.Latitude);
22             Console.WriteLine("Longitude: " + ipr.Longitude);
23             Console.WriteLine("Area Code: " + (String.IsNullOrEmpty(ipr.AreaCode) ? "No Information Found" : ipr.AreaCode));
24             Console.WriteLine("Time Zone: " + (String.IsNullOrEmpty(ipr.TimeZone) ? "No Information Found" : ipr.TimeZone));
25             Console.WriteLine("Daylight Savings: " + ipr.HasDaylightSavings);
26             Console.WriteLine("Certainty: " + ipr.Certainty + "%");
27             Console.WriteLine("Region Name: " + (String.IsNullOrEmpty(ipr.RegionName) ? "No Information Found" : ipr.RegionName));
28             Console.WriteLine("Country Code: " + (String.IsNullOrEmpty(ipr.CountryCode) ? "No Information Found" : ipr.CountryCode));            
29             
30             Console.ReadLine();
31         }
32     }
33 }

VB.Net Example

 1 'http://ws.cdyne.com/ip2geo/ip2geo.asmx?wsdl was added as a Web Reference and given the name WSDL
 2 
 3 Imports ResolveIP.WSDL
 4 Module Module1
 5 
 6     Sub Main()
 7         Dim IP As New IP2Geo()
 8         Dim IPR = IP.ResolveIP("IP ADDRESS", "YOUR LICENSE KEY")
 9 
10         Console.WriteLine("City: " & (If(String.IsNullOrEmpty(IPR.City), "No Information Found", IPR.City)))
11         Console.WriteLine("State: " & (If(String.IsNullOrEmpty(IPR.StateProvince), "No Information Found", IPR.City)))
12         Console.WriteLine("Country: " & (If(String.IsNullOrEmpty(IPR.Country), "No Information Found", IPR.Country)))
13         Console.WriteLine("Organization: " & (If(String.IsNullOrEmpty(IPR.Organization), "No Information Found", IPR.Organization)))
14         Console.WriteLine("Latitude: " & IPR.Latitude)
15         Console.WriteLine("Longitude: " & IPR.Longitude)
16         Console.WriteLine("Area Code: " & (If(String.IsNullOrEmpty(IPR.AreaCode), "No Information Found", IPR.Organization)))
17         Console.WriteLine("Time Zone: " & (If(String.IsNullOrEmpty(IPR.TimeZone), "No Information Found", IPR.TimeZone)))
18         Console.WriteLine("Daylight Savings: " & IPR.HasDaylightSavings)
19         Console.WriteLine("Certainty: " & IPR.Certainty & "%")
20         Console.WriteLine("Region Name: " & (If(String.IsNullOrEmpty(IPR.RegionName), "No Information Found", IPR.RegionName)))
21         Console.WriteLine("Country Code: " & (If(String.IsNullOrEmpty(IPR.CountryCode), "No Information Found", IPR.CountryCode)))
22 
23         Console.ReadLine()
24 
25     End Sub
26 
27 End Module

Web Service source code examples

JSP
Flash
CFM
ASP.NET
ASP
PHP

LICENSE KEYS AND PRICING

Free Trial License Keys

  • CDYNE offers trial license keys for all Web Services so that you may test the APIs for free.
  • Trial keys do not expire, and are limited to approximately 50 transactions.
  • Normal processing time for trial key requests during normal business hours (M-F, 9-6 eastern) typically ranges from ten minutes to two hours.
  • Sign up here for a free trial IP2Geo license key.

Production (Account) License Keys

  • Sign up here for a production IP2Geo license key.
  • Upon registration, your account will be suspended for verification by default.
  • The account verification process takes less than one business day to complete for account activation.
  • You may call 1-800-984-3710 to expedite the verification process over the phone.

Pricing

Pricing