Google Streetview Static API
It is possible to extract both thumbnails and higher resolution images (tiles) from the Google Streetview service through an unpublished, undocumented API which I will document below. Google have not publicly released this API, but nor have they sought to secure or even obfuscate it in any way. To me, this is about as open an invitation as it gets.
Thumbnails (The Easy Bit)
You might have noticed that more often than not, when viewing a location on Google Maps nowadays you get a little Streetview thumbnail linking to the appropriate location on Google Streetview. If you’ve ever wondered if you could get static streetview imaging out Google for your own use then read on.
Inspection of the image source reveals something quite surprising:
http://cbk0.google.com/cbk?output=thumbnail&w=90&h=68&ll=51.494966,-0.146674
http://cbk0.google.com/cbk?output=thumbnail&w=[WIDTH]&h=[HEIGHT]&ll=[LAT,LNG]
Not exactly cryptic is it. We have a width, a height and a lat/lng pair. Playing with the values of width and height you will find the maximum dimensions available are 416×208 pixels, giving you a full, albeit small, 360 degree panorama of your desired location. You can play with the coordinates too but specifying a location without a streetview panorama will result in a 404 error.
I think I’m panoid…
Each Streetview panorama is uniquely identified by an panoid. I’m pretty sure this is a timecode hash but I haven’t looked into it any further. For the purposes of fetching Streetview images the only important thing to consider is that these are unique ids.
If you’re like me, you’ve been looking at the example above and wondering what other output types there are besides ‘thumbnail’. One of the other options is ‘xml’, which returns some handy metadata for a given location. You can use this data to determine if there is a streetview panorama available at your chosen location.
http://cbk0.google.com/cbk?output=xml&ll=[LAT,LNG]
Example:
http://cbk0.google.com/cbk?output=xml&ll=51.494966,-0.146674
<panorama> <data_properties image_width="13312" image_height="6656" tile_width="512" tile_height="512" pano_id="sLaiF6Jex7mJmNol7tdOoA" num_zoom_levels="3" lat="51.495090" lng="-0.146971" original_lat="51.495098" original_lng="-0.147000"> <copyright>© 2010 Google</copyright> <text>Eccleston Pl</text> <region>London, England</region> <country>United Kingdom</country> <data_flag>1</data_flag> </data_properties> <projection_properties projection_type="spherical" pano_yaw_deg="201.78" tilt_yaw_deg="92.06" tilt_pitch_deg="1.75"/> <annotation_properties> <link yaw_deg="204.7" pano_id="CeutxcyB2V74lfN_fJwRww" road_argb="0x80ffffff"> <link_text>Eccleston Pl</link_text> </link> <link yaw_deg="24.7" pano_id="t_mnKSugTLrQTEnJplXQ3A" road_argb="0x80ffffff"> <link_text>Eccleston Pl</link_text> </link> </annotation_properties> </panorama>
This returns a lot of data, but for now we’ll simply concentrate on the panoid values. Generally there will be three panoids. One as an attribute of the data_properties element and two as the attributes of the two link elements of the annotation_properties element. As far as I can tell the supplemental two panoids relate to the previous and next panorama on the route.
So in this example we end up with a main panoid of “sLaiF6Jex7mJmNol7tdOoA”
Finally we can plug this value into the thumbnail url as follows:
http://cbk0.google.com/cbk?output=thumbnail&w=[WIDTH]&h=[HEIGHT]&panoid=[PID]
http://cbk0.google.com/cbk?output=thumbnail&w=416&h=208&panoid=sLaiF6Jex7mJmNol7tdOoA
Notice how we end up with exactly the same panorama, but at a different offset.
With a little extra work, tying this into the Open Postcode Geocoding API, I came up with a nice little wrapper around this accepting a UK postcode and directly returning the corresponding panorama thumbnail. I’ve added this to my geo webservice and it is callable as follows:
http://geo.jamiethompson.co.uk/streetview/[POSTCODE]_[WIDTH]x[HEIGHT].jpg
Example
http://geo.jamiethompson.co.uk/streetview/SW1W9TQ_416×208.jpg
The high detail tiles
So, you probably noticed some info relating to tiles in the xml data in the previous example. It’s possible to fetch a set of 512 pixel square tiles at various zoom levels for a given panorama using the following request.
http://cbk0.google.com/cbk?output=tile&panoid=[PID]&zoom=[ZOOM]&x=[X]&y=[Y]
[X] and [Y] relate to the horizontal and vertical tile positions, while [ZOOM] relates to the zoom level. If the XML data is to be believed there are 3 zoom levels, but I have found there to be 5. The number of X and Y positions increases with each zoom level. These are zero based.
Zoom Level 0:

Single Tile – X=0, Y=0
Zoom Level 1:

Tile 1 – X=0, Y=0 Tile 2 – X=1, Y=0
Zoom Level 2

4 X positions (0-3), 2 Y positions (0-1)
Zoom Level 3

6 X positions (0-5), 3 Y positions (0-2)
Zoom Level 4

13 X positions (0-12), 7 Y positions (0-6)
Zoom Level 5

26 X positions (0-25), 13 Y positions (0-12)
Demo
I’ve put together a very quick and dirty demo page that displays the tiles re-assembled for any given UK postcode. Be warned, at zoom level 5 this will download 338 512×512 pixel tiles, roughly 7-8MB.
Posted in Web | Tagged with: api, geocoding, Google, postcode, Streetview



May 15th, 2010 at 11:20 pm
Some really nice work here dude, now I just need to find a project to use it on.
May 24th, 2010 at 11:16 pm
Really nice job digging through all of those url requests, and then making good sense of it. Really appreciate the post!
June 7th, 2010 at 2:09 am
Hola, buen post.
¿has usado este método en sitios web de gran carga?
Quiero decir que si google te ha bloqueado el uso de este método
June 7th, 2010 at 2:09 am
Ups, English now
Hi, nice post.
Have you used this method in high-load websites?
I mean if google has blocked the use of this method
June 15th, 2010 at 1:28 pm
For now at least, I don’t think it would be a great idea to rely on this method for anything with a moderate to high load. There’s no official word from Google as such but I’m guessing that if there were it would be along the lines of “Please don’t do this”. Having said that, I keep thinking I might try it out in some non-mission-critical way in a production environment and see what happens.
June 19th, 2010 at 7:33 pm
[...] jamiethompson.co.uk 本站文章除注明转载外,均为本站原创编译 [...]
June 19th, 2010 at 9:19 pm
[...] Via jamiethompson.co.uk [...]
June 20th, 2010 at 11:20 am
but I think you might be violating the google maps/google earth terms of service when you do this – sections 2 and 4 in particular.
http://www.google.com/intl/en_ALL/help/terms_maps.html
June 20th, 2010 at 1:10 pm
[...] reading here: Google Streetview Static API – Jamie Thompson 17 May 2010 | Uncategorized | Trackback | del.icio.us | Stumble it! | View Count : 0 Next Post [...]
June 20th, 2010 at 11:00 pm
@miguel, google won’t block this because it doesn’t do anything they didn’t already allow in the streetviewer. the fuckwit jamie thompson has no idea what he is doing and is just using what is already available claiming it is some discovery
June 21st, 2010 at 5:06 am
[...] Google Streetview Static API – Jamie Thompson I’ve put together a very quick and dirty demo page that displays the tiles re-assembled for any given UK postcode. Be warned, at zoom level 5 this will download 338 512×512 pixel tiles, roughly 7-8MB. (tags: google maps photo) [...]
June 21st, 2010 at 8:01 am
@matt Whoa, hold your horses – and your language. Why so angry? I’m not sure how/where I claimed some kind of discovery. I certainly wasn’t the first person to notice and use the Street View HTTP API, and as I’ve quite clearly demonstrated above it’s really not very complicated.
I think you need to calm down a little. This isn’t meant to be anything more than a very basic tutorial. Please re-read it if you like. I’m clearly not claiming to have ‘discovered’ anything (other than the fact that the XML denotes 3 zoom levels when there are actually 5.. which is no real secret as you can zoom in this far with the flash viewer)
I noticed something I found interesting and shared it with others. If that makes me a ‘fuckwit’ then a fuckwit I most certainly am.
So, um, yeah. WTF?
June 21st, 2010 at 10:30 pm
I may have no use for this whatsoever, but I appreciate the work you put in this.
Ignore that haters.
June 22nd, 2010 at 8:11 pm
[...] are doing great things with free APIs. These Streetview panoramas by Jamie Thompson are highly reminiscent of Hockney’s polaroid collages / History Rambler, photographs of [...]
June 24th, 2010 at 11:17 pm
They are just haters, Jamie Thompson. Let them hate, good job!
June 27th, 2010 at 12:12 pm
This is awesome work Jamie.
You’ve really shown how to leverage the web and all that goes with it.
I will certainly be continuing to follow your work.
Cheers
Stephen
June 30th, 2010 at 8:56 am
nice work, you know there is another param which changes the angle the camera is facing. useful if you want the other side of the road but you only have the co-ords.
yaw=90
east is 90, west is 270, north is 0, south is 180. you can do any number from 0 to 360
July 16th, 2010 at 6:49 am
The post is really helpful Jamie…good work!
July 24th, 2010 at 9:01 am
I attemp to run between panoid.
In the XML you have the nearest panoid. You can get the information of this panoid with.
http://cbk0.google.com/cbk?output=xml&panoid=PID
It’s simple.
August 25th, 2010 at 4:45 pm
as well as yaw, the pitch parameter is also available …
it goes from
pitch=-90 (looking up)
to
pitch=90 (looking down)
September 7th, 2010 at 4:30 pm
[...] Google’s Hidden Street View Still Images API [...]
September 10th, 2010 at 2:03 pm
[...] projection, which you can see directly in this great demo by Jamie Thompson (and related blog post). I’ve stolen an image from him of tiles for one location, but go take a look at his work, [...]
September 23rd, 2010 at 5:04 pm
I love the idea of this. How hard would it be to do the same but rather than UK Postal codes using Canadian Postal Codes?
September 23rd, 2010 at 5:13 pm
Assuming that you can accurately obtain the lat/lng coordinates of Canadian postal codes (which I believe you can) it would work in exactly the same way.
October 4th, 2010 at 8:17 pm
Great research well done! Will you be releasing your “streetview_tiles.php” script at any time?
Thanks
Kieran
October 28th, 2010 at 1:52 pm
Good hunting Jamie! Is there any way of getting the closest/next panoid? Since i want to do a dollyshot/pan along a street rather then a panorama 360.
November 26th, 2010 at 5:39 pm
Hiya.
This article is really interesting, thanks. Other than thumbnail and xml – do you know of other output options?
Luke
January 21st, 2011 at 2:50 am
This is really interesting stuff and actually really relevant to some image processing research I’m working on. Thanks!
January 23rd, 2011 at 12:45 pm
This is a very cool blog, thanks a lot for this! I’ve read a great deal about this topic within the past and I agree with you.
January 27th, 2011 at 4:54 pm
Great article, thanks! If anyone is interested in US locations or any location, I found further info on how to show street view images for any geo location, as opposed to a UK zipcode.
February 1st, 2011 at 1:45 pm
Great job Jamie, thanks!
February 12th, 2011 at 6:48 pm
Hi,
The article is great but unfortunately the following link reveals some legal problems related to the subject: http://igargoyle.com/streetview/ . Our student group was supposed to create a software library, which would have used the API, but lets see what happens to that project…
February 14th, 2011 at 10:00 am
nice shot man,
this is exactly what I needed for a project, I have to display a alpha channel video on a top of a panorama for a facebook app .
I’ll drop a small flash library later on which search for the nearest pov and display the panorama using tiles.
for the copyright issue if you add at the bottom of the image the copyright copy provided by the webservice, it should be alright.
thanks, great work
March 29th, 2011 at 9:00 am
http://valorieviorel.fotopages.com/
March 31st, 2011 at 11:42 am
Is there a way to generate the tiles in the same way but just using the panoID? It isn’t always possible to find out the postcode and it’s a pain to manually change all the x and y values doing it the other way. Nice script btw!
June 20th, 2011 at 8:23 pm
That’s really true said,i am some how agree with what you said.
June 20th, 2011 at 10:32 pm
It’s a great opportunity to be here,Once again i will visit this page.
June 24th, 2011 at 10:31 pm
This is what i believe in and the information is quite great,i have saerched for such info for few days but harldy found here.
July 3rd, 2011 at 10:43 am
BwnzYoU Ambien
July 8th, 2011 at 7:41 am
Found your blog in the AOL wholesale bulk t-shirts directory, very nice job, thanks.
August 1st, 2011 at 6:27 pm
I really enjoy the fact that people are truthfully expressing their ideas. So I really enjoy your writing style
August 8th, 2011 at 8:23 pm
This design is steller! You definitely know how to keep a reader amused. Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Excellent job. I really loved what you had to say, and more than that, how you presented it. Too cool!
August 28th, 2011 at 2:44 am
Whats up! I simply want to give an enormous thumbs up for the good information you’ve got here on this post. I will probably be coming back to your weblog for extra soon.
September 9th, 2011 at 5:29 pm
I for one value the time you put into your conclusions and wish to check out much more of your opinions once more soon.
September 12th, 2011 at 9:11 am
It’s really a great and helpful piece of info. I am glad that you shared this useful information with us. Please keep us up to date like this. Thank you for sharing.
October 22nd, 2011 at 11:30 am
Hi,
Very good job ! When using zoom=5, the tiles I can download are not of same size: some are 512×512, others are 256×256. Did you remark it ? Any reason ?
Patrick
November 10th, 2011 at 1:53 pm
See also http://code.google.com/apis/maps/documentation/streetview/index.html .
Maybe the panoramas can be accomplished by three adjacent pictures from this documented API.
November 29th, 2011 at 6:28 pm
well job ! but after getting the tiles how do i make a panorama with the tiles files or rebuild them to get a street view??? thanks
December 2nd, 2011 at 10:28 am
great work Jamie – thanks for sharing. I’m using the end points to create an Away3D-based recreation of StreetView, with special effects. I got in touch with the geo team at Google UK and was reassured that, even though this is outside of the Terms of Service, as long as the imagery is credited to the original provider then it ’s ok with them. For anyone who is interested, the image provider can be determined by the data property ‘copyright’ that gets returned in the xml.
Thanks
Jon
December 4th, 2011 at 9:15 am
[...] Lately i’ve been obsessed with the panoramic images created by Photosynth, or downloadable from Google Maps Streetview. (As below, via Jamie Thompson) [...]
December 9th, 2011 at 8:50 pm
heloo, so there is no way to rebuild with “tiles images” a 3d view or panoramic view like “google street view” ???? please tell me how to do !!! thanks
December 9th, 2011 at 9:05 pm
heloo, so there is no way to rebuild with “tiles images” a 3d view or panoramic view like “google street view” ???? please tell me how to do !!! thanksss
December 17th, 2011 at 1:03 am
[...] ShooterGoogle Street View hits the slopesGoogle Street View documents Japan tsunami devastationGoogle Streetview Static API – Jamie Thompson ul.legalfooter li{ list-style:none; float:left; padding-right:20px; } .accept{ [...]
December 24th, 2011 at 2:54 am
rain, Jordan 20 there Jordan Retrosare two jordan 9 flight channels: generally near canals area of rain will drain through a variety of jordan 15 buildings, as well Jordan 9 as Jordan Retro 20 roadside stormwater drains flow directly into the accumulation of discha… Jordan Retros
December 31st, 2011 at 3:52 pm
Hi Jamie, many, many thanks for your detalied post. On the other hand, here you have a little gift, product in any way from your description…
http://www.femfum.com/Nadal2011/
…happy new year!
January 5th, 2012 at 8:29 am
Hey, nice blog with good info. I really like coming back here often. There?s only one thing that annoys me and that is the misfunctioning of comment posting. I usually get to 500 error page, and have to do the post twice. – Better to remain silent and be thought a fool than to speak out and remove all doubt. – Abraham Lincoln 1809 – 1865
February 1st, 2012 at 12:26 am
[...] the flip side we now the have API for static streetview images – I’ve been using Jamie Thompson’s brilliant work on getting static map images up until now, but it is time to move [...]