Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Google Place ID Finder

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.

Why This Tool Exists

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.

Highlights

  • 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.gl short links automatically
  • No third-party dependencies
  • Helpful exit codes for scripting/automation

Quick Start

# 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>"

Requirements

  • Python 3.9 or newer

Usage

Interactive mode

python3 extract_place_id.py

One-liner mode

python3 extract_place_id.py "<google maps url>"

Help

python3 extract_place_id.py --help

Examples

Full Maps URL

python3 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

Short link

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

Exit Codes

Code Meaning
0 Success
1 Invalid input or unsupported URL pattern
2 Network or shortlink resolution error

How It Works

  1. Validates that the input is an http/https URL.
  2. Resolves maps.app.goo.gl links to their final Google Maps URL.
  3. Extracts the 0x...:0x... place hex pair from either !1s0x...:0x... or ftid=0x...:0x....
  4. Converts it into the final Place ID string.

Notes

  • 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.

About

A lightweight Python CLI that extracts a Google Place ID from a Google Maps URL.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages