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, a call draws a random coordinate from a set of weighted latitude/longitude boxes that cover land with dense Street View coverage, then asks Google's internal SingleImageSearch endpoint for the nearest panorama to it. If the draw lands somewhere with no coverage the endpoint says so and the call simply tries again, up to max_retry times. Naver and Kakao work the same way but draw from inland South Korea and hit each service's own nearby-panorama endpoint.

The boxes are weighted so the result is spread across the globe instead of piling up in any one country:

Street View coverage boxes used for the worldwide Google search

All three endpoints are undocumented internal map endpoints hit without an API key — so there are no guarantees. A provider can change the response format or start refusing these calls 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.4.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.4.0
File Size Uploaded Provenance Actions
random_streetview-0.4.0.tar.gz 9.4 kB With provenance Details for random_streetview-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 18.1 kB

Release files / random_streetview-0.4.0.tar.gz

Download URL random_streetview-0.4.0.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5d5e787098d3b57cdddfac1a9c8025e2a50946a3e638d4fa8e8627d8414b5c18
BLAKE2b-256 checksum
How to use checksums
5357055af1240ac8d1717a473dde2a95a0bb2469239a50d7f1879f4c628d72ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 2, 2026.

Transparency log

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

Download URL random_streetview-0.4.0-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0eb40c43d46186eb19c85f100d3108405f9837331f1b192d130a576173db8149
BLAKE2b-256 checksum
How to use checksums
a123c50f1dbf9c68c3e8c117000cf97389fd8829509b1889f7d87ba15f85b21d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 2, 2026.

Transparency log

Security for random-streetview 0.4.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for random_streetview-0.4.0.tar.gz

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 Nov 2, 2026.

Transparency log

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