Skip to main content

streetview

PyPI version PyPI Downloads

This is a light module for downloading photos from Google street view. The functions allow you to retrieve current and old photos. Google does have an API for accessing Street View. However, it does not allow you to access old photos. Their javascript API allows you to download segments of current photos. This API also allows you to download each full panorama as you see it on Google Street View.

Please note, Google does not maintain the access points used by this API for public use. Therefore, this hack may break if Google makes changes to how Street View works.

Install

Install from pip with:

pip install streetview

Quick start

Search for Panoramas

The photos on Google street view are panoramas. Each panorama has its own unique ID. Retrieving photos is a two step process. First, you must translate GPS coordinates into panorama IDs. The following code retrieves a list of the closest panoramas:

from streetview import search_panoramas

panos = search_panoramas(lat=41.8982208, lon=12.4764804)
first = panos[0]

print(first)
# pano_id='_R1mwpMkiqa2p0zp48EBJg' lat=41.89820676786453 lon=12.47644220919742 heading=0.8815613985061646 pitch=89.001953125 roll=0.1744659692049026 date='2019-08'

Get Metadata

Not all panoramas will have a date field in the search results. You can fetch a date for any valid panorama from the metadata api:

from streetview import get_panorama_meta

meta = get_panorama_meta(pano_id='_R1mwpMkiqa2p0zp48EBJg', api_key=GOOGLE_MAPS_API_KEY)

print(meta)
# date='2019-08' location=Location(lat=41.89820659475458, lng=12.47644649615282) pano_id='_R1mwpMkiqa2p0zp48EBJg'

Download streetview image

You can then use the panorama ids to download streetview images:

from streetview import get_streetview

image = get_streetview(
    pano_id="z80QZ1_QgCbYwj7RrmlS0Q",
    api_key=GOOGLE_MAPS_API_KEY,
)

image.save("image.jpg", "jpeg")

Download panorama

You can download a full panorama like this:

from streetview import get_panorama

image = get_panorama(pano_id="z80QZ1_QgCbYwj7RrmlS0Q")

image.save("image.jpg", "jpeg")

To download the panorama in an asynchronous context:

from streetview import get_panorama_async

image = await get_panorama_async(pano_id="z80QZ1_QgCbYwj7RrmlS0Q")

image.save("image.jpg", "jpeg")

Release files for streetview 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for streetview 0.1.0
File Size Uploaded
streetview-0.1.0.tar.gz 7.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for streetview 0.1.0
File Interpreter ABI Platform
streetview-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.2 kB

Release files / streetview-0.1.0.tar.gz

Download URL streetview-0.1.0.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d4510f71c409c5682000b2c7d2437f2a16f61ddced4ce6b255e675409204af94
BLAKE2b-256 checksum
How to use checksums
ebe55a6cc72005a20e3a25f88f6878c71dbcfd1c9bb5dc0f0dd66945b43aaf92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / streetview-0.1.0-py3-none-any.whl

Download URL streetview-0.1.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3eae8e1dbe7264d86c6ca79bad93902a31a3d5ae20338c2676da6fb9936fef15
BLAKE2b-256 checksum
How to use checksums
68976e6610c04769647fc6e7f72e86ff98e12595c196bfc8a51a534004bd7f75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page