Property talk:P3749

From Wikidata
Jump to navigation Jump to search

Documentation

Google Maps Customer ID
in Google Maps, Customer identifier for a place
Associated itemGoogle (Q95)
Applicable "stated in" valueGoogle Maps (Q12013)
Data typeExternal identifier
DomainPlaces, Buildings, Organizations (note: this should be moved to the property statements)
Allowed values\d{14,20}
ExampleEmpire State Building (Q9188)15074921902713971043
Grand Canyon National Park (Q220289)2249734650762174505
Sourcehttps://maps.google.com/
https://app.gatherup.com/tools/google-url-finder/?pid=
https://pleper.com/index.php?do=tools&sdo=cid_converter
https://developers.google.com/maps/documentation/places/web-service/place-id#id-overview
https://ryanbradley.com/tools/google-cid-finder/
https://cidfinder.com/
Formatter URLhttps://www.google.com/maps?cid=$1
Tracking: usageCategory:Pages using Wikidata property P3749 (Q28925162)
See alsoWikimapia ID (P7678), Google Knowledge Graph ID (P2671), OpenStreetMap way ID (P10689)
Lists
Proposal discussionProposal discussion
Current uses
Total89,138
Main statement57,81764.9% of uses
Qualifier76<0.1% of uses
Reference31,24535.1% of uses
Search for values
[create Create a translatable help page (preferably in English) for this property to be included here]
Distinct values: this property likely contains a value that is different from all other items. (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P3749#Unique value, SPARQL (every item), SPARQL (by value)
Single value: this property generally contains a single value. (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303). Known exceptions: Washington Suburban Sanitary Commission (Q7972332), San Jose–Sunnyvale–Santa Clara metropolitan area (Q5797419)
List of violations of this constraint: Database reports/Constraint violations/P3749#Single value, SPARQL
Format “\d{14,20}: value must be formatted using this pattern (PCRE syntax). (Help)
List of violations of this constraint: Database reports/Constraint violations/P3749#Format, hourly updated report, SPARQL
Allowed entity types are Wikibase item (Q29934200): the property may only be used on a certain entity type (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P3749#Entity types
Conflicts with “instance of (P31): human (Q5): this property must not be used with the listed properties and values. (Help)
List of violations of this constraint: Database reports/Constraint violations/P3749#Conflicts with P31, hourly updated report, search, SPARQL
Scope is as main value (Q54828448), as reference (Q54828450), as qualifier (Q54828449): the property must be used by specified way only (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P3749#Scope, SPARQL
Qualifiers “subject named as (P1810), applies to part (P518), mapping relation type (P4390): this property should be used only with the listed qualifiers. (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
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?[edit]

I don't find where this ID is. Can someone explains on this talk page?

Tubezlob (🙋) 14:18, 12 March 2017 (UTC)[reply]

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)[reply]
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)[reply]
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)[reply]
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)[reply]
http://ryanbradley.com/tools/google-cid-finder has proved to be a pretty awesome tool.--Labattblueboy (talk) 01:40, 25 December 2018 (UTC)[reply]

So what even is the point of having it? Nemo 12:29, 22 August 2019 (UTC)[reply]

https://www.sterlingsky.ca/how-to-find-the-cid-number-on-google-maps/. --Luan (talk) 19:22, 29 November 2020 (UTC)[reply]

maybe this could be integrated into Wikidata:Tools/Wikidata for Firefox @Shisma: --Loominade (talk) 08:13, 18 June 2021 (UTC)[reply]
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)[reply]

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)[reply]
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)[reply]

Correctness of URL[edit]

I 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)[reply]

Bookmarklet[edit]

Get 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])

--jleedev (talk) 21:15, 6 May 2021 (UTC)[reply]

A tool that seems helping to find Google Maps CID[edit]

Hi ! 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)[reply]

What is the relation between CID and "place ID"?[edit]

I 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)[reply]

Chrome extension to extract cid[edit]

Place 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)[reply]

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)[reply]

Using API to extract cid[edit]

If 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)[reply]
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)[reply]
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)[reply]

Place ID[edit]

See 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)[reply]