random-streetview
One call, one random Google Street View panorama.
pip install random-streetview
from random_streetview import random_panorama
pano = random_panorama()
pano.id # 'ptFCsB5aFyaWDDlpbCliVw'
pano.lon # 2.2954822
pano.lat # 48.8583758
pano.url # 'https://www.google.com/maps/@?api=1&map_action=pano&pano=...'
Panorama is a named tuple, so panoid, lon, lat = random_panorama() works too.
Nothing raises on a network or parsing failure — you get None once the
attempts are used up.
Timeouts
random_panorama(max_retry=10, timeout=3.0) # the defaults
timeout is per request, in seconds, and is raised to 0.5 if you ask for
less. A single call budgets at most 30 seconds of timeout across its
attempts, so max_retry is an upper bound rather than a promise: at
timeout=10.0 you get 3 attempts, not 10. The default pairing is sized to
reach all 10. Time actually spent on the wire does not count against the
budget — only the timeouts do.
How it works, and why it can break
Picking a coordinate at random mostly lands you in the ocean, so candidates
come from randomstreetview.com and wandery.it, which keep
lists of places known to have coverage. Each candidate is then resolved to a
panorama id through GeoPhotoService.SingleImageSearch, an undocumented
internal Google Maps endpoint.
That means no API key — and no guarantees. The scraped sites will change their
HTML, and Google can alter or start refusing that endpoint at any time; when
that happens this library returns None rather than breaking your program. If
you need something dependable, use the official
Street View Static API metadata endpoint with a key instead (metadata
requests are not billed).
Requests are not rate-limited for you. Space out your calls.
Development
uv sync
uv run pytest # fully offline; network calls are monkeypatched
License
MIT
Release files for random-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)
| File | Size | Uploaded | |
|---|---|---|---|
| random_streetview-0.1.0.tar.gz | 5.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| random_streetview-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.4 kB
Release files / random_streetview-0.1.0.tar.gz
| Download URL | random_streetview-0.1.0.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
922371607ec39e7ed3d83461b5002a51043fc7db9ad669b24c832be74f80d9fb
|
|
BLAKE2b-256 checksum How to use checksums |
542267cf7de58b96ace3349a38b3ed6ea1ad7da8fa6af1295f866ad343a0bc55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.
Transparency logRelease files / random_streetview-0.1.0-py3-none-any.whl
| Download URL | random_streetview-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
af34c0b465cca7a126dfb950d8e5cd36d950c4b6149afa22d4d0ccce7adeee30
|
|
BLAKE2b-256 checksum How to use checksums |
5cf1c3cc7b6bba569333da6c4cb0edf575683b91445e0d3c73d53d3cd52fafa0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.
Transparency log