Skip to main content

random-streetview

PyPI Python

One call, one random Street View panorama. Google is worldwide and the default; Naver and Kakao return road-view panoramas from South Korea.

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.platform # 'google'
pano.url      # 'https://www.google.com/maps/@?api=1&map_action=pano&pano=...'

Panorama is a named tuple, so panoid, lon, lat, platform = random_panorama() works too (platform defaults to 'google' when constructed directly).

Nothing raises on a network or parsing failure — you get None once the attempts are used up.

Platforms

random_panorama()                     # Google, worldwide (default)
random_panorama(platform="naver")     # Naver, South Korea
random_panorama(platform="kakao")     # Kakao, South Korea

platform is one of "google", "naver", "kakao"; anything else raises ValueError. pano.platform records which one produced the result, and pano.url builds the matching map link.

Naver and Kakao only cover South Korea, so their candidate coordinates are drawn from inland Korea rather than the worldwide lists Google uses. Both hit undocumented internal map endpoints — same no-key, no-guarantees caveat as Google below — and return None rather than raising when they come up empty.

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

For Google, picking a coordinate at random mostly lands you in the ocean, and Google has retired the endpoint that used to turn a coordinate into a panorama id. So candidates are scraped from wandery.it, which embeds real Street View panorama ids, and each one is confirmed through Google's photometa endpoint, an undocumented internal Google Maps endpoint. Naver and Kakao draw a random coordinate inside South Korea and ask that service's nearby-panorama endpoint, equally undocumented.

That means no API key — and no guarantees. The scraped site will change its HTML, and the providers can alter or start refusing those endpoints 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

Metadata

Release files for random-streetview 0.3.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 random-streetview 0.3.0
File Size Uploaded Provenance Actions
random_streetview-0.3.0.tar.gz 8.2 kB Without provenance Details for random_streetview-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 16.0 kB

Release files / random_streetview-0.3.0.tar.gz

Download URL random_streetview-0.3.0.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c36b7500ad75be9439ec47117948a82738f4cf929d728b4e1815dc160fbbd9b0
BLAKE2b-256 checksum
How to use checksums
9b8dec09d1de5954595d937c8b756d85e62274a95056efa94cfd17f7e2215963
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release files / random_streetview-0.3.0-py3-none-any.whl

Download URL random_streetview-0.3.0-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
62b0d6e77f21597154171447497b3630ad93ff0b634c2a227701370fcca9ab10
BLAKE2b-256 checksum
How to use checksums
25ce70342b37a5d44aacece279dca1da9ded271ba5fe6e9dd6b38da9be947edc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Security for random-streetview 0.3.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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