인증 방식
🔑 API Key
요금
월 100만 건 무료, 이후 1만 건당 30원~
Base URL
maps.googleapis.com
태그
지도, 네이버
서비스 소개
네이버지도 API는 네이버 검색 데이터와 연동된 장소 정보가 강점입니다. Static Map, JavaScript SDK, Geocoding, Directions, Elevation 등 다양한 API를 제공하며, 특히 국내 음식점·상호 데이터 품질이 뛰어납니다.
🚀 시작하기
- 1
Naver Cloud 가입
console.ncloud.com → 회원가입 → AI·NAVER API → Maps 서비스 신청
- 2
Application 등록
Application 등록 → Web Dynamic Map / Geocoding / Directions 선택
- 3
Client ID 발급
등록 완료 후 Client ID와 Client Secret 복사
- 4
Referer 등록
웹 서비스 URL(localhost 포함) 등록 필수
📋 응답 예시
{
"status": "OK",
"route": {
"traoptimal": [{
"summary": {
"start": { "location": { "x": 127.027619, "y": 37.497942 } },
"goal": { "location": { "x": 126.977041, "y": 37.575474 } },
"distance": 12340,
"duration": 1820000
}
}]
}
}💡 코드 예제
JavaScript지도 삽입 (React)
'use client'
import { useEffect, useRef } from 'react'
declare global { interface Window { naver: any } }
export function NaverMap() {
const ref = useRef<HTMLDivElement>(null)
useEffect(() => {
const script = document.createElement('script')
script.src = `https://openapi.map.naver.com/openapi/v3/maps.js?ncpClientId=${process.env.NEXT_PUBLIC_NAVER_MAP_CLIENT_ID}`
script.onload = () => {
new window.naver.maps.Map(ref.current, {
center: new window.naver.maps.LatLng(37.5665, 126.9780),
zoom: 14,
})
}
document.head.appendChild(script)
}, [])
return <div ref={ref} style={{ width: '100%', height: '400px' }} />
}cURLGeocoding (주소→좌표)
curl "https://naveropenapi.apigw.ntruss.com/map-geocode/v2/geocode?query=강남구 테헤란로 152" \
-H "X-NCP-APIGW-API-KEY-ID: YOUR_CLIENT_ID" \
-H "X-NCP-APIGW-API-KEY: YOUR_CLIENT_SECRET"