장소 ID를 사용하는 일반적인 방법은 (예를 들어 Maps JavaScript API의 Places API 또는 장소 라이브러리를 사용하여) 장소를 검색한 다음 반환된 장소 ID를 사용하여 장소 세부정보를 가져오는 것입니다. 장소 ID를 저장했다가 나중에 이를 사용하여 동일한 장소 세부정보를 가져올 수도 있습니다. 아래에서 장소 ID 저장에 관해 알아보세요.
iOS용 Places SDK를 사용하는 예
장소 ID는 장소를 고유하게 나타내는 텍스트 식별자입니다. iOS용 Places SDK에서는 GMSPlace 객체에서 장소의 ID를 검색할 수 있습니다. 장소 ID를 저장했다가 나중에 이를 사용하여 GMSPlace 객체를 다시 가져올 수도 있습니다.
자동 완성 쿼리를 종료하기 위해 호출이 이루어진 경우 세션 토큰
그렇지 않으면 nil을 전달합니다.
결과를 처리하는 GMSPlaceResultCallback
API는 지정된 콜백 메서드를 호출하여 GMSPlace 객체를 전달합니다. 장소를 찾을 수 없는 경우 장소 객체는 nil입니다.
iOS용 Places Swift SDK
// Initialize Places Swift Client.letplacesClient=PlacesClient.shared// A hotel in Saigon with an attributionletplaceID="ChIJV4k8_9UodTERU5KXbkYpSYs"// Fetch Place Request.letfetchPlaceRequest=FetchPlaceRequest(placeID:placeID,placeProperties:[.displayName])Task{switchawaitplacesClient.fetchPlace(with:fetchPlaceRequest){case.success(letplace):print("The selected place is: \(place.displayName): \(String(describing:place.description))")case.failure(letplacesError):print("Place not found: \(placeID); \(placesError)")}}
Swift
// A hotel in Saigon with an attribution.letplaceID="ChIJV4k8_9UodTERU5KXbkYpSYs"// Specify the place data types to return.letfields:GMSPlaceField=GMSPlaceField(rawValue:UInt(GMSPlaceField.name.rawValue)|UInt(GMSPlaceField.placeID.rawValue))!placesClient?.fetchPlace(fromPlaceID:placeID,placeFields:fields,sessionToken:nil,callback:{(place:GMSPlace?,error:Error?)inifleterror=error{print("An error occurred: \(error.localizedDescription)")return}ifletplace=place{self.lblName?.text=place.nameprint("The selected place is: \(place.name)")}})
Objective-C
// A hotel in Saigon with an attribution.NSString*placeID=@"ChIJV4k8_9UodTERU5KXbkYpSYs";// Specify the place data types to return.GMSPlaceFieldfields=(GMSPlaceFieldName|GMSPlaceFieldPlaceID);[_placesClientfetchPlaceFromPlaceID:placeIDplaceFields:fieldssessionToken:nilcallback:^(GMSPlace*_Nullableplace,NSError*_Nullableerror){if(error!=nil){NSLog(@"An error occurred %@",[errorlocalizedDescription]);return;}if(place!=nil){NSLog(@"The selected place is: %@",[placename]);}}];
나중에 사용하기 위해 장소 ID 저장
장소 ID에는 Google Maps Platform 서비스 약관의 3.2.3(b)항에 명시된 캐싱 제한사항이 적용되지 않습니다. 따라서 나중에 사용하기 위해 장소 ID 값을 저장할 수 있습니다.
저장된 장소 ID 새로고침
Google 지도 데이터베이스의 업데이트로 인해 장소 ID가 변경될 수 있으므로 12개월 이상 지난 장소 ID는 갱신하는 것이 좋습니다. fields 매개변수에서 GMSPlaceFieldPlaceID 필드만 지정하고 장소 세부정보를 요청하여 무료로 장소 ID를 새로고침할 수 있습니다.
INVALID_REQUEST 상태 코드는 지정된 장소 ID가 유효하지 않음을 나타냅니다. 장소 ID가 잘렸거나 다른 방식으로 수정되어 더 이상 올바르지 않은 경우 INVALID_REQUEST가 반환될 수도 있습니다.
NOT_FOUND
NOT_FOUND 상태 코드는 지정된 장소 ID가 더 이상 사용되지 않음을 나타냅니다. 비즈니스가 폐업하거나 새로운 위치로 이전하면 장소 ID가 더 이상 사용되지 않을 수도 있습니다. Google 지도 데이터베이스의 업데이트로 인해 장소 ID가 변경될 수도 있습니다. 이 경우 장소에 새 장소 ID가 부여될 수도 있으며 이전 ID는 NOT_FOUND 응답을 반환합니다.
오래된 장소 ID의 경우 결과를 새로고침하려면 각 장소 ID를 반환한 원래 요청을 저장하고 필요에 따라 요청을 다시 실행하세요. 다시 발급된 요청은 적절한 SKU로 청구됩니다.
일부 유형의 장소 ID는 경우에 따라 NOT_FOUND 응답을 유발하거나 API가 응답에 다른 장소 ID를 반환할 수도 있습니다. 여기에는 다음과 같은 장소 ID 유형이 포함됩니다.
Google 지도에 정확한 주소로 존재하지 않지만 주소 범위에서 추론되는 상세 주소
요청에서 도시 또는 지역을 지정하는 긴 경로의 구간
교차로
subpremise 유형의 주소 구성요소가 포함된 장소
이러한 ID는 주로 긴 문자열의 형태를 취합니다(장소 ID에는 길이 제한이 없음). 예를 들면 다음과 같습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003ePlace IDs are unique text identifiers for places in the Google Places database and are used across multiple Google Maps Platform APIs.\u003c/p\u003e\n"],["\u003cp\u003eYou can find a place's ID using the provided Place ID finder tool or by searching for a place using the Places API or Places library.\u003c/p\u003e\n"],["\u003cp\u003ePlace IDs can be stored and reused, but it's recommended to refresh them if they are older than 12 months.\u003c/p\u003e\n"],["\u003cp\u003eCertain types of place IDs, such as those for inferred addresses or long route segments, might return errors or change over time.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eINVALID_REQUEST\u003c/code\u003e or \u003ccode\u003eNOT_FOUND\u003c/code\u003e error codes indicate an invalid or obsolete place ID, respectively.\u003c/p\u003e\n"]]],["Place IDs are unique textual identifiers for locations in Google's database, usable across various Maps APIs. They're employed to retrieve addresses, specify waypoints in routes, get place details, and more. A place can have multiple IDs, which may change over time. You can find IDs using the place ID finder. Place IDs can be saved and used later, with a recommendation to refresh those older than 12 months using a Place Details request. Errors can occur when the Place ID has been modified or the place is no longer valid.\n"],null,["# Place IDs\n\nSelect platform: [Android](/maps/documentation/places/android-sdk/place-id \"View this page for the Android platform docs.\") [iOS](/maps/documentation/places/ios-sdk/place-id \"View this page for the iOS platform docs.\") [JavaScript](/maps/documentation/javascript/place-id \"View this page for the JavaScript platform docs.\") [Web Service](/maps/documentation/places/web-service/place-id \"View this page for the Web Service platform docs.\") \n**European Economic Area (EEA) developers** If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](/maps/comms/eea/faq).\n\nIntroduction\n------------\n\nPlace IDs uniquely identify a place in the Google Places database and on Google Maps. Place IDs\nare accepted in requests to the following Maps APIs:\n\n- Retrieving an address for a Place ID in the Geocoding API and Geocoding Service, Maps JavaScript API.\n- Specifying origin, destination and intermediate waypoints in the Routes API and Directions API (Legacy) and Directions Service, Maps JavaScript API (Legacy).\n- Specifying origins and destinations in the Routes API and Distance Matrix API (Legacy) and Distance Matrix Service, Maps JavaScript API (Legacy).\n- Retrieving Place Details in Places API (New), Places SDK for Android (New), Places SDK for iOS (New), and Places Library.\n- Using Place ID parameters in Maps Embed API.\n- Retrieving search queries in Maps URLs.\n- Displaying speed limits in Roads API.\n- Finding and styling boundary polygons in data-driven styling for boundaries.\n\nFind the ID of a particular place\n---------------------------------\n\nAre you looking for the place ID of a specific place? Use the place ID\nfinder below to search for a place and get its ID:\n\nAlternatively, you can\n[view\nthe place ID finder](/maps/documentation/javascript/examples/places-placeid-finder) with its code in the Maps JavaScript API\ndocumentation.\n\nOverview\n--------\n\nA place ID is a textual identifier that uniquely identifies a place. The\nlength of the identifier may vary (there is no maximum length for place IDs).\nExamples:\n\n- `\n ChIJgUbEo8cfqokR5lP9_Wh_DaM\n `\n- `\n GhIJQWDl0CIeQUARxks3icF8U8A\n `\n- `\n EicxMyBNYXJrZXQgU3QsIFdpbG1pbmd0b24sIE5DIDI4NDAxLCBVU0EiGhIYChQKEgnRTo6ixx-qiRHo_bbmkCm7ZRAN\n `\n- `\n EicxMyBNYXJrZXQgU3QsIFdpbG1pbmd0b24sIE5DIDI4NDAxLCBVU0E\n `\n- `\n IhoSGAoUChIJ0U6OoscfqokR6P225pApu2UQDQ\n `\n\nPlace IDs are available for most locations, including businesses, landmarks,\nparks, and intersections. It is possible for the same place or location to\nhave multiple different place IDs. Place IDs may change over time.\n\nYou can use the same place ID across the Places API and a\nnumber of Google Maps Platform APIs. For example, you can use the same place ID to\nreference a place in the\n[Places API](/maps/documentation/places), the\n[Maps JavaScript API](/maps/documentation/javascript/places),\nthe [Geocoding API](/maps/documentation/geocoding),\nthe [Maps Embed API](/maps/documentation/embed)\nand the [Roads API](/maps/documentation/roads/speed-limits).\n\nRetrieve place details using the place ID\n-----------------------------------------\n\nA common way of using place IDs is to search for a place\n(using the [Places API](/maps/documentation/places/web-service)\nor the [Places\nlibrary](/maps/documentation/javascript/places#place_searches) in the Maps JavaScript API, for example) then use the\nreturned place ID to retrieve place details. You can store the place ID and\nuse it to retrieve the same place details later. Read about\n[saving place IDs](#save-id) below.\n\n### Example using the Places SDK for iOS\n\nA place ID is a textual identifier that uniquely identifies a place. In\nthe Places SDK for iOS, you can retrieve the ID of a place from a\n[`GMSPlace`](/maps/documentation/places/ios-sdk/reference/objc/Classes/GMSPlace)\nobject. You can store the place ID and use it to retrieve the\n[`GMSPlace`](/maps/documentation/places/ios-sdk/reference/objc/Classes/GMSPlace)\nobject again later.\n\nTo get a place by ID, call\n[`GMSPlacesClient\nfetchPlaceFromPlaceID:`](/maps/documentation/places/ios-sdk/reference/objc/Classes/GMSPlacesClient#-fetchplacefromplaceid:placefields:sessiontoken:callback:), passing the following parameters:\n\n- A string containing a Place ID.\n- One or more `GMSPlaceField`s, specifying the data types to return.\n- A session token if the call is made to conclude an autocomplete query. Otherwise, pass nil.\n- A `GMSPlaceResultCallback` to handle the result.\n\nThe API invokes the specified callback method, passing in a\n[`GMSPlace`](/maps/documentation/places/ios-sdk/reference/objc/Classes/GMSPlace)\nobject. If the place is not found, the place object is nil. \n\n### Places Swift SDK for iOS\n\n```swift\n// Initialize Places Swift Client.\nlet placesClient = PlacesClient.shared\n\n// A hotel in Saigon with an attribution\nlet placeID = \"ChIJV4k8_9UodTERU5KXbkYpSYs\"\n \n// Fetch Place Request.\nlet fetchPlaceRequest = FetchPlaceRequest(\n placeID: placeID,\n placeProperties: [.displayName]\n)\n \nTask {\n switch await placesClient.fetchPlace(with: fetchPlaceRequest) {\n case .success(let place):\n print(\"The selected place is: \\(place.displayName): \\(String(describing: place.description))\")\n case .failure(let placesError):\n print(\"Place not found: \\(placeID); \\(placesError)\")\n }\n}\n```\n\n### Swift\n\n```swift\n// A hotel in Saigon with an attribution.\nlet placeID = \"ChIJV4k8_9UodTERU5KXbkYpSYs\"\n\n// Specify the place data types to return.\nlet fields: GMSPlaceField = GMSPlaceField(rawValue: UInt(GMSPlaceField.name.rawValue) |\n UInt(GMSPlaceField.placeID.rawValue))!\n\nplacesClient?.fetchPlace(fromPlaceID: placeID, placeFields: fields, sessionToken: nil, callback: {\n (place: GMSPlace?, error: Error?) in\n if let error = error {\n print(\"An error occurred: \\(error.localizedDescription)\")\n return\n }\n if let place = place {\n self.lblName?.text = place.name\n print(\"The selected place is: \\(place.name)\")\n }\n})\n```\n\n### Objective-C\n\n```objective-c\n// A hotel in Saigon with an attribution.\nNSString *placeID = @\"ChIJV4k8_9UodTERU5KXbkYpSYs\";\n\n// Specify the place data types to return.\nGMSPlaceField fields = (GMSPlaceFieldName | GMSPlaceFieldPlaceID);\n\n[_placesClient fetchPlaceFromPlaceID:placeID placeFields:fields sessionToken:nil callback:^(GMSPlace * _Nullable place, NSError * _Nullable error) {\n if (error != nil) {\n NSLog(@\"An error occurred %@\", [error localizedDescription]);\n return;\n }\n if (place != nil) {\n NSLog(@\"The selected place is: %@\", [place name]);\n }\n}];\n```\n\nSave place IDs for later use\n----------------------------\n\nPlace IDs are **exempt from** the caching restrictions stated in\n[Section 3.2.3(b)](https://cloud.google.com/maps-platform/terms#3.-license.)\nof the Google Maps Platform Terms of Service. You can therefore store place ID values for later\nuse.\n\n### Refresh stored place IDs\n\nBecause Place IDs may change due to updates on the Google Maps database, Google recommends\nrefreshing place IDs if they are more than 12 months old. You can refresh Place IDs **at no\ncharge** by making a\n\n\n[Place Details request](/maps/documentation/places/ios-sdk/details#PlaceDetailsRequests),\nspecifying only the `GMSPlaceFieldPlaceID`\n\n\nfield in the `fields` parameter.\n\nThis call triggers the\n\n\n[Places Details - ID Refresh](/maps/billing-and-pricing/sku-details#place-details-id-refresh-ess-sku)\n\n\nSKU.\n\nError codes when using place IDs\n--------------------------------\n\n### `INVALID_REQUEST`\n\nThe `INVALID_REQUEST` status code indicates that the specified\nplace ID is not valid. `INVALID_REQUEST` may be returned when the\nplace ID has been truncated or otherwise modified, and is no longer correct.\n\n### `NOT_FOUND`\n\nThe `NOT_FOUND` status code indicates that the specified place ID\nis obsolete. A place ID may become obsolete if a business closes or moves to\na new location. Place IDs may also change due to updates on the Google\nMaps database. In such cases, a place may receive a new place ID, and the old\nID returns a `NOT_FOUND` response.\n| **Note:** Place IDs that are obsolete may continue to be returned in Place Autocomplete (Legacy), Query Autocomplete (Legacy), or Autocomplete (New) responses for a few days after the place ID has been removed from the Google Maps database.\n\nTo refresh results in the event of an obsolete place ID, store the original request that\nreturned each place ID and re-issue the request as needed. Note that the **re-issued request is\nbilled at the appropriate SKU.**\n\nSome types of place IDs may sometimes cause a\n`NOT_FOUND` response, or the API may return a different place ID in\nthe response. These place ID types include:\n\n- Street addresses that don't exist in Google Maps as precise addresses, but are inferred from a range of addresses.\n- Segments of a long route, where the request also specifies a city or locality.\n- Intersections.\n- Places with an address component of type `subpremise`.\n\nThese IDs often take the form of a long string (there is no maximum length\nfor Place IDs). For example: \n\n```\nEpID4LC14LC_4LCo4LCv4LGN4LCo4LCX4LCw4LGNIC0g4LC44LGI4LCm4LGN4LCs4LC-4LCm4LGNIOCwsOCxi-CwoeCxjeCwoeCxgSAmIOCwteCwv-CwqOCwr-CxjSDgsKjgsJfgsLDgsY0g4LCu4LGG4LCv4LC_4LCo4LGNIOCwsOCxi-CwoeCxjeCwoeCxgSwg4LC14LC_4LCo4LCv4LGNIOCwqOCwl-CwsOCxjSDgsJXgsL7gsLLgsKjgsYAsIOCwsuCwleCxjeCwt-CxjeCwruCwv-CwqOCwl-CwsOCxjSDgsJXgsL7gsLLgsKjgsYAsIOCwuOCwsOCxguCwsOCxjSDgsKjgsJfgsLDgsY0g4LC14LGG4LC44LGN4LCf4LGNLCDgsLjgsK_gsYDgsKbgsL7gsKzgsL7gsKbgsY0sIOCwueCxiOCwpuCwsOCwvuCwrOCwvuCwpuCxjSwg4LCk4LGG4LCy4LCC4LCX4LC-4LCjIDUwMDA1OSwg4LCt4LC-4LCw4LCk4LCm4LGH4LC24LCCImYiZAoUChIJ31l5uGWYyzsR9zY2qk9lDiASFAoSCd9ZebhlmMs7Efc2NqpPZQ4gGhQKEglDz61OZpjLOxHgDJCFY-o1qBoUChIJi37TW2-YyzsRr_uv50r7tdEiCg1MwFcKFS_dyy4\n```"]]