Tag Archives: API

Search for Businesses Using Phone Number

I tend to focus on searching for places with a what / where search–the where being a latitude / longitude, address, zip code, neighborhood and metro area.  But there is another quick way to search for a business, using the phone number.

The CityGrid Places Detail Search lets you search for business just by providing a phone number.

Here is an example search for Casa Bianca Pizza in Los Angeles:

All you have to provide is the phone number minus and dashes, spaces or other special characters, the client IP address and your publisher code.

It’s a pretty quick and dirty way to do a search for a business if you don’t know the location.

Better Round Trip-times (RTT) With CityGrid API Using GZip

One of the biggest questions I get when talking with CityGrid developers are around storing our data. Everyone wants to store the 15 million businesses CityGrid has in their own database. My response is really? You do?

This type of thinking comes from legacy thoughts around database driven applications and concerns about network latency. I counter these with a couple of points:

  1. You don’t want to be in big data business, we have teams of engineers working to ingest, clean, optimize and serve up this data. Do you really want to assume these responsibility.
  2. Our places, images, reviews, offers and other content is updated in real-time. If you store the data, you’re missing out on a lot of content that may change frequently.
  3. Speed is getting to be less of a concern when making calls to our APIs–you are looking at millisecond responses and in some worst case scenarios, 1 or 2 seconds.

Usually I can convince most developers about points 1 and 2. But speed is still an ongoing battle. We are working all the time at CityGrid to improve our API response times. But there are things you the developer can do to improve response times also.

One tactic that isn’t available in our documentation, is the use of GZip. With each API request you can set a HTTP header as Accept-Encoding: gzip, and the CityGrid will compress the responses for you, significantly reducing your round-trip time (RTT). Once you receive the response from CityGrid API you can uncompress using the GZIP decoding functionality available in any programming language.

Reducing the size of the data being transmitted is a great way to increase your RTT, which makes relying on any API for real-time calls, much more realistic. I recommend giving it a try when integrating your web or mobile app with the CityGrid Places, Reviews and Offers APIs.

CityGrid Local, Mobile, Social Stack: AskGeo

I’m adding another tool to the CityGrid Local, Mobile, Social Stack. This time its a service that allows you to find out the time zone information for a longitude and latitude, called AskGeo.

AskGeo is a dead simple REST API that lets you give a latitude and longitude and the API returns the unix (Olson) time zone ID (e.g., “America/Chicago”, “Europe/London”), the Windows Standard Name for the time zone (e.g., “Pacific Standard Time”, “Central European Standard Time”), and the current offset from UTC.

The API is free to try, and it is free for non-commercial and personal use. Open source projects, students, and private individuals may use it free of charge, but any user that wishes to use the API for commercial purposes must pay an access fee of $200 per year.

Currently they have a Java Library for working with the time zone API, and you can find complete documentation on the AskGeo website.

AskGeo is definitely an essential addition to the local, mobile, social stack–I see it providing providing a utility you can use for transit, travel, meeting and other time sensitive aspects of mobile and web application development.