## Place Details

Retrieves detailed information about a specific place using its unique `place_id`.

### Request

#### Endpoint

```
https://dplace-api.themap.world/maps/api/place/details/json
```

#### Query params

| Param | Required | Description |
|  --- | --- | --- |
| `place_id` | Required | A single ID in the format `source:layer:id`, for example: `osm:venue:b467e12f...`. If the ID has an invalid format or an unsupported layer, the request fails with `400` |
| `has_deprecated_admin` | Optional | `true` if you want to return old_formatted_address, old_address_components |


#### Example

```bash
curl --location 'https://dplace-api.themap.world/maps/api/place/details/json?place_id=4:venue:b467e12f599e45838c0924d8e85c5fd9&has_deprecated_admin=true&key=YOUR_API_KEY'
```

### Response

`details/json` wraps the response in the following top-level fields:

| Field | When present | Content |
|  --- | --- | --- |
| `status` | always | `OK`, `ZERO_RESULTS`, `NOT_FOUND`, `INVALID_REQUEST`, or `UNKNOWN_ERROR` |
| `error_message` | on `INVALID_REQUEST` / `UNKNOWN_ERROR` | error description |
| `info_messages` | when there is a parameter warning | array of strings |
| `html_attributions` | always | `[]` — no third-party attribution data |


#### `status`

| Value | Meaning |
|  --- | --- |
| `OK` | success, place found |
| `NOT_FOUND` | `place_id` does not exist |
| `INVALID_REQUEST` | missing or invalid parameter (HTTP 400) |
| `UNKNOWN_ERROR` | server-side error: timeout, backend unreachable (HTTP 502/500) |


#### `result`

The fields shown in the example response body above:

| Field | When present | Content |
|  --- | --- | --- |
| `place_id` | always | unique identifier for the place |
| `source` | always | numeric source ID for the place data |
| `name` | always | place name |
| `formatted_address` | always | standardized full address |
| `address_components` | always | array of `{long_name, short_name, types}` components of `formatted_address` |
| `old_formatted_address` | always | address before an administrative merge, or `""` if none |
| `old_address_components` | when `old_formatted_address` is non-empty | array of `{long_name, short_name, types}` components of `old_formatted_address` |
| `geometry` | always | `location` (lat/lng) and `viewport` (northeast/southwest bounds) |
| `types` | always | array of place type classifications |
| `category` | always | top-level place category |
| `subcategory` | always | place subcategory |
| `plus_code` | when available in the source data | Open Location Code for the place |
| `business_status` | when available in the source data | e.g. `OPERATIONAL` |


When `place_id` does not exist, `status` is `NOT_FOUND` and `result` is an empty object (not `null`):

```json
{
  "status": "NOT_FOUND",
  "html_attributions": [],
  "result": {}
}
```

When the request has an invalid parameter, `/api/v3/` still returns HTTP 200 with `status: "INVALID_REQUEST"` and keeps `result` in the body:

```json
{
  "status": "INVALID_REQUEST",
  "error_message": "id `abc is invalid: must be of the format source:layer:id for ex: '4:venue:ffb627dc81f845e59b5c0259582ad101'",
  "result": {},
  "html_attributions": [],
}
```

#### Example:

```json
{
  "status": "OK",
  "result": {
    "place_id": "4:venue:ffb627dc81f845e59b5c0259582ad101",
    "source": 4,
    "name": "Cơm tấm Huyền Trang",
    "formatted_address": "3 Đường Lương Văn Can, Phường Phú Định, Thành phố Hồ Chí Minh, Việt Nam",
    "address_components": [
      {
        "long_name": "3",
        "short_name": "3",
        "types": [
          "street_number"
        ]
      },
      {
        "long_name": "Đường Lương Văn Can",
        "short_name": "Đường Lương Văn Can",
        "types": [
          "route"
        ]
      },
      {
        "long_name": "Phường Phú Định",
        "short_name": "Phường Phú Định",
        "types": [
          "administrative_area_level_2"
        ]
      },
      {
        "long_name": "Thành phố Hồ Chí Minh",
        "short_name": "Thành phố Hồ Chí Minh",
        "types": [
          "administrative_area_level_1"
        ]
      },
      {
        "long_name": "Việt Nam",
        "short_name": "VN",
        "types": [
          "country"
        ]
      }
    ],
    "old_formatted_address": "3 Đường Lương Văn Can, Phường 15, Quận 8, Thành phố Hồ Chí Minh, Việt Nam",
    "old_address_components": [
      {
        "long_name": "3",
        "short_name": "3",
        "types": [
          "street_number"
        ]
      },
      {
        "long_name": "Đường Lương Văn Can",
        "short_name": "Đường Lương Văn Can",
        "types": [
          "route"
        ]
      },
      {
        "long_name": "Phường 15",
        "short_name": "Phường 15",
        "types": [
          "administrative_area_level_3"
        ]
      },
      {
        "long_name": "Quận 8",
        "short_name": "Quận 8",
        "types": [
          "administrative_area_level_2"
        ]
      },
      {
        "long_name": "Thành phố Hồ Chí Minh",
        "short_name": "Thành phố Hồ Chí Minh",
        "types": [
          "administrative_area_level_1"
        ]
      },
      {
        "long_name": "Việt Nam",
        "short_name": "VN",
        "types": [
          "country"
        ]
      }
    ],
    "geometry": {
      "location": {
        "lat": 10.73602,
        "lng": 106.63923
      },
      "viewport": {
        "northeast": {
          "lat": 10.73692,
          "lng": 106.64043
        },
        "southwest": {
          "lat": 10.73512,
          "lng": 106.63803
        }
      }
    },
    "types": [
      "food_and_drink",
      "restaurant"
    ],
    "category": "food_and_drink",
    "subcategory": "restaurant",
    "plus_code": "7P28PJPQCM5",
    "business_status": "OPERATIONAL"
  },
  "html_attributions": []
}
```