Place by ID parameters with the place identifier
OptionalcustomTemplate: Partial<PlaceByIdTemplate>Advanced customization for request/response handling
Promise resolving to detailed place information
Use cases:
The ID can be obtained from:
// Get place by ID from search result
const searchResult = await search({ query: 'Eiffel Tower' });
const placeId = searchResult.features[0].id;
const placeDetails = await placeById({
key: 'your-api-key',
entityId: placeId
});
// Get extended POI details
const place = searchResult.features[0];
const poiDetailsId = place.properties.dataSources?.poiDetails?.id;
if (poiDetailsId) {
const detailedPOI = await placeById({
key: 'your-api-key',
entityId: poiDetailsId
});
// May include additional photos, reviews, extended hours, etc.
}
// Navigate to related POI
const relatedPOI = place.properties.relatedPois?.[0];
if (relatedPOI) {
const parentPlace = await placeById({
key: 'your-api-key',
entityId: relatedPOI.id
});
console.log('Parent location:', parentPlace.properties.address);
}
Retrieve detailed information about a place using its unique identifier.
The Place by ID service fetches comprehensive data for a specific place when you have its ID from a previous search or from a place's dataSources. This is useful for getting additional details or refreshing information about a known location.