이 제품 또는 기능은 기존 상태입니다. 기존 단계 및 기존 서비스에서 최신 서비스로 이전하는 방법에 대한 자세한 내용은
기존 제품 및 기능을 참고하세요.
Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
Distance Matrix API (기존) 시작하기
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
샘플 요청 및 응답
다음 예에서는 워싱턴 D.C.와 뉴욕시 간의 거리 매트릭스 데이터를 JSON 형식으로 요청합니다.
URL
https://maps.googleapis.com/maps/api/distancematrix/json
?destinations=New%20York%20City%2C%20NY
&origins=Washington%2C%20DC
&units=imperial
&key=YOUR_API_KEY
curl
curl -L -X GET 'https://maps.googleapis.com/maps/api/distancematrix/json?origins=Washington%2C%20DC&destinations=New%20York%20City%2C%20NY&units=imperial&key=YOUR_API_KEY'
사용해 보기 웹브라우저에 URL을 입력하여 이 요청을 테스트합니다. 이때 YOUR_API_KEY를 실제 API 키로 바꿔야 합니다. 응답에는 지정된 출발지와 도착지 간의 거리와 시간이 표시됩니다.
사용 가능한 모든 매개변수를 포함하여 요청 URL을 빌드하는 방법을 알아봅니다.
이 코드 샘플은 JSON 및 XML 형식입니다.
JSON
{
"destination_addresses": ["New York, NY, USA"],
"origin_addresses": ["Washington, DC, USA"],
"rows":
[
{
"elements":
[
{
"distance": { "text": "228 mi", "value": 367654 },
"duration": { "text": "3 hours 55 mins", "value": 14078 },
"status": "OK",
},
],
},
],
"status": "OK",
}
XML
OK
Washington, DC, USA
New York, NY, USA
OK
14078
3 hours 55 mins
367654
228 mi
개발자 가이드를 확인하여 응답을 이해합니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2026-04-29(UTC)
[null,null,["최종 업데이트: 2026-04-29(UTC)"],[],["The content demonstrates requesting distance data between Washington, DC, and New York City using the Google Maps Distance Matrix API. The request URL and cURL command are provided, requiring the user to replace `YOUR_API_KEY` with their own. The API returns distance (228 mi) and duration (3 hours 55 mins) data in both JSON and XML formats. Users can test the URL and further understand responses, and can learn to build custom URL requests through provided documentation.\n"]]