December 27, 2006
Well, you can use this API for it:
The base URL is:
To enter a freeform location (you have one entry box that accepts any address format such as street address, zipcode, city/state, etc):
In other words, just use the “loc” parameter. Currently, only the US is supported for freeforms….I have to decode all potential formats for non-US addresses.
If you would like more accuracy (or international support), break the text entry fields up into multiple fields. Mix and match and use whichever you’d like from the following parameters:
address (street address)
The default URLs above are for the Google Maps API. To use the Virtual Earth API, construct the URL the same as you would above and add the following parameter “&ve=1″ … for example,
Alternatively, if you choose to use neither Google Maps nor Virtual Earth (or to have better control to do what you want), you can set a callback parameter with ‘cb=<MethodName>’ like so:
Some intillegence is there to try to guess the appropriate one…however, if you prefer to override it with your own, you can add the parameter “level=
http://geo.localsearchmaps.com/?city=burbank&state=ca yields Google Maps zoom level 4
but you can force it to zoom level 1 by using this url:
Default behavior is for an alert to happen onerror (currently there are only 2 errors: ‘location not found’ and ‘Please provide a location’). To override this behavior, you can specify a callback for errors by adding a parameter ‘cbe=<function_name>’
For example, the first link below will provide an alert error but the second one will use the specified callback:
Basically, you’ll either use a “script src=<URL>” or
var s = document.createElement( “script” );
document.getElementsByTagName( “head” ).appendChild(s);
Recommendations? Errors? Feature requests? Post them here and I’ll try and fix/add.
UPDATE: You can now lookup information and geocode by IP Address.
To lookup by the requesting IP address, just add “by_ip=1″ like so:
To get city/state info, use a callback:
To lookup an IP address by passing it in, rather than using the requestor’s ip:
Keep in mind, when using IP addresses, that this info isn’t always very good and, in fact, many IP addresses will not have any data. I have built it in to try looking up by IP address when the by_ip=1 parameter is used but to fall back on the other lookup info (i.e. loc or city infor passed in) if the IP address lookup fails.
UPDATE: API now supports &phone= as well as &format=.
The phone parameter tries doing a reverse lookup to find an address then geocodes that address for you.
The format parameter accepts “XML” or “json” to output in those corresponding formats. Here is an example utilizing both of these features:
The above is a lookup of the Burbank Chamber of Commerce phone number.
So what am I asking in return for use of this tool?
Well, I’m asking (but not requiring) a reciprocal link to either the localsearchmaps.com homepage or to this blog’s homepage.
Any usage limitations?
Well, if you overburden this server, I might throttle you or even shut you down if you abuse it (never happened yet!). If you think you are blocked, feel free to email me and I will unblock you as long as we clear up any issues.
UPDATE: I have added a new feature as of 2004/02/24. You can now do a reverse lookup of lat/long to address. It currently is much more limited in area and in accuracy than other components of this framework and its performance/response time is not that great yet so use with caution and I will improve over time (feedback always welcome).
To use it, just specify a latitude and longitude in your request like so:
Like this service? Help make sure it keeps a good level of service (or even improves it) by donating: