### Goong Autocomplete API V2 Request Example Source: https://help.goong.io/kb/rest-api-v2/autocomplete-rest-api-v2/autocomplete-v2 This example demonstrates how to construct a GET request to the Goong Autocomplete API V2. It includes essential parameters such as the search input, preferred location, API key, and options for administrative unit data. ```HTTP https://rsapi.goong.io/v2/place/autocomplete?input=298 ngoc lam long bien &location=21.0278,105.8342&api_key={YOUR_API_KEY}&has_deprecated_administrative_unit=true ``` -------------------------------- ### Perform Reverse Geocode Request Source: https://help.goong.io/kb/rest-api-v2/geocode-rest-api-v2/geocode-v2 An example of a GET request to the Goong Reverse Geocoding API. It requires a 'latlng' parameter and an 'api_key' for authentication. ```http GET https://rsapi.goong.io/v2/geocode?latlng=15.765075, 108.204474&limit=5&api_key={YOUR_API_KEY}&has_deprecated_administrative_unit=true ``` -------------------------------- ### GET /place/detail (V2) Source: https://help.goong.io/kb/rest-api-v2/geocode-rest-api-v2/geocode-v2 Retrieves detailed information about a specific location, including administrative boundaries and location codes. ```APIDOC ## GET /place/detail ### Description Returns comprehensive details for a location, including administrative hierarchy (province, district, commune), Plus Codes, and legacy compatibility fields. ### Method GET ### Endpoint /place/detail ### Response #### Success Response (200) - **reference** (string) - Reference ID of the place. - **compound_code** (string) - Local Plus Code. - **global_code** (string) - Global Plus Code. - **province** (string) - Name of the province/city. - **district** (string) - Name of the district. - **commune** (string) - Name of the commune/ward. - **types** (array) - List of place categories. - **name** (string) - Name of the location. - **address** (string) - Administrative address string. - **status** (string) - API response status (e.g., "OK"). - **deprecated_description** (string) - Legacy address description. - **deprecated_compound** (object) - Legacy administrative hierarchy object. - **deprecated_compound_id** (object) - Legacy administrative ID mapping. ### Response Example { "status": "OK", "name": "Duy Xuyên", "province": "Đà Nẵng", "district": "Duy Xuyên", "commune": "Duy Sơn", "global_code": "MXUP+BMKDMI", "reference": "drtqhLmKubt1uUEJoVZFi3Wrd5ijaE10ar" } ``` -------------------------------- ### Geocode Street API Request Example Source: https://help.goong.io/kb/rest-api-v2/geocode-rest-api-v2/geocode-street This example demonstrates how to construct a GET request to the Goong Maps API V2 Geocode Street endpoint. It includes the base URL, API key, latitude and longitude coordinates, and an optional parameter to include deprecated administrative units. ```HTTP https://rsapi.goong.io/v2/geocode/street?api_key={YOUR_API_KEY}&latlng=21.030145,105.811122&has_deprecated_administrative_unit=true ``` -------------------------------- ### Goong API V2: Example JSON Response for Child IDs Source: https://help.goong.io/kb/rest-api-v2/autocomplete-rest-api-v2/child-id-v2 This is an example of the JSON response received when requesting child IDs from the Goong API V2. It includes a list of predictions, each containing details about a place such as its description, place_id, structured formatting, and administrative information. ```JSON { "predictions": [ { "description": "Cổng đón/trả khách, Trường THPT Nguyễn Bỉnh Khiêm, 78 Hoàng Hoa Thám, Tam Long, Hồ Chí Minh", "matched_substrings": null, "place_id": "oXe3tlO8AXFyj1sxpFqs6HPSalW6d53fcr9xFHNbls6l0V8vQXmk33e1nlSnZI55aNKTJ79bitZ0tlugFmbtz38vZdG8AJbfcqVAVJZmQlv9zjFMAoACGlnGkWyuWAe3W", "reference": "oXe3tlO8AXFyj1sxpFqs6HPSalW6d53fcr9xFHNbls6l0V8vQXmk33e1nlSnZI55aNKTJ79bitZ0tlugFmbtz38vZdG8AJbfcqVAVJZmQlv9zjFMAoACGlnGkWyuWAe3W", "structured_formatting": { "main_text": "Cổng đón/trả khách", "main_text_matched_substrings": null, "secondary_text": "Trường THPT Nguyễn Bỉnh Khiêm, 78 Hoàng Hoa Thám, Tam Long, Hồ Chí Minh", "secondary_text_matched_substrings": null }, "has_children": false, "plus_code": { "compound_code": "+JKB1 Long Tâm, Bà Rịa, Bà Rịa-Vũng Tàu", "global_code": "49ON8+JKB1" }, "compound": { "commune": "Tam Long", "province": "Hồ Chí Minh" }, "terms": [ { "offset": 0, "value": "Cổng đón/trả khách" }, { "offset": 26, "value": "Trường THPT Nguyễn Bỉnh Khiêm" }, { "offset": 65, "value": "78 Hoàng Hoa Thám" }, { "offset": 86, "value": "Tam Long" }, { "offset": 96, "value": "Hồ Chí Minh" } ], "types": [ "site" ], "distance_meters": null } ], "execution_time": "143.612µs", "status": "OK" } ``` -------------------------------- ### GET /Place Autocomplete Source: https://help.goong.io/kb/rest-api-v2/autocomplete-rest-api-v2/autocomplete-v2 Retrieves a list of location predictions based on user input, including detailed formatting, administrative boundaries, and relevance scores. ```APIDOC ## GET /place/autocomplete ### Description Retrieves location suggestions based on a search query. Supports filtering by radius and specific location coordinates. ### Method GET ### Endpoint /place/autocomplete ### Parameters #### Query Parameters - **input** (string) - Required - The text string on which to search. - **location** (string) - Optional - The point around which to retrieve place information (lat,lng). - **radius** (number) - Optional - The distance (in meters) within which to return place results. ### Request Example GET /place/autocomplete?input=Nguyễn+Trãi&location=21.0285,105.8542&radius=5000 ### Response #### Success Response (200) - **predictions** (array) - List of suggested locations. - **status** (string) - API response status (e.g., "OK"). #### Response Example { "predictions": [ { "description": "91 Nguyễn Trãi, Sao Đỏ, Hải Phòng", "place_id": "Hobn8WqBW6r...", "structured_formatting": { "main_text": "91 Nguyễn Trãi", "secondary_text": "Sao Đỏ, Hải Phòng" }, "score": 633.7587 } ], "status": "OK" } ``` -------------------------------- ### Forward Geocode API Request Example Source: https://help.goong.io/kb/rest-api-v2/geocode-rest-api-v2/geocode-v2 This snippet demonstrates how to construct a request URL for the Forward Geocode API. It requires the address to be geocoded and an API key for authentication. The 'has_deprecated_administrative_unit' parameter can be optionally included to retrieve older administrative unit information. ```http https://rsapi.goong.io/v2/geocode?address=91%20Trung%20K%C3%ADnh%2C%20Trung%20H%C3%B2a%2C%20C%E1%BA%A7u%20Gi%E1%BA%A5y%2C%20H%C3%A0%20N%E1%BB%99i&api_key={YOUR_API_KEY} ``` -------------------------------- ### Goong API V2: GET Request for Child IDs Source: https://help.goong.io/kb/rest-api-v2/autocomplete-rest-api-v2/child-id-v2 This snippet demonstrates how to make a GET request to the Goong API V2 to retrieve child IDs for a given parent ID. It requires an API key for authentication and optionally accepts a boolean parameter to include deprecated administrative unit information. ```HTTP https://rsapi.goong.io/v2/place/children?parent_id=mkSTeXlgiYFUzS5Mu1-nwXuWbga8aInzZs8jS7hgq-FopXItor-FwbqqMFx3brv-aqoyT6Nja5MyBqEQIoF54wUWQRwS6bajPeaVfS4ls9uAfqUwfv26ZiR67RDSJbPLJ&api_key={YOUR_API_KEY}&has_deprecated_administrative_unit=false ``` -------------------------------- ### GET /v2/direction Source: https://help.goong.io/kb/rest-api-v2/directions-rest-api-v2/directions-v2 Calculates the most efficient route between specified origin and destination points, with options for vehicle type and alternative routes. ```APIDOC ## GET /v2/direction ### Description Calculates the most efficient route between specified origin and destination points. You can specify the vehicle type and whether to return alternative routes. ### Method GET ### Endpoint https://rsapi.goong.io/v2/direction ### Parameters #### Query Parameters - **origin** (string) - Required - The starting coordinates of the route in latitude,longitude format. - **destination** (string) - Required - The ending coordinates of the route in latitude,longitude format. - **vehicle** (string) - Optional - The type of vehicle for the route. Supported values: `car`, `bike`. - **alternatives** (boolean) - Optional - If `true`, multiple route options will be returned. Defaults to `false`. - **api_key** (string) - Required - Your Goong API key for authentication. ### Request Example ``` https://rsapi.goong.io/v2/direction?origin=21.046623224000029,105.790168203000060&destination=21.046666732000062,105.790169569000060&vehicle=car&alternatives=true&api_key=YOUR_API_KEY ``` ### Response #### Success Response (200) - **geocoded_waypoints** (array) - An array of geocoded waypoint objects. - **routes** (array) - An array of route objects, each containing details like bounds, legs, distance, duration, and steps. #### Response Example ```json { "geocoded_waypoints": [ { "geocoder_status": "OK", "place_id": "l6EBlad4uXJ3jmQUp3iE0WnQdzqka7b3QI91UJBO5N9-0HgSvGOY3EDQWxihWXLTqYR50VKI9dS51tl3Vpk2LMEG3XVOqQZvgn7dndrtVl3P-lwFSjVqHl3ClACqXWuzX" }, { "geocoder_status": "OK", "place_id": "qlBsbSYlYh952FV9qV6U7na_e5S2GsL4gYVE6_qzahNq9vzZfmUF19JCwWTO3bbqfe9tFeaIKjJsykkVLr1Gc432SQQC1UZ-deLwJXpxKnPV5hlkKqgqMnHuuUSGcC-fc" } ], "routes": [ { "bounds": {}, "legs": [ { "distance": { "text": "2.83 km", "value": 2828 }, "duration": { "text": "8 phút", "value": 502 }, "end_address": "Starlake Project Secondary School, Xuân Tảo, Bắc Từ Liêm, Hà Nội", "end_location": { "lat": 21.05671, "lng": 105.79017 }, "start_address": "11 Trần Cung, Nghĩa Đô, Hà Nội", "start_location": { "lat": 21.04663, "lng": 105.79022 }, "steps": [ { "distance": {"text": "41 m", "value": 41}, "duration": {"text": "10 giây", "value": 10}, "end_location": {"lat": 21.04626, "lng": 105.79026}, "html_instructions": "Bắt đầu đi từ Trần Cung", "maneuver": "right", "polyline": {"points": "mtm_C{cudSh@C^C"}, "start_location": {"lat": 21.04663, "lng": 105.79022}, "travel_mode": "DRIVING" } ] } ], "overview_polyline": { "points": "mtm_C{cudSh@C^Ch@C?o@A[?oC?s@?mE?wBAuB@qCAwK?gB?iA?s@k@@aA@W?k@?cE@_C?}@?iE@kAAkF?cA?Q?C??f@?dAE~L@hK@lOGb@KPQHs@?qB@aG@wLAw@??[" }, "summary": "", "warnings": [], "waypoint_order": [] } ] } ``` ``` -------------------------------- ### Requesting Directions via REST API Source: https://help.goong.io/kb/rest-api-v2/directions-rest-api-v2/directions-v2 A GET request to the Goong Directions endpoint. It requires origin and destination coordinates, a vehicle type, and a valid API key. ```HTTP GET https://rsapi.goong.io/v2/direction?origin=21.046623224000029,105.790168203000060&destination=21.046666732000062,105.790169569000060&vehicle=car&api_key={YOUR_API_KEY} ``` -------------------------------- ### Retrieve Place Details via REST API Source: https://help.goong.io/kb/rest-api-v2/place-detail-rest-api-v2/place-detail-place-detail-v2 Demonstrates how to perform a GET request to the Goong Place Detail API V2 to retrieve location information based on a unique place_id. The request includes an API key for authentication and an optional parameter to include legacy administrative unit descriptions. ```HTTP GET https://rsapi.goong.io/v2/place/detail?place_id=ceemb00pVO95sWtNulG-8kaxRbG6WjCYdY94iKIH79BASozdSlnGY8EaIRS-VTZzjQbCmEmdwnJN0iJEJp1qivHrWTT2XY4iOdLBGUl1gkPl1ipAGVQaAkHeiXS2QB-vQ&api_key={YOUR_API_KEY}&has_deprecated_administrative_unit=true ``` -------------------------------- ### Request Distance Matrix via cURL Source: https://help.goong.io/kb/rest-api-v2/distance-matrix-rest-api-v2/distance-matrix-v2 Demonstrates how to perform a GET request to the Distance Matrix API v2. It requires origin and destination coordinates, a vehicle type, and a valid API key. ```shell curl "https://rsapi.goong.io/v2/distancematrix?origins=20.981971,105.864323&destinations=21.031011,105.783206%7C21.022328,105.790480%7C21.016665,105.788774&vehicle=car&api_key={YOUR_API_KEY}" ``` -------------------------------- ### Autocomplete API Source: https://help.goong.io/kb/rest-api-v2/autocomplete-rest-api-v2/autocomplete-v2 The Autocomplete API helps you get location suggestions as a user types. You need an API key to use this service. The endpoint allows specifying search input, preferred location, radius, and other filtering options. ```APIDOC ## GET /v2/place/autocomplete ### Description Provides location suggestions based on an input query. It requires an API key and supports various parameters to refine search results, such as location, radius, and administrative unit details. ### Method GET ### Endpoint https://rsapi.goong.io/v2/place/autocomplete ### Parameters #### Query Parameters - **input** (string) - Required - The search keyword. - **location** (string) - Optional - Preferred search coordinates (latitude,longitude). - **api_key** (string) - Required - Your Goong API key. - **limit** (integer) - Optional - The maximum number of results to return. Defaults to 5. - **radius** (integer) - Optional - Search radius in meters from the specified location. Defaults to 50000. - **more_compound** (boolean) - Optional - If true, returns district, commune, and province fields. Defaults to false. - **has_deprecated_administrative_unit** (boolean) - Optional - If true, includes deprecated administrative unit information (pre-merger names) in the response. Defaults to false. - **origin** (string) - Optional - Coordinates (latitude,longitude) to sort suggestions by proximity. If provided, `distance_meters` will be included in the response. ### Request Example ``` https://rsapi.goong.io/v2/place/autocomplete?input=298%20ngoc%20lam%20long%20bien&location=21.0278,105.8342&api_key={YOUR_API_KEY}&has_deprecated_administrative_unit=true ``` ### Response #### Success Response (200) - **predictions** (array) - An array of prediction objects, each containing details about a suggested location. - **description** (string) - The full description of the predicted location. - **place_id** (string) - A unique identifier for the place. - **structured_formatting** (object) - Formatted address components. - **main_text** (string) - The primary part of the address. - **secondary_text** (string) - The secondary part of the address. - **compound** (object) - Structured compound address information (e.g., commune, province). - **deprecated_compound** (object) - Deprecated compound address information (e.g., old district, commune, province). - **distance_meters** (integer) - The distance in meters from the origin point (if `origin` parameter was used). #### Response Example ```json { "predictions": [ { "description": "298 Ngọc Lâm, Bồ Đề, Hà Nội", "matched_substrings": [ { "length": 3, "offset": 0 }, { "length": 4, "offset": 4 }, { "length": 3, "offset": 9 } ], "place_id": "lqtHcLCBkwdsiW1Vllir7TVywQSWmXb-wSLNMUnRxvY2i1WY0d1qP1HOnai6IYLfTcKA_F7tiitdAskgjl0yd92-LVA24B6vvdbFHmZFhKFN0i1T4p5EHkXajXCyRBurR", "reference": "lqtHcLCBkwdsiW1Vllir7TVywQSWmXb-wSLNMUnRxvY2i1WY0d1qP1HOnai6IYLfTcKA_F7tiitdAskgjl0yd92-LVA24B6vvdbFHmZFhKFN0i1T4p5EHkXajXCyRBurR", "structured_formatting": { "main_text": "298 Ngọc Lâm", "main_text_matched_substrings": [ { "length": 3, "offset": 0 }, { "length": 4, "offset": 4 }, { "length": 3, "offset": 9 } ], "secondary_text": "Bồ Đề, Hà Nội", "secondary_text_matched_substrings": [] }, "has_children": false, "plus_code": { "compound_code": "+69NYS Ngọc Lâm, Long Biên, Hà Nội", "global_code": "LOEJ+69NYS" }, "compound": { "commune": "Bồ Đề", "province": "Hà Nội" }, "terms": [ { "offset": 0, "value": "298 Ngọc Lâm" }, { "offset": 16, "value": "Bồ Đề" }, { "offset": 28, "value": "Hà Nội" } ], "types": [ "house_number" ], "distance_meters": null, "deprecated_description": "298 Ngọc Lâm, Phường Ngọc Lâm, Quận Long Biên, Thành phố Hà Nội", "deprecated_compound": { "district": "Long Biên", "commune": "Ngọc Lâm", "province": "Hà Nội" } } ] } ``` ``` -------------------------------- ### GET /v2/place/detail Source: https://help.goong.io/kb/rest-api-v2/place-detail-rest-api-v2/place-detail-place-detail-v2 Retrieves detailed information for a specific location using its unique place_id, with support for legacy administrative boundary references. ```APIDOC ## GET /v2/place/detail ### Description Retrieves detailed information about a place, including name, address, coordinates, and administrative units. The V2 version reflects updated administrative boundaries following recent government mergers. ### Method GET ### Endpoint https://rsapi.goong.io/v2/place/detail ### Parameters #### Query Parameters - **place_id** (string) - Required - The unique identifier of the location. - **api_key** (string) - Required - Your personal API access key. - **has_deprecated_administrative_unit** (boolean) - Optional - If true, returns additional fields (deprecated_description, deprecated_compound) containing old administrative names. Defaults to false. ### Request Example https://rsapi.goong.io/v2/place/detail?place_id=ceemb00pVO95sWtNulG-8kaxRbG6WjCYdY94iKIH79BASozdSlnGY8EaIRS-VTZzjQbCmEmdwnJN0iJEJp1qivHrWTT2XY4iOdLBGUl1gkPl1ipAGVQaAkHeiXS2QB-vQ&api_key={YOUR_API_KEY}&has_deprecated_administrative_unit=true ### Response #### Success Response (200) - **result** (object) - Contains location details including formatted_address, geometry, and administrative compound. - **status** (string) - The status of the request (e.g., "OK"). #### Response Example { "result": { "place_id": "ceemb00pVO95sWtNulG-8kaxRbG6WjCYdY94iKIH79BASozdSlnGY8EaIRS-VTZzjQbCmEmdwnJN0iJEJp1qivHrWTT2XY4iOdLBGUl1gkPl1ipAGVQaAkHeiXS2QB-vQ", "formatted_address": "2/31 Ngô Gia Khảm, Bồ Đề, Hà Nội", "geometry": { "location": { "lat": 21.048178407000023, "lng": 105.87687658000004 } }, "name": "2/31 Ngô Gia Khảm", "status": "OK" } } ``` -------------------------------- ### Distance Matrix API Response Structure Source: https://help.goong.io/kb/rest-api-v2/distance-matrix-rest-api-v2/distance-matrix-v2 An example of the JSON response returned by the API, containing rows of elements that detail the distance and duration between origin and destination pairs. ```json { "rows": [ { "elements": [ { "distance": { "text": "11.99 km", "value": 11988 }, "duration": { "text": "34 phút", "value": 2016 }, "status": "OK" } ] } ] } ``` -------------------------------- ### Routes Source: https://help.goong.io/kb/rest-api-v2/directions-rest-api-v2/directions-v2 Details about the calculated routes, including bounds, legs, distance, duration, and steps. ```APIDOC ## Routes ### Description Returns a list of calculated routes. If `alternatives` is set to `true`, multiple routes may be returned. ### Method GET (Assumed based on context) ### Endpoint /directions/v2 (Assumed based on context) ### Parameters #### Query Parameters - **routes** (array) - Description: List of routes returned. Contains route details like bounds, legs, distance, duration, etc. ### Response #### Success Response (200) - **routes** (array) - Description: An array of route objects. Each route object contains bounding box, legs, encoded polyline, warnings, etc. - **bounds** (object) - Description: The bounding box that encompasses the entire route. - **northeast** (object) - Description: The northeast corner of the bounding box. - **lat** (number) - Latitude. - **lng** (number) - Longitude. - **southwest** (object) - Description: The southwest corner of the bounding box. - **lat** (number) - Latitude. - **lng** (number) - Longitude. - **legs** (array) - Description: An array of legs (segments) in the route. Typically one leg if only origin and destination are provided. - **distance** (object) - Description: The distance of the leg. - **text** (string) - The distance in a human-readable format (e.g., "2.83 km"). - **value** (integer) - The distance in meters. - **duration** (object) - Description: The estimated travel time for the leg. - **text** (string) - The duration in a human-readable format (e.g., "22 giờ 10 phút"). - **value** (integer) - The duration in seconds. - **steps** (array) - Description: Detailed turn-by-turn instructions for the leg. - **overview_polyline** (object) - Description: The overall path of the route encoded as a polyline string, useful for drawing on a map. - **points** (string) - The encoded polyline string. - **warnings** (array) - Description: Any warnings associated with the route (e.g., restricted roads, tolls). - **waypoint_order** (array) - Description: Order of waypoints in the route. #### Response Example ```json { "routes": [ { "bounds": { "northeast": {"lat": 21.1, "lng": 105.9}, "southwest": {"lat": 20.9, "lng": 105.7} }, "legs": [ { "distance": {"text": "2.83 km", "value": 2828}, "duration": {"text": "22 giờ 10 phút", "value": 79799}, "steps": [] } ], "overview_polyline": {"points": "mtm_C{cudSG@eAfDc@xAq@"}, "warnings": [], "waypoint_order": [] } ] } ``` ``` -------------------------------- ### GET /v2/geocode Source: https://help.goong.io/kb/rest-api-v2/geocode-rest-api-v2/geocode-v2 Performs a reverse geocode lookup to convert coordinates into a detailed address and location information. ```APIDOC ## GET /v2/geocode ### Description Converts a pair of latitude and longitude coordinates into a specific address, including street names, cities, and administrative units. ### Method GET ### Endpoint https://rsapi.goong.io/v2/geocode ### Parameters #### Query Parameters - **latlng** (string) - Required - The coordinates to query, formatted as "lat,long" (e.g., 21.120678,106.397301). - **api_key** (string) - Required - Your Goong API key. - **limit** (integer) - Optional - The maximum number of results to return. - **has_deprecated_administrative_unit** (boolean) - Optional - If true, returns additional fields `deprecated_description` and `deprecated_compound` for historical administrative boundaries. - **has_vnid** (boolean) - Optional - If true, returns Vietnam administrative unit IDs (VNID) for the commune, district, and province. ### Request Example https://rsapi.goong.io/v2/geocode?latlng=15.765075,108.204474&limit=5&api_key={YOUR_API_KEY}&has_deprecated_administrative_unit=true ### Response #### Success Response (200) - **results** (array) - List of location objects matching the coordinates. - **formatted_address** (string) - The full, human-readable address. - **geometry** (object) - Contains the exact location (lat, lng) and boundary data. - **place_id** (string) - Unique identifier for the location. #### Response Example { "results": [ { "formatted_address": "Siêu thị Thế Giới Di Động, Đường 25 tháng 5, Thanh Hà, Hải Phòng", "geometry": { "location": { "lat": 20.8975369, "lng": 106.427671 } }, "place_id": "auAmTWGkCHC_uYDyaUQoH7ku4fdZa4SGj7tFTV5CiIq4lyMxdmr3zaG0fDNee678vrhZMlp7i4iPl1JPYmmuzYirc0psRabqiKheSm14iOG-kk0ebx6Yi4Ii-RTVsuvPI" } ] } ``` -------------------------------- ### GET /v2/geocode/street Source: https://help.goong.io/kb/rest-api-v2/geocode-rest-api-v2/geocode-street Converts geographic coordinates (latitude and longitude) into a specific street address. It requires an API key and the coordinates as parameters. ```APIDOC ## GET /v2/geocode/street ### Description Geocode street is the process of converting coordinates (latitude and longitude) into a specific street address. ### Method GET ### Endpoint https://rsapi.goong.io/v2/geocode/street ### Parameters #### Query Parameters - **api_key** (string) - Required - Your API key for system authentication. - **latlng** (string) - Required - The coordinates of the location to query, in the format 'latitude,longitude'. - **has_deprecated_administrative_unit** (boolean) - Optional - A boolean parameter for API V2 to display additional administrative unit information before merging. `True`: Results will follow new administrative divisions but include `deprecated_description` and `deprecated_compound` fields with old locality names. `False` or default: Only return new administrative divisions without old information. ### Request Example ``` https://rsapi.goong.io/v2/geocode/street?api_key={YOUR_API_KEY}&latlng=21.030145,105.811122&has_deprecated_administrative_unit=true ``` ### Response #### Success Response (200) - **results** (array) - An array containing location results matching the input coordinates or query. Each element is detailed location information. - **address_components** (array) - A list of components that make up the address, from the smallest detail (house number, street) to larger administrative levels (ward, district, province). - **long_name** (string) - The long form of the address component. - **short_name** (string) - The short form of the address component. - **formatted_address** (string) - The full, clearly formatted address, arranged from smallest to largest. Often used for display to end-users. - **geometry** (object) - Geometric information about the location. - **location** (object) - The latitude and longitude of the location. - **lat** (number) - The latitude (north-south coordinate) of the location. - **lng** (number) - The longitude (east-west coordinate) of the location. - **boundary** (string) - A polygon representing the administrative or geographic boundary of the location. Null if not available. - **place_id** (string) - A unique identifier for the place. Used for referencing or re-searching the place in other APIs. - **reference** (string) - A reference string for the place, often the same as `place_id`. Kept for backward compatibility. - **plus_code** (object | null) - A Plus Code (open code) for the location, allowing precise location identification within an administrative area. - **compound** (object) - Contains compound address components like commune and province. - **commune** (string) - The name of the commune (ward/township). - **province** (string) - The name of the province/city where the location is situated (updated to the latest administrative unit). - **types** (array) - A list of place types according to the system classification (if any), e.g., route, house_number, locality, etc. Can be empty if undetermined. - **name** (string) - The primary name of the place or a short description, e.g., store name, house number, landmark. - **address** (string) - The administrative address excluding the specific name or house number, usually a combination of "commune, district, province". - **deprecated_description** (string) - Description of the administrative unit before merging (if `has_deprecated_administrative_unit` is true). - **deprecated_compound** (object) - Compound address components from deprecated administrative units (if `has_deprecated_administrative_unit` is true). - **district** (string) - The name of the district/township. - **commune** (string) - The name of the commune/ward. - **province** (string) - The name of the province/city. - **status** (string) - The status of the API response. "OK" indicates success, "INVALID_REQUEST" indicates a malformed query, etc. #### Response Example ```json { "results": [ { "address_components": [ { "long_name": "Kim Mã", "short_name": "Kim Mã" }, { "long_name": "Giảng Võ", "short_name": "Giảng Võ" }, { "long_name": "Hà Nội", "short_name": "Hà Nội" } ], "formatted_address": "Kim Mã, Giảng Võ, Hà Nội", "geometry": { "location": { "lat": 21.030145, "lng": 105.811122 }, "boundary": "anj_CenydSx@tH" }, "place_id": "gqXMe8N2ZLdLtl-brGZ7twebS0PDeopXeJ2tRqxmoi57i9lNP-naGtlKmUCqBTJXVZMBAQ7Vknf5SwSsD", "reference": "gqXMe8N2ZLdLtl-brGZ7twebS0PDeopXeJ2tRqxmoi57i9lNP-naGtlKmUCqBTJXVZMBAQ7Vknf5SwSsD", "plus_code": null, "compound": { "commune": "Giảng Võ", "province": "Hà Nội" }, "types": [], "name": "Kim Mã", "address": "Giảng Võ, Hà Nội", "deprecated_description": "Kim Mã, Ngọc Khánh, Ba Đình, Hà Nội", "deprecated_compound": { "district": "Ba Đình", "commune": "Ngọc Khánh", "province": "Hà Nội" } } ], "status": "OK" } ``` ``` -------------------------------- ### GET /v2/place/children Source: https://help.goong.io/kb/rest-api-v2/autocomplete-rest-api-v2/child-id-v2 Retrieves child place IDs based on a parent ID. This endpoint is useful for navigating hierarchical location data. ```APIDOC ## GET /v2/place/children ### Description This endpoint allows you to retrieve a list of child place IDs associated with a given parent ID. It's designed to help explore hierarchical location data, such as sub-locations within a larger area like an airport or shopping mall. ### Method GET ### Endpoint https://rsapi.goong.io/v2/place/children ### Parameters #### Query Parameters - **parent_id** (string) - Required - The unique identifier of the parent location (e.g., airport, mall, large building). - **api_key** (string) - Required - Your Goong API key for authentication. - **has_deprecated_administrative_unit** (boolean) - Optional - If set to `true`, the response will include `deprecated_description` and `deprecated_compound` fields with historical administrative unit information. If `false` or omitted, only current administrative units are returned. ### Request Example ``` https://rsapi.goong.io/v2/place/children?parent_id=mkSTeXlgiYFUzS5Mu1-nwXuWbga8aInzZs8jS7hgq-FopXItor-FwbqqMFx3brv-aqoyT6Nja5MyBqEQIoF54wUWQRwS6bajPeaVfS4ls9uAfqUwfv26ZiR67RDSJbPLJ&api_key={YOUR_API_KEY}&has_deprecated_administrative_unit=false ``` ### Response #### Success Response (200) - **predictions** (array) - A list of child place predictions. - **description** (string) - The full address as displayed to the user. - **matched_substrings** (array|null) - Information about matched substrings in the description. - **place_id** (string) - A unique identifier for the place, usable with the Place Detail API. - **reference** (string) - An internal reference ID, similar to `place_id`. - **structured_formatting** (object) - Formatted address components. - **main_text** (string) - The primary text of the place name. - **main_text_matched_substrings** (array|null) - Matched substrings for the main text. - **secondary_text** (string) - Additional information (e.g., street, commune, province). - **secondary_text_matched_substrings** (array|null) - Matched substrings for the secondary text. - **has_children** (boolean) - Indicates if the place has child locations. - **plus_code** (object) - Open Location Code for the place. - **compound_code** (string) - Localized compound code. - **global_code** (string) - Global code. - **compound** (object) - Current administrative unit details. - **commune** (string) - Commune/town. - **province** (string) - Province/city. - **terms** (array) - Address components with their offsets. - **offset** (integer) - The starting offset of the term in the description string. - **value** (string) - The text value of the address component. - **types** (array) - The type of the place (e.g., `site`, `building`). - **distance_meters** (number|null) - Distance in meters if a location was provided in the request. - **deprecated_description** (string) - Full address string with old administrative unit information (only present if `has_deprecated_administrative_unit` is true). - **deprecated_compound** (object) - Old administrative unit details (only present if `has_deprecated_administrative_unit` is true). - **commune** (string) - Old commune/town. - **province** (string) - Old province/city. - **execution_time** (string) - The time taken to process the query in microseconds. - **status** (string) - The status of the response (e.g., "OK"). #### Response Example ```json { "predictions": [ { "description": "Cổng đón/trả khách, Trường THPT Nguyễn Bỉnh Khiêm, 78 Hoàng Hoa Thám, Tam Long, Hồ Chí Minh", "matched_substrings": null, "place_id": "oXe3tlO8AXFyj1sxpFqs6HPSalW6d53fcr9xFHNbls6l0V8vQXmk33e1nlSnZI55aNKTJ79bitZ0tlugFmbtz38vZdG8AJbfcqVAVJZmQlv9zjFMAoACGlnGkWyuWAe3W", "reference": "oXe3tlO8AXFyj1sxpFqs6HPSalW6d53fcr9xFHNbls6l0V8vQXmk33e1nlSnZI55aNKTJ79bitZ0tlugFmbtz38vZdG8AJbfcqVAVJZmQlv9zjFMAoACGlnGkWyuWAe3W", "structured_formatting": { "main_text": "Cổng đón/trả khách", "main_text_matched_substrings": null, "secondary_text": "Trường THPT Nguyễn Bỉnh Khiêm, 78 Hoàng Hoa Thám, Tam Long, Hồ Chí Minh", "secondary_text_matched_substrings": null }, "has_children": false, "plus_code": { "compound_code": "+JKB1 Long Tâm, Bà Rịa, Bà Rịa-Vũng Tàu", "global_code": "49ON8+JKB1" }, "compound": { "commune": "Tam Long", "province": "Hồ Chí Minh" }, "terms": [ { "offset": 0, "value": "Cổng đón/trả khách" }, { "offset": 26, "value": "Trường THPT Nguyễn Bỉnh Khiêm" }, { "offset": 65, "value": "78 Hoàng Hoa Thám" }, { "offset": 86, "value": "Tam Long" }, { "offset": 96, "value": "Hồ Chí Minh" } ], "types": [ "site" ], "distance_meters": null } ], "execution_time": "143.612µs", "status": "OK" } ``` ``` -------------------------------- ### Define Place Autocomplete JSON Response Structure Source: https://help.goong.io/kb/rest-api-v2/autocomplete-rest-api-v2/autocomplete-v2 This JSON structure represents a single location result from the Goong API. It contains metadata such as 'place_id', 'reference', 'structured_formatting' for UI display, and 'compound' for administrative details. ```json { "place_id": "Oyx0RyVbUFSniEMxkHCR-XijT1e7cKPUeNVcpwdznfBv1lSwumGm8HayWL-6Y47Xc7JYFaxauNlsi34ekQewk0GOKGq4Y-qVdbGZU1xhkRTB0i5G9-AeBkXYHXKORBurR", "structured_formatting": { "main_text": "Sảnh đón/trả khách", "secondary_text": "Chung cư IDB Complex, Ngõ 298 Ngọc Lâm, Bồ Đề, Hà Nội" }, "plus_code": { "compound_code": "+GNYO Ngọc Lâm, Long Biên, Hà Nội", "global_code": "LOEJ+GNYO" }, "types": ["building"] } ```