Skip to content

Latest commit

 

History

History
782 lines (736 loc) · 14.7 KB

metro.md

File metadata and controls

782 lines (736 loc) · 14.7 KB

수도권 지하철 역사 / 도착정보 / 시간표 안내

아래에는 수도권 지역의 지하철/전철 역사 정보, 시간표 및 실시간 도착 정보에 대하여 서술되어 있습니다.

객체

아래의 객체는 해당 API에 주로 사용되는 공통 객체 입니다.

MetroStationInfo

설명 형태 필수 유무 기본 값 비고
arrivalStationId 실시간 도착 정보 역ID integer X
code 외부 코드(역코드) string O
displayName 취급 역명 string X 운영사에서 취급하는 역사명
id 역사 ID string O 시간표용 ID값
name 역사명 string O /around에서 미제공
posX 경도 float X /around에서 미제공
posY 위도 float X /around에서 미제공
subway 노선명 string O
subwayId 노선 ID integer O

ArrivalInfo

설명 형태 필수 유무 기본 값 비고
destination 목적지 string O
direction 방향 integer O
direction_name 방향(이름) string O
heading 출입문 string O
isArrive 도착 유무 boolean O
isDeparture 출발 유무 boolean O
isEntry 진입 유무 boolean O
isPrevArrive 전역 도착 유무 boolean O
isPrevDeparture 전역 출발 유무 boolean O
isPrevEntry 전역 진입 유무 boolean O
isRapid 급행 유무 boolean O
nextStation 다음역 ID string O
prevCount 남은 역 수(n역 전) integer O
prevStation 이전역 ID string O
rapidInfo 급행 열차 정보 string X null
stationId 이번역 ID string O
subway 지하철 ID integer O
time 도착 시간 integer O
train 열차 명(번호) string O

/station

전철역 정보를 불러옵니다.

https://api.yhs.kr/metro/station

Parameter

설명 형태 필수 유무 기본 값 비고
name 전철/지하철 역사명 string O

Return

[
  {
    "arrivalStationId": 1001000133,
    "code": "133",
    "displayName": "서울역",
    "id": "0150",
    "name": "서울역",
    "posX": 126.972559,
    "posY": 37.554648,
    "subway": "1호선",
    "subwayId": 1001
  }
]
  • 기본 객체
설명 형태 필수 유무 기본 값 비고
지하철 역사 정보 list[MetroStationInfo] O

/around

전철역 주변 정보를 불러옵니다.

https://api.yhs.kr/metro/around

Parameter

설명 형태 필수 유무 기본 값 비고
posX 경도 float O
posY 위도 float O
distance 반경 integer X 500 미터법(m) 적용
details 자세한 정보 boolean X True

Return

{
  "서울역": {
    "data": [
      {
        "arrivalStationId": 1001000133,
        "code": "133",
        "displayName": "서울역",
        "id": "0150",
        "subway": "1호선",
        "subwayId": 1001
      }
    ],
    "direction": 0,
    "distance": 0.0,
    "posX": 126.972559,
    "posY": 37.554648
  }
}
  • 기본 객체
설명 형태 필수 유무 기본 값 비고
지하철 역사 정보 union[string, AroundStationInfo] O details 활성화: string
details 비활성화: list[AroundStationInfo]
  • AroundStationInfo 객체
설명 형태 필수 유무 기본 값 비고
data 지하철 역사 정보 MetroStationInfo O /around 형태로 변환
direction 방향 Integer O
distance 거리 Integer O 미터법(m) 적용
posX 경도 float O
posY 위도 float O

/arrival

실시간 도착 정보를 불러옵니다.

https://api.yhs.kr/metro/arrival

Parameter

설명 형태 필수 유무 기본 값 비고
id 전철/지하철 도착 정보 ID integer O

Return

{
  "arrival": [
    {
      "destination": "군자(능동) (막차)",
      "direction": 0,
      "direction_name": "상행",
      "heading": "오른쪽",
      "isArrive": false,
      "isDeparture": false,
      "isEntry": false,
      "isPrevArrive": false,
      "isPrevDeparture": false,
      "isPrevEntry": false,
      "isRapid": false,
      "nextStation": "1005080549",
      "prevCount": 5,
      "prevStation": "1005080551",
      "rapidInfo": null,
      "stationId": "1005080550",
      "time": 960,
      "train": "5662"
    }
  ],
  "displayName": "올림픽공원(한국체대)",
  "stationId": 1005080550,
  "stationName": "올림픽공원",
  "subway": 1005,
  "transform": {
      "1009": {
          "arrival": [],
          "displayName": "올림픽공원",
          "stationId": 1009000936
      }
  }
}
  • 기본 객체
설명 형태 필수 유무 기본 값 비고
arrival 도착 정보 list[ArrivalInfo] O
displayName 취급 역명 string O 운영사에서 취급하는 역사명
stationId 실시간 도착 정보 역ID integer O
name 역사명 string O
subway 지하철 ID integer O
transform 환승 정보 json(string, TransformArrival 객체) O
  • TransformArrival 객체
설명 형태 필수 유무 기본 값 비고
arrival 도착 정보 list[ArrivalInfo] O
displayName 취급 역명 string O 운영사에서 취급하는 역사명
stationId 실시간 도착 정보 역ID integer O

/timetable

전철/지하철 시간표를 불러옵니다.

https://api.yhs.kr/metro/timetable

Parameter

설명 형태 필수 유무 기본 값 비고
id 역사 ID integer O
direction 방향 integer X 0
weekType 시간표 유형 integer X 0 0: 평일
1: 주말(토요일)
2: 일요일/공휴일

Return

[
  {
    "destination": "인천",
    "direction": 1,
    "hours": 5,
    "id": "1812",
    "minutes": 0,
    "name": "인천",
    "seconds": 0,
    "week_type": 2
  }
]
  • 기본 객체
destination 목적지 string O
direction 방향 integer O
hours 시간 integer O
id 역사 ID integer O
minutes integer O
name 역사 명 string O
seconds integer O
weekType 시간표 유형 integer O 0: 평일
1: 주말(토요일)
2: 일요일/공휴일