You have chosen to sponsor your bid up to a maximum amount of .
Need a C# .NET class that can be used as part of an existing website to retrieve and parse geo information about an IP address (IPv4).
Connection to TWO different geo APIs would be required for failover, ideally one should be retrieved as XML and the other as JSON so our programmers will have both code examples for future reference.
Here's what needed: class is instantiated from an asp.net page, calls one of the APIs (which one is passed as parameter to a call) parses return into a class variables. Choose two of the free APIs provided below. Code cannot hang if internet or server is not accessible, and also will be executed as part of a record retrieval (and DB Update, not in this scope), so we also need an ability to limit how long a call can be executed, in seconds (for instance, call API, if no response in 5 secs, return error).
For a successful call, store return in class variables, as:
RawResponse, CountryCode, CountryName, RegionCode, RegionName, Longitude, Latitude, City, PostalCode (Zip), MetroCode, AreaCode
DB and other system interaction is not part of this scope.
Available APIs (18.104.22.168 is a sample IP address):
1) freegeoip.net (example: http://freegeoip.net/xml/22.214.171.124 , freegeoip.net/json/126.96.36.199 )
2) telize.com (example: http://telize.com/geoip/188.8.131.52 )
3) ip-api.com (ex: http://ip-api.com/xml/184.108.40.206 , http://ip-api.com/json/220.127.116.11 )
Should be properly , professionally coded, no refactoring needed. Our current system uses .NET 2.0 , but can also go with .NET 3.5 , please make sure your class works . Let me know which JSON parser you are planning to use, we already use Newtonsoft.JSON on some projects. Also look here: