1

Is anyone aware of a (preferablly free) webservice that would accept a SOAP or REST request.

This request would contain an IP address, and the service would return an approximation of that IP's location.

EDIT: I need resolution down to the city of possible.

MattBelanger
  • 5,280
  • 6
  • 37
  • 34
FlySwat
  • 172,459
  • 74
  • 246
  • 311

3 Answers3

2

MaxMind do a fairly cheap one. You send the IP as a query string parameter, then it sends you back either a 2 letter code or an error code. We used it for quite a while before moving to our own lookup tables, and it's quick and reliable.

Found the link: http://www.maxmind.com/app/web_services#country - it's $20 for 200,000 lookups which isn't bad value at all.

EDIT: MaxMind also do a service with resolution down to the city: http://www.maxmind.com/app/web_services#city. It's a bit more expensive at $20 for 50,000 queries but that still isn't too bad. I can't vouch for the accuracy of this service though as I have only used the country resolution one, as that's all we need.

Greg Beech
  • 133,383
  • 43
  • 204
  • 250
  • That's not REST, that's basically RPC over HTTP. – Jim Sep 22 '08 at 22:25
  • So the question specifically asked for REST or SOAP. That is neither. – Jim Sep 22 '08 at 23:20
  • Yawn. Whining about semantics doesn't help anybody. You can't built a REST-style service for this because the artefact (the country code) for a given URL is non-constant, so my assumption was that any web based service with a trivial to construct request would be sufficient. – Greg Beech Sep 22 '08 at 23:28
  • I'm not whining about semantics, I'm merely pointing out that somebody asked specifically for REST or SOAP, and this is neither. You can easily build a REST-style service for this, for example, you could treat IP addresses as resources, and the country they reside in as data within those resources. – Jim Sep 23 '08 at 00:10
  • I'd be really surprised if anybody except ivory tower purists were that bothered about whether the end of the URL is ?ip=80.192.33.20 or /80.192.33.20 - but if you feel that strongly about it then feel free to give the answer a negative vote. I prefer pragmatism. – Greg Beech Sep 23 '08 at 00:19
  • Look mate, I'm not saying REST is best. I'm not saying that you are a bad programmer. I'm not saying MaxMind is not useful. All I'm saying is that Jonathan asked for REST or SOAP, and that is neither. Quit being so over-sensitive. You're lashing out because I dared point out a problem? Grow up. – Jim Sep 23 '08 at 00:32
  • FYI, RPC over a querystring would suffice. I'd have preferred SOAP, as we have an existing SOAP logging and cacheing framework, but you take what you can get :) – FlySwat Sep 23 '08 at 00:44
1

It's not a web service, but MaxMind also provide a free database that you can download. If you need a web service, then it would be trivial to set one up on your own server using this database. You can also get a site-license for a more accurate database if the free one isn't suitable.

Jim
  • 72,985
  • 14
  • 101
  • 108
0

There is http://countries.nerd.dk which provides country information by IP. How much resolution do you need?

Greg Hewgill
  • 951,095
  • 183
  • 1,149
  • 1,285