파이썬에서 Google Map API 사용하기

Gracie·2024년 5월 12일

파이썬 내에서 구글 맵을 사용하기 위한 Google API을 설치해보자!

1. Google Map API Key 생성하기

  • 유료 API 이기 때문에, 구글계정에 결제정보를 등록한 후에 사용 가능하다

1) 아래 API 설치

2) 사용자 인증정보 생성

  • 제한사항: Gecoding API

3) 새 프로젝트 생성 및 Api key 발급

2. googlemaps 모듈 설치

prompt 창에서 > 내가 사용할 환경 접속 후 > google maps 모듈을 설치해 준다
1) 윈도우, 맥(intel) 명령어: conda install -c conda-forge googlemaps
2) 맥(M1) 명령어: pip install googlemaps

ex) conda 내 ds_study라는 가상환경에 설치하기

conda activate ds_study
conda install -c conda-forge googlemaps

3. import googlemaps

import googlemaps
gmaps_key = 'API_Key'
gmaps = googlemaps.Client(key = gmaps_key)
profile
비전공자의 Data Analyst 도전기 🥹✨

0개의 댓글