# Public Transit Route Search

| Method |                      Request URI                     | Response Type |
| :----: | :--------------------------------------------------: | :-----------: |
|   GET  | <https://api.fatos.biz/pubtrans/searchPubTransPathT> |   json, xml   |

### Parameter

|    Parameter   | Required |                                                                                                          Description                                                                                                         |                                                                            Sample                                                                            |
| :------------: | :------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------: |
|       key      |     Y    |                                                                                                         Your API Key                                                                                                         |                                                                        key=xxxxxxxxxxx                                                                       |
|      lang      |     N    | <p>Select Result Language </p><p>(Korean: 0, English: 1, Japanese: 2, Chinese (simplified): 3, Chinese (traditional): 4, Vietnamese: 5)</p><ul><li>For Vietnamese, only in the metropolitan area</li></ul><p>default = 0</p> |                                                                            lang=0                                                                            |
|     output     |     N    |                                                                                    <p>Output format (json, xml) </p><p>default = json</p>                                                                                    |                                                                          output=json                                                                         |
|       SX       |     Y    |                                                                                                       Origin longitude                                                                                                       |                                                                         SX=126.896038                                                                        |
|       SY       |     Y    |                                                                                                        Origin latitude                                                                                                       |                                                                         SY=37.482901                                                                         |
|       EX       |     Y    |                                                                                                     Destination longitude                                                                                                    |                                                                        EX=127.8906596                                                                        |
|       EY       |     Y    |                                                                                                     Destination latitude                                                                                                     |                                                                         EY=37.4866369                                                                        |
|       OPT      |     N    |                                <p>Path search result sorting method</p><p>0: Recommended path </p><p>1: sorted by type </p><p>ex) subway, bus, bus+ subway, subway+ bus, bus+ subway+ bus</p>                                |                                                                             OPT=0                                                                            |
|   SearchType   |     N    |                                                                                              Select Intercity/In-City Movement.                                                                                              | A search is performed for intra-city movement/intercity movement. Search in city when entering 0 (Use if there is an urban search result in an urban search) |
| SearchPathType |     N    |                                                                                           Specify the route means within the city.                                                                                           |                                                   <p>0: All (default) </p><p>1: Subway </p><p>2: Buses</p>                                                   |

### Response

|           Name           |  Type  |                                                                 Description                                                                 |
| :----------------------: | :----: | :-----------------------------------------------------------------------------------------------------------------------------------------: |
|          result          |  node  |                                                                   Top node                                                                  |
|        searchType        |   int  | <p>Result classification (via city or city direct or intercity transfer)</p><p> 0-In-City, </p><p>1-City Direct, </p><p>2-City Transfer</p> |
|      outTrafficCheck     |   int  |                           <p>Intercity "direct" navigation results (Transfer X) </p><p>0-False, </p><p>1-True</p>                           |
|         busCount         |   int  |                                                            Number of bus results                                                            |
|        subwayCount       |   int  |                                                           Number of subway results                                                          |
|      subwayBusCount      |   int  |                                                       Number of "Bus + Subway" results                                                      |
|       pointDistance      | double |                                 Straight distance (meters) between origin (SX, SY) and destination (EX, EY)                                 |
|        startRadius       |   int  |                                                       the radius of the starting point                                                      |
|         endRadius        |   int  |                                                           a radius of destination                                                           |
|           path           |  node  |                                                          Result List Extension Node                                                         |
|         pathType         |   int  |                                    <p>Result Type </p><p>1-subway, </p><p>2-bus, </p><p>3-bus+subway</p>                                    |
|           info           |  node  |                                                      Summary Information Extension Node                                                     |
|      trafficDistance     | double |                                                    Total distance traveled except on foot                                                   |
|         totalWalk        |   int  |                                                            Total walking distance                                                           |
|         totalTime        |   int  |                                                             Total time required                                                             |
|          payment         |   int  |                                                                a total charge                                                               |
|      busTransitCount     |   int  |                                                              Bus transfer count                                                             |
|    subwayTransitCount    |   int  |                                                           a subway transfer count                                                           |
|          mapObj          | string |                                          Parameter values for invoking the interpolation point API                                          |
|     firstStartStation    | string |                                                          an initial departure/stop                                                          |
|      lastEndStation      | string |                                                             a final station/stop                                                            |
|     totalStationCount    |   int  |                                                              Total stops count                                                              |
|      busStationCount     |   int  |                                                               Total bus stops                                                               |
|    subwayStationCount    |   int  |                                                         the sum of the subway stops                                                         |
|       totalDistance      | double |                                                               a total distance                                                              |
|          subPath         |  node  |                                                  Transportation Information Extension Node                                                  |
|        trafficType       |   int  |                       <p>Types of transportation (walk, bus, subway) </p><p>1-subway, </p><p>2-bus, </p><p>3-walk</p>                       |
|         distance         | double |                                                               travel distance                                                               |
|        sectionTime       |   int  |                                                                Time to travel                                                               |
|       stationCount       |   int  |                                   Number of stops moving to and from (required for subways and buses only)                                  |
|           lane           |  node  |                                                  Transportation Information Extension Node                                                  |
|           name           | string |                                               Name of subway line (required only for subways)                                               |
|           busNo          | string |                                                     Bus number (required only for buses)                                                    |
|           type           |   int  |                                                Bus type (required only for buses, see bottom)                                               |
|           busID          |   int  |                                                      Bus code (required only for buses)                                                     |
|       busLocalBlID       | string |                                     Bus route ID for each region (required only for BIS-provided areas)                                     |
|        busCityCode       |   int  |                                     Transportation company approved city code (required only for buses)                                     |
|      busProviderCode     |   int  |                                               BIS code (required only for BIS delivery areas)                                               |
|        subwayCode        |   int  |                                                Subway line number (required only for subways)                                               |
|      subwayCityCode      |   int  |                                                 Subway city code (required only for subways)                                                |
|         startName        | string |                                                             a stop/station name                                                             |
|          startX          | double |                                                       Ride stop/station X coordinates                                                       |
|          startY          | double |                                                       Ride stop/station Y coordinates                                                       |
|          endName         | string |                                                             a stop/station name                                                             |
|           endX           | double |                                                     Drop-off stop/station X coordinates                                                     |
|           endY           | double |                                                     Drop-off stop/reverse Y coordinates                                                     |
|            way           | string |                                             Directional information (required only for subways)                                             |
|          wayCode         |   int  |               <p>Directional information code (required only for the first route of the subway) </p><p>1 up, </p><p>2 down</p>              |
|           door           | string |                                          Rapid subway transfer location (required only for subways)                                         |
|          startID         |   int  |                                                         Departure stop/station code                                                         |
|   startStationCityCode   |   int  |                                              Departure stop city code (required only for buses)                                             |
| startStationProviderCode |   int  |                                        Departure stop BIS code (required only for BIS-provided areas)                                       |
|    startLocalStationID   | string |                                   Departure stop ID for each region (required only for BIS-provided areas)                                  |
|        startArsID        | string |                              Unique number of each local departure stop (required only for BIS-provided areas)                              |
|           endID          |   int  |                                                          Arrival stop/station code                                                          |
|    endStationCityCode    |   int  |                                               Arrival stop city code (required only for buses)                                              |
|  endStationProviderCode  |   int  |                                         Arrival stop BIS code (required only for BIS-provided areas)                                        |
|     endLocalStationID    | string |                                    Arrival stop ID for each region (required only for BIS-provided areas)                                   |
|         endArsID         | string |                               Unique number of each local arrival stop (required only for BIS-provided areas)                               |
|        startExitNo       | string |                                    subway exit number (Used only for subways, but may not have that tag.)                                   |
|        startExitX        | double |                      Exit X coordinates for subway entry (only used for subways but may not have the corresponding tag)                     |
|        startExitY        | double |                         Exit Y coordinates for subway (only used for subway but may not have the corresponding tag)                         |
|         endExitNo        | string |                           Exit number of the subway (only used for subways but may not have the corresponding tag)                          |
|         endExitX         | double |                       Exit X coordinates of subway exit (only used for subway but may not have the corresponding tag)                       |
|         endExitY         | double |                       Exit Y coordinates of subway exit (only used for subway but may not have the corresponding tag)                       |
|       passStopList       |  node  |                                  Route Detail Section Information Extension Node (available in Korean only)                                 |
|         stations         |  node  |                                                         Stop Information Group Node                                                         |
|           index          |   int  |                                                              the order of stops                                                             |
|         stationID        |   int  |                                                                  station ID                                                                 |
|        stationName       | string |                                                                 stationName                                                                 |
|      stationCityCode     |   int  |                                                   Stop city code (required only for buses)                                                  |
|    stationProviderCode   |   int  |                                               BIS code (required only for BIS delivery areas)                                               |
|      localStationID      | string |                                             Local stop ID (required only for BIS-provided areas)                                            |
|           arsID          | string |                                   Unique number of each local stop (required only for BIS-provided areas)                                   |
|             x            | string |                                                            Station X coordinates                                                            |
|             y            | string |                                                            Station Y coordinates                                                            |
|         isNonStop        | string |                                                 Unstalled stop Y/N (required only for buses)                                                |

### Response Sample

```json
{
	"result": {
		"searchType": 0,
		"outTrafficCheck": 0,
		"busCount": 7,
		"subwayCount": 1,
		"subwayBusCount": 5,
		"pointDistance": 24046,
		"startRadius": 700,
		"endRadius": 700,
		"path": [
			{
				"pathType": 3,
				"info": {
					"trafficDistance": 29882,
					"totalWalk": 1316,
					"totalTime": 89,
					"payment": 1650,
					"busTransitCount": 1,
					"subwayTransitCount": 1,
					"mapObj": "1123:1:43:52@11:2:137:116",
					"firstStartStation": "구로디지털단지역",
					"lastEndStation": "방학",
					"totalStationCount": 31,
					"busStationCount": 9,
					"subwayStationCount": 22,
					"totalDistance": 31198,
					"totalWalkTime": -1
				},
				"subPath": [
					{
						"trafficType": 3,
						"distance": 592,
						"sectionTime": 9
					},
					{
						"trafficType": 2,
						"distance": 4082,
						"sectionTime": 17,
						"stationCount": 9,
						"lane": [
							{
								"busNo": "5531",
								"type": 12,
								"busID": 1123,
								"busLocalBlID": "100100265",
								"busCityCode": 1000,
								"busProviderCode": 4
							}
						],
						"startName": "구로디지털단지역",
						"startX": 126.90256,
						"startY": 37.484078,
						"endName": "대방역",
						"endX": 126.92635,
						"endY": 37.512554,
						"startID": 126473,
						"startStationCityCode": 1000,
						"startStationProviderCode": 4,
						"startLocalStationID": "120000001",
						"startArsID": "21-001",
						"endID": 103278,
						"endStationCityCode": 1000,
						"endStationProviderCode": 4,
						"endLocalStationID": "119000022",
						"endArsID": "20-108",
						"passStopList": {
							"stations": [
								{
									"index": 0,
									"stationID": 126473,
									"stationName": "구로디지털단지역",
									"stationCityCode": 1000,
									"stationProviderCode": 4,
									"localStationID": "120000001",
									"arsID": "21-001",
									"x": "126.90256",
									"y": "37.484078",
									"isNonStop": "N"
								},
								{
									"index": 1,
									"stationID": 126478,
									"stationName": "동작상떼빌아파트",
									"stationCityCode": 1000,
									"stationProviderCode": 4,
									"localStationID": "119000001",
									"arsID": "20-001",
									"x": "126.904537",
									"y": "37.486503",
									"isNonStop": "N"
								}
							]
						}
					}
				]
			}
		]
	}
}
```
