🗺️ GIS & RS/📚 GIS (지리정보시스템)

[GIS] Google Places API의 응답 데이터

김 홍시 2025. 1. 18. 15:23
반응형

Google Places API는 장소 검색, 세부정보 조회, 텍스트 검색, 주변 장소 탐색 등 다양한 기능을 제공합니다. 예를 들어, 서울의 유명한 장소인 경복궁에 대해 검색하는 경우, 다음과 같은 JSON 형식의 응답이 반환될 수 있습니다.

예시: 경복궁(Gyeongbokgung Palace)의 Place Details API 응답 데이터

{
  "html_attributions": [],
  "result": {
    "address_components": [
      {
        "long_name": "161",
        "short_name": "161",
        "types": ["premise"]
      },
      {
        "long_name": "사직로",
        "short_name": "사직로",
        "types": ["route"]
      },
      {
        "long_name": "종로구",
        "short_name": "종로구",
        "types": ["administrative_area_level_2", "political"]
      },
      {
        "long_name": "서울특별시",
        "short_name": "서울특별시",
        "types": ["administrative_area_level_1", "political"]
      },
      {
        "long_name": "대한민국",
        "short_name": "KR",
        "types": ["country", "political"]
      },
      {
        "long_name": "03045",
        "short_name": "03045",
        "types": ["postal_code"]
      }
    ],
    "formatted_address": "대한민국 서울특별시 종로구 사직로 161",
    "formatted_phone_number": "+82 2-3700-3900",
    "geometry": {
      "location": {
        "lat": 37.579617,
        "lng": 126.977041
      },
      "viewport": {
        "northeast": {
          "lat": 37.5809669802915,
          "lng": 126.9783909802915
        },
        "southwest": {
          "lat": 37.5782690197085,
          "lng": 126.9756930197085
        }
      }
    },
    "name": "경복궁",
    "opening_hours": {
      "open_now": false,
      "periods": [
        {
          "open": {
            "day": 0,
            "time": "0900"
          },
          "close": {
            "day": 0,
            "time": "1800"
          }
        },
        {
          "open": {
            "day": 1,
            "time": "0900"
          },
          "close": {
            "day": 1,
            "time": "1800"
          }
        }
      ],
      "weekday_text": [
        "월요일: 09:00 – 18:00",
        "화요일: 09:00 – 18:00",
        "수요일: 09:00 – 18:00",
        "목요일: 09:00 – 18:00",
        "금요일: 09:00 – 18:00",
        "토요일: 09:00 – 18:00",
        "일요일: 09:00 – 18:00"
      ]
    },
    "photos": [
      {
        "height": 600,
        "html_attributions": ["<a href=\"https://maps.google.com/maps/contrib/102345\">User</a>"],
        "photo_reference": "CmRaAAAAF7...",
        "width": 800
      }
    ],
    "place_id": "ChIJORXU1PqifDURKzU4A8b8AaM",
    "plus_code": {
      "compound_code": "HXFG+4W 서울특별시 대한민국",
      "global_code": "8Q99HXFG+4W"
    },
    "rating": 4.6,
    "reviews": [
      {
        "author_name": "홍길동",
        "language": "ko",
        "profile_photo_url": "https://lh3.googleusercontent.com/a-/AC...",
        "rating": 5,
        "relative_time_description": "2주 전",
        "text": "경복궁은 역사와 전통을 느낄 수 있는 곳입니다. 한국의 문화를 느끼기에 최고입니다.",
        "time": 1617172930
      }
    ],
    "types": [
      "tourist_attraction",
      "point_of_interest",
      "establishment"
    ],
    "url": "https://maps.google.com/?cid=...",
    "user_ratings_total": 15349,
    "website": "http://royalpalace.go.kr"
  },
  "status": "OK"
}

주요 필드 설명

  • address_components: 경복궁의 주소 구성 요소.
  • formatted_address: 완전한 주소 (한글 제공).
  • geometry: 위치의 위도(lat)와 경도(lng), 그리고 뷰포트.
  • name: 장소 이름 (한글).
  • opening_hours: 운영 시간과 요일별 텍스트.
  • photos: 이미지와 관련된 메타데이터.
  • rating: 평균 평점 (4.6).
  • reviews: 사용자 리뷰.
  • place_id: 장소 고유 ID.
  • website: 공식 웹사이트 URL.

이 응답 데이터는 한국 사용자들에게 친숙한 형식으로 제공되며, 서울 내 주요 관광지의 정보를 웹이나 앱에서 표시하는 데 유용합니다. 

 

 

반응형