Google Maps place ID converter
Paste a Google Maps place ID, the 0x…:0x… id from a Maps link, or a CID. You get the other ids, and a link that opens the place. It runs in your browser: nothing is sent anywhere, and it is free.
The ids are inside each other: nothing is sent anywhere.
How it works
A place on Google Maps has three ids, and two of them hold the same two numbers. The place ID, such as ChIJN1t_tDeuEmsRUsoyG83frY4, is what Google’s Places API takes. A Maps link carries the pair of hex numbers instead, after !1s: 0x6b12ae37b47f5b37:0x8eaddfcd1b32ca52. And the second of those numbers, in decimal, is the place’s CID: maps.google.com/?cid=10281119596374313554 opens it.
A place ID that starts with ChIJ is the two numbers in a small binary record, written in base64: the bytes 0a 12 09, the first number in 8 bytes with the low byte first, the byte 11, and the second number the same way. So each id can be turned into the other with no call to Google. A place ID that does not start with ChIJ is built another way, and a CID holds only the second number.
The same in your own code:
// a ChIJ place ID is two 64-bit numbers, low byte first, after the bytes 0a 12 09, with 11 between them
const hexId = (placeId: string) => {
const b = Buffer.from(placeId, 'base64url');
const n = (from: number) => b.readBigUInt64LE(from);
return `0x${n(3).toString(16)}:0x${n(12).toString(16)}`;
};
const cid = (placeId: string) => Buffer.from(placeId, 'base64url').readBigUInt64LE(12).toString();
hexId('ChIJN1t_tDeuEmsRUsoyG83frY4'); // '0x6b12ae37b47f5b37:0x8eaddfcd1b32ca52'
cid('ChIJN1t_tDeuEmsRUsoyG83frY4'); // '10281119596374313554'The rest of the place
The ids say which place, and nothing about it. GET /v1/google-maps/place gives the whole listing for its place ID: the name, address, location, rating and reviews count, phone numbers, website and opening hours. A call costs 3 credits, $2.34 per 1,000 on the smallest pack, and with no key it answers from the demo. Every endpoint for Google Maps is on the ScrapeField Google Maps API page.
Questions
What is the place_id:0x…:0x… that people search for?
The pair of hex numbers from a Google Maps link, written after place_id:. It is not a place ID that Google’s Places API takes, but it holds the same two numbers as one that starts with ChIJ, and this tool turns it into that place ID.
What is a CID?
The second of the two numbers, in decimal. https://maps.google.com/?cid= and the number open the place. On its own it cannot give the place ID, as the first number is missing.
Does it work for every place ID?
For each one that starts with ChIJ, which is the kind a search on Google Maps gives for a business. A place ID with another start, such as GhIJ or EiQ, is built another way, and the tool says so.
Is anything sent anywhere?
No. The ids are worked out in your browser, and the page sends nothing of what you paste.