Property talk:P3749
Documentation
in Google Maps, Customer identifier for a place
List of violations of this constraint: Database reports/Constraint violations/P3749#Unique value, SPARQL (every item), SPARQL (by value)
List of violations of this constraint: Database reports/Constraint violations/P3749#Single value, SPARQL
List of violations of this constraint: Database reports/Constraint violations/P3749#Entity types
List of violations of this constraint: Database reports/Constraint violations/P3749#Scope, SPARQL
List of violations of this constraint: Database reports/Constraint violations/P3749#allowed qualifiers, SPARQL
Pattern ^(?:(?:https?)?:\/\/)?(?:maps\.google\.[a-z]{2,3}\/?|(?:www\.)?google\.[a-z]{2,3}\/maps)\?cid=(\d{14,20})$ will be automatically replaced to \1. Testing: TODO list |
Where can we find this ID?
editI don't find where this ID is. Can someone explains on this talk page?
Tubezlob (🙋) 14:18, 12 March 2017 (UTC)
- Sadly Google maps does show it anywhere when selecting a site in their web UI, the only way I know to find the CID is using the website https://cidfinder.view3.com/ and then entering the name of the place. Ahoerstemeier (talk) 16:37, 9 May 2017 (UTC)
- An alternative is http://ryanbradley.com/tools/google-cid-finder Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 12:43, 21 September 2017 (UTC)
- There's a way without any external tools: click on a feature in Google Maps, click on "share" then "embed" and lastly copy the url of the link marked "View larger map". You can find the CID in the last part of that url after "&cid=". --MB-one (talk) 20:49, 4 February 2018 (UTC)
- This seems to be the only method that still works. Maybe we culd make our own tool or something else for this purpose.--Pharos (talk) 19:21, 27 April 2021 (UTC)
- There's a way without any external tools: click on a feature in Google Maps, click on "share" then "embed" and lastly copy the url of the link marked "View larger map". You can find the CID in the last part of that url after "&cid=". --MB-one (talk) 20:49, 4 February 2018 (UTC)
- http://ryanbradley.com/tools/google-cid-finder has proved to be a pretty awesome tool.--Labattblueboy (talk) 01:40, 25 December 2018 (UTC)
So what even is the point of having it? Nemo 12:29, 22 August 2019 (UTC)
https://www.sterlingsky.ca/how-to-find-the-cid-number-on-google-maps/. --Luan (talk) 19:22, 29 November 2020 (UTC)
- maybe this could be integrated into Wikidata:Tools/Wikidata for Firefox @Shisma: --Loominade (talk) 08:13, 18 June 2021 (UTC)
- it is also in resolved google maps urls:
https://www.google.com/maps?cid=15074921902713971043
resolves to
https://www.google.com/maps/place/Empire+State+Building/@40.7484405,-73.9878531,17z/data=!3m1!4b1!4m5!3m4!1s0x0:0xd134e199a405a163;!8m2!3d40.7484405!4d-73.9856644
0xd134e199a405a163
equals 15074921902713971043
in the hexadecimal (Q82828) system. maybe this id should be stored as hexadecimal instead? --Loominade (talk) 08:17, 18 June 2021 (UTC)
- Luan this ID can now be extracted with WDFF [[File:Google_Maps_Consumer_ID_in_Wikidata_for_Firefox.png|800px]]--Loominade (talk) 06:11, 15 July 2021 (UTC)
- i've found this tool:
- https://pleper.com/index.php?do=tools&sdo=cid_converter
- it works. ~ GiovanniPen (talk) 19:04, 10 April 2024 (UTC)
Correctness of URL
editI opened the links in the example and I got redirect to the main maps.google.com. Is it correct? --★ → Airon 90 16:07, 13 May 2020 (UTC)
Bookmarklet
editGet cid on google maps page:
javascript:alert(BigInt(APP_INITIALIZATION_STATE[2][0][0][7][1][0].split(':')[1]))
Get kgmid on google maps page:
javascript:alert(JSON.parse(APP_INITIALIZATION_STATE[3][6].replace(")]}'",""))[6][89])
A tool that seems helping to find Google Maps CID
editHi ! If you put the Google Maps link in this tool you can get the Google Maps CID : https://pleper.com/index.php?do=tools&sdo=cid_converter. Wyslijp16 (talk) 17:28, 29 April 2023 (UTC)
What is the relation between CID and "place ID"?
editI know they are different. The CIDs are numbers only (e.g. 15074921902713971043), and the place IDs are textual (e.g. ChIJaXQRs6lZwokRY6EFpJnhNNE).
In "source website for the property" of this property, there is a value of the place ID documentation, but contains no mention of CID.
Is CID replaced by "place ID"? Onthewings (talk) 11:03, 28 August 2023 (UTC)
Chrome extension to extract cid
editPlace ID Finder for Google Maps (https://chrome.google.com/webstore/detail/place-id-finder-for-googl/gdnnaahojechcmemagbbbbnoiieolafp) is a Chrome extension that adds a magnifying glass icon bottom right to search results in Google Maps. Clicking on it launches a web page with the cid and placeid.
The same company provide a Google Maps scraper (not in an app store, you need to enter developer mode to install it) which allows 1000 requests a month of basic information which includes cid. Premium results cost. I've not tried it. https://gmapsextractor.com
Another option is Local Scraper which provides a Google Maps Scraper which will gather the CID's. It is a desktop software so a good alternative to the chrome extensions and has no API limits or credit systems. You just run it on your desktop so its unlimited data. https://www.localscraper.com/google-maps-scraper.php
Vicarage (talk) 09:18, 17 September 2023 (UTC)
- This tool simply extracts data from the web browser... It's too simple and obvious... There are programs that use undocumented Google Maps APIs (e.g. for Android). Here is one such program https://letsextract.com/google-maps-email-extractor.htm Avega251 (talk) 08:58, 15 April 2024 (UTC)
Using API to extract cid
editIf you have a Google Maps API developer key
curl -L -X GET 'https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input=Dover%20Castle&inputtype=textquery&fields=place_id&key=API_KEY'
returns json with
"place_id" : "ChIJv1aGJNak3kcRLIqDsOlwctM"
curl -L -X GET 'https://maps.googleapis.com/maps/api/place/details/json?fields=name%2Curl&place_id=ChIJv1aGJNak3kcRLIqDsOlwctM&key=API_KEY'
returns json with
"url" : "https://maps.google.com/?cid=15236364638338910764" Vicarage (talk) 20:30, 17 September 2023 (UTC)
- google_maps_cid.bsh with
- API_KEY=something
- Q=$1
- shift 1
- PLACE=$*
- PLACE1=${PLACE// /%20}
- PLACEID=$(curl -s -L -X GET 'https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input='$PLACE1'&inputtype=textquery&fields=place_id&key='$API_KEY | jq -j .candidates[0].place_id)
- curl -s -L -X GET 'https://maps.googleapis.com/maps/api/place/details/json?fields=name%2Curl%2Cformatted_address&place_id='$PLACEID'&key='$API_KEY > result.json
- NAME=$(jq -j '.result.name' result.json)
- ADDRESS=$(jq -j '.result.formatted_address' result.json)
- URL=$(jq -j '.result.url' result.json)
- CID=$(echo $URL | sed -Ee 's`https://maps.google.com/\?cid=([0-9]*)`\1`')
- echo $Q'|P3749|"'$CID'" /*' $PLACE $NAME $ADDRESS $URL '*/'
- rm result.json
- then
- cat query.csv | sed -Ee 's`http://www.wikidata.org/entity/(Q[0-9]*),(.*)`./google_maps_cid.bsh \1 \2`' | grep google_maps > script
- . ./script
- Vicarage (talk) 17:11, 18 September 2023 (UTC)
- If you have Q, name coords in a csv file, this crude logic makes sure you have matching coords
- sed -Ee 's`http://www.wikidata.org/entity/(Q[0-9]*),(.*),Point\(([^ ]*) (.*)\)`./google_maps_cid.bsh \1 \
- 4 \3 \2`' query.csv | grep google_maps > script
- . ./script > 1
- #!/bin/bash
- # google_maps_cid.bsh
<place>
- # Uses https://developers.google.com/maps/documentation/places/web-service
- API_KEY=blah
- Q=$1
- LAT1=$2
- LONG1=$3
- shift 3
- PLACE=$*
- PLACE1=${PLACE// /%20}
- PLACEID=$(curl -s -L -X GET 'https://maps.googleapis.com/maps/api/place/findplacefromtext/jsoninput='$PLACE1'&inputtype=textquery&fields=place_id&key='$API_KEY | jq -j .candidates[0].place_id)
- curl -s -L -X GET 'https://maps.googleapis.com/maps/api/place/details/json?fields=name%2Cgeometry%2Curl%2Cformatted_address&place_id='$PLACEID'&key='
- $API_KEY > result.json
- NAME=$(jq -j '.result.name' result.json)
- ADDRESS=$(jq -j '.result.formatted_address' result.json)
- LAT2=$(jq -j '.result.geometry.location.lat' result.json)
- LONG2=$(jq -j '.result.geometry.location.lng' result.json)
- CLOSE=`echo 'sqrt(('$LAT1'-('$LAT2'))^2+('$LONG1'-('$LONG2'))^2) < 0.1' | bc -l`
- if test $CLOSE == 1; then
- URL=$(jq -j '.result.url' result.json)
- CID=$(echo $URL | sed -Ee 's`https://maps.google.com/\?cid=([0-9]*)`\1`')
- echo $Q'|P3749|"'$CID'" /*' $PLACE $NAME $LAT $LONG'*/' | grep -v '?q'
- else
- echo $PLACE $LAT1 $LONG1 too far from $NAME $LAT2 $LONG2
- fi
- rm result.json Vicarage (talk) 14:23, 19 September 2023 (UTC)
Place ID
editSee Wikidata:Project_chat#Google_Maps_Place_ID where I ask whether Place id should be added too. Vicarage (talk) 20:39, 17 September 2023 (UTC)