This is real interesting mashup using an new Rest to Excel library entry for the urbarama API. This is a repository of interesting architectural interests. The API is quite interesting in that you can you supply a max an min longitude and latitude, which creates a box within which any items in the urbarama database are selected.

Mashup with geoCoder

Since max/min lat/lon don’t exactly tip off the tongue, I figured I’d mash it up with another rest entry – the yahoo geoCoder and create the API call from a dialogue. I decided to use yahoo since Google really wants you to have an API key nowadays. First though, I needed some trig to work this out. See Caculate lat/lon from distance for how all that works  if you are interested or need the code. There are both Google Apps Script and VBA versions.


This is the complete code – VBA version. Turns out to be pretty straightforward


First off we grab some place to be the origin of the query, and pass it off as a rest query to our yahoo geocoding rest entry. This can be any geocodable piece of text.


We then end up with a cJobject with the Yahoo response, so we pick up the geoCoded latitude and longitude that will serve as our origin, then get the maximum distance away to consider to search for items of architectural interest from the urbarama database. 

We then use this to create a ‘box of interest’ around the origin, like this

The distance given is used as the no. of kilometers from the origin to the corner of a ‘box of interest’. We can use -135 degrees and +45 degrees as the heading angle to back into the calculation of minimum and maximum longitudes/latitudes required by the urbarama APINow we can use the newly added urbarama api entry, which looks like this … 


passing the dimensions of our box …


and we get all items of interest within the given box, a sample of which is below

Next step, we’ll integrate that with Mapping and adding markers to maps and plot them , using their thumbnails as markers and the their details as infobox details. But that’s for another day. 


As an aside, here’s an interesting way to combine these multiple APIS into one. You will find this code in the google apps script mcpher library or in the downloadable cDataSet.xlsm (usefulStuff module), at this gist, and below. The google Apps Script example spreadsheet is here.

Apps script version

VBA version


You can download this example and all other code in the cDataSet.xlsm from Downloads.

Continue reading about Rest to Excel Library here