Using the API to return the city code only

General Discussion about IP Address Lookup caveats, technology, ideas, etc.

Moderator: Moderators

Using the API to return the city code only

Postby blahblah on Sat May 20, 2006 3:41 pm

Is there something similar to http://api.hostip.info/country.php for returning the city only? Seems to me it would be much easier to have an API for this rather than returning all the info available in the XML format and then having to parse that out.

Please advise.

-CP
blahblah
n00b
 
Posts: 1
Joined: Sat May 20, 2006 3:38 pm

Postby robocoder on Fri Jun 09, 2006 9:21 pm

Not at the moment. If I'm not mistaken, only about 5% of the /24 blocks have been assigned a city, thus far. (i.e. 850,000 entries out of 256*256*256)
User avatar
robocoder
Veteran
 
Posts: 105
Joined: Sat Mar 25, 2006 8:10 pm
Location: Ontario, Canada

Kind of late, but...

Postby ssd on Tue Oct 23, 2007 12:15 pm

Using PHP, you could use the string function explode to break the data apart (perhaps by :).

I was able to successfully grab and split the City and State information by using the file array and then exploding the data by : and ,

I'm sure it's one of many ways to achieve the desired effect..
ssd
n00b
 
Posts: 1
Joined: Tue Oct 23, 2007 12:09 pm
Location: edmonton


Return to IP Address Lookup

Who is online

Users browsing this forum: No registered users and 1 guest

cron