Google Streetview Static API

May 15th, 2010

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.

Google Maps Showing Streetview Thumbnail

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:
Example of Streetview Tile Zoom Level 0
Single Tile – X=0, Y=0

Zoom Level 1:
Example of Streetview Tile Zoom Level 1
Tile 1 – X=0, Y=0 Tile 2 – X=1, Y=0

Zoom Level 2
Example of Streetview Tile Zoom Level 2
4 X positions (0-3), 2 Y positions (0-1)

Zoom Level 3
Example of Streetview Tile Zoom Level 3
6 X positions (0-5), 3 Y positions (0-2)

Zoom Level 4
Example of Streetview Tile Zoom Level 4
13 X positions (0-12), 7 Y positions (0-6)

Zoom Level 5
Example of Streetview Tile 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.


Google Streetview Tile Viewer Demo

View the demo here

Posted in Web | Tagged with: , , , ,

57 Responses

  1. Rick Nunn

    Some really nice work here dude, now I just need to find a project to use it on.

  2. Jake

    Really nice job digging through all of those url requests, and then making good sense of it. Really appreciate the post!

  3. miguel

    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

  4. miguel

    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

  5. Jamie Thompson

    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.

  6. 非官方的 Google Street View 静态 API | 谷奥——探寻谷歌的奥秘

    [...] jamiethompson.co.uk 本站文章除注明转载外,均为本站原创编译 [...]

  7. 谷奥: 非官方的 Google Street View 静态 API » 软件速递 - 更新最快的软件资讯站

    [...] Via jamiethompson.co.uk [...]

  8. notalawyer

    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

  9. Google Streetview Static API – Jamie Thompson : Popular Links : eConsultant

    [...] reading here: Google Streetview Static API – Jamie Thompson 17 May 2010 | Uncategorized | Trackback | del.icio.us | Stumble it! | View Count : 0 Next Post [...]

  10. matt

    @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

  11. links for 2010-06-20 « Mandarine

    [...] 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) [...]

  12. Jamie Thompson

    @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?

  13. Ken

    I may have no use for this whatsoever, but I appreciate the work you put in this.

    Ignore that haters.

  14. Before and After, During, Then and Now « things magazine

    [...] 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 [...]

  15. Luke

    They are just haters, Jamie Thompson. Let them hate, good job!

  16. Stephen

    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

  17. michael

    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

  18. Saurabh

    The post is really helpful Jamie…good work!

  19. Jose Emilio

    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.

  20. Jimbojones ...

    as well as yaw, the pitch parameter is also available …

    it goes from
    pitch=-90 (looking up)
    to
    pitch=90 (looking down)

  21. GoogleBig » Archive » How to Create Street View Videos

    [...] Google’s Hidden Street View Still Images API [...]

  22. Let’s Make a Street View! Part 0 | Extremely Satisfactory Totalitarianism

    [...] 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, [...]

  23. Robert

    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?

  24. Jamie Thompson

    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.

  25. Kieran McCarthy

    Great research well done! Will you be releasing your “streetview_tiles.php” script at any time?

    Thanks

    Kieran

  26. Bobby

    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.

  27. Luke

    Hiya.

    This article is really interesting, thanks. Other than thumbnail and xml – do you know of other output options?

    Luke

  28. Phillip Napieralski

    This is really interesting stuff and actually really relevant to some image processing research I’m working on. Thanks!

  29. power balance armband wirkung

    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.

  30. Ben

    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.

  31. David Engelmaier

    Great job Jamie, thanks!

  32. Veijo

    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…

  33. Gilloub

    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

  34. taiduolea

    http://valorieviorel.fotopages.com/

  35. Stephen

    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!

  36. plate joiners

    That’s really true said,i am some how agree with what you said.

  37. plate joiner

    It’s a great opportunity to be here,Once again i will visit this page.

  38. Gout Home Remedies

    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.

  39. USMLE step 1

    BwnzYoU Ambien

  40. Medical Books

    Found your blog in the AOL wholesale bulk t-shirts directory, very nice job, thanks.

  41. signs of depression in women

    I really enjoy the fact that people are truthfully expressing their ideas. So I really enjoy your writing style

  42. ygraerio auokinito

    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!

  43. kona ugg

    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.

  44. tudou99

    I for one value the time you put into your conclusions and wish to check out much more of your opinions once more soon.

  45. sexshop

    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.

  46. Patrick

    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

  47. jidanni

    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.

  48. Guest

    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

  49. Jon Meggitt

    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

  50. Perspective and Deconstructing Photosynth « Kaigani Turner

    [...] Lately i’ve been obsessed with the panoramic images created by Photosynth, or downloadable from Google Maps Streetview. (As below, via Jamie Thompson) [...]

  51. Guest

    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

  52. Guest

    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

  53. The Best of Google Street View Part II | That Was Random .com - Sharing Random Videos, Images and More. Sharing Random Stuff from Present to Nostalgic

    [...] 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{ [...]

  54. Jordan Retros

    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

  55. Marc Antoni Malagarriga i Picas

    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!

  56. uptodate

    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

  57. I miss the old Streetview – Flipflops.org

    [...] 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 [...]

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.