A lightweight Python CLI that extracts a Google Place ID from a Google Maps URL.
Use it when you have a Maps link and need the Place ID quickly, without setting up API credentials.
Try it now: https://google-place-id-finder.pages.dev
This hosted web tool lets you extract a Google Place ID instantly, with no local Python script or setup required.
Google's official Place ID Finder tools are useful, but they can fail for some businesses, especially those without a fixed street address.
For example, the official finder at https://developers.google.com/maps/documentation/javascript/examples/places-placeid-finder may return no result in those cases.
This tool exists to solve that gap: if a business listing can be found on Google Maps and you have its Maps URL, this script can extract the Place ID directly from that URL.
- Works with full Google Maps URLs containing
!1s0x...:0x... - Works with resolved Maps URLs containing
ftid=0x...:0x...(common from mobile share links) - Resolves
maps.app.goo.glshort links automatically - No third-party dependencies
- Helpful exit codes for scripting/automation
# 1) Clone
git clone https://github.com/liqfx/google-place-id-finder.git
cd google-place-id-finder
# 2) Run
python3 extract_place_id.py "<google maps url>"- Python 3.9 or newer
python3 extract_place_id.pypython3 extract_place_id.py "<google maps url>"python3 extract_place_id.py --helppython3 extract_place_id.py "https://www.google.com/maps/place/Example+Business/data=!3m1!4b1!4m5!3m4!1s0x1111111111111111:0x2222222222222222!8m2!3d0.0!4d0.0"Example output:
CiUSEQkRERERERERESIiIiIiIiIi
python3 extract_place_id.py "https://maps.app.goo.gl/exampleShortLink"This also supports mobile-copied share links that include query params, for example:
python3 extract_place_id.py "https://maps.app.goo.gl/XjFRDJye9o3U95KG8?g_st=ic"Example output:
ChIJXXXXXXXXXXXXXXXXXXXXXX
| Code | Meaning |
|---|---|
0 |
Success |
1 |
Invalid input or unsupported URL pattern |
2 |
Network or shortlink resolution error |
- Validates that the input is an
http/httpsURL. - Resolves
maps.app.goo.gllinks to their final Google Maps URL. - Extracts the
0x...:0x...place hex pair from either!1s0x...:0x...orftid=0x...:0x.... - Converts it into the final Place ID string.
- This tool extracts and converts identifiers already present in the URL.
- It does not call a paid Google API.
- Example URLs and outputs in this README are placeholders.