I’m exploring the different ways to speed up API response times with the CityGrid APIs. The APIs are fast, and I’ve built several local directories and business search tools that use the API in real-time, with great results. But speed is something that CityGrid engineers and publishers are concerned with, so I will continually explore ways that I can speed of API round trip times (RTT).
Couple days ago I talked about better round trip times with GZip, and today I’d like to talk about enhancing response times by limiting reviews and offers. Generally reviews or offers takes about 20ms each to run (but can occasionally take 50 or 100ms). Since we request reviews, offers, and content (like editorials, website link, menu link, images, etc.) in parallel, the caller only pays for the max of the 3 times with each CityGrid Places API calls. So if the times are like this:
The total time used is 22ms. The place where this can be a real problem, is if reviews or offers times out. Currently the timeout on these services is 400ms (to be reduced to 100ms in the future). So if you are really wanting to improve the RTT and minimize latency you can disable reviews/offers using the following two parameters: review_count=0 and offer_count-=0. This will take the llatency and time-out of those services out of the equation.
So if you are just wanting the core places content and will not need the reviews or offers, you can significantly reduce the payload by disabling these upon request from the CityGrid Places API.
I’m spending the majority of my time lately getting to know all the CityGrid publishers, and understanding how they are building web and mobile applications using CityGrid Places, Reviews, Offers and Advertising APIs.
Today I want to showcase an innovative web development shop in Dallas, Texas called The Emerald Curtain Studio. Phillip Bryan of The Emerald Curtain Studio used the CityGrid Reviews API to write a WordPress plugin that embeds a merchants reviews into their WordPress driven websites.
An example of how The Emerald Curtain Studio implemented reviews for a merchant web site, is on the Zen Salon Centrum in Dallas, TX. The business owners maintained their own CitySearch / CityGrid merchant profiles and wanted their reviews to show up on their business websites.
“I was able to develop the plugin without much trouble, and have used it in three sites so far. The online documentation was very helpful and I was able to develop my tools easily.” says Bryan of The Emerald Curtain Studio.
When you think of using CityGrid Places API, you often think of building nationwide or city local directories, but the usage by The Emerld Curtain Studio demonstrates there is a lot more you can do to provide web development services to existing CityGrid and CitySearch merchants providing added value to your existing services, and making their sites possess much richer content.
I had a CityGrid developer post on the forum today, that they were concerned about the age of some of the reviews they were getting back with API requests.
When they did a search for the Old Spaghetti Factory in Portland, OR–one of the reviews was nine years old.
When making a detail request against the CityGrid Places API you get reviews back with the business listing, without much control over how many, or which reviews when making the request.
Alternatively you can make a request against the CityGrid Reviews API, requesting a broad “where” or longtitue/latitude search for reviews, or specifically request the reviews for a specific places ID.
Three of the primary request fields you can adjust when making a CityGrid Reviews API request are:
- rating – minimal rating for reviews
- days – maximum age i days for the reviews
- rpp – number of results to be returned
Using the CityGrid Reviews API you can get more granular level control over the reviews you display for a city, neighborhood, zip code, specific categories and for specific businesses you are profiling.
Make sure and think about how you will handle reviews for your web or mobile application, and better deliver business reviews for your users, using the CityGrid Reviews API in addition to the CityGrid Places API.