Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save qjtdsqqm94akkyysgjdqo3hx1jn6l17/3266c3c5ae9a9067686147a0271f96dd to your computer and use it in GitHub Desktop.
Save qjtdsqqm94akkyysgjdqo3hx1jn6l17/3266c3c5ae9a9067686147a0271f96dd to your computer and use it in GitHub Desktop.
BuytHCM_spec
openapi: 3.0.0
info:
title: BuytHCM
description: >
Import from a HTTP Archive (HAR) file via a really round about way (from HAR
to Insomiac collection to Bruno).
version: 1.0.0
servers:
- url: http://apicms.ebms.vn
- url: http://map.stis.vn
- url: http://api.thongtingiaothong.vn
components:
securitySchemes:
noauthAuth:
type: http
scheme: noauth
tags:
- name: Static resources
- name: Get Routes
paths:
/businfo/getstopsinbounds/{lower_longtitude}/{lower_latitude}/{upper_longtitude}/{upper_latitude}:
get:
tags:
- Static resources
summary: '[ebms] Get Bus Stops within a Bonding Box'
description: |-
## An example response might looks like this:
```json
[
{
"StopId": 25,
"Code": "Q1 136",
"Name": "Rạp Trần Hưng Đạo",
"StopType": "Nhà chờ",
"Zone": "Quận 1",
"Ward": "Phường Cô Giang",
"AddressNo": "227 - 229 (255)",
"Street": "Trần Hưng Đạo",
"SupportDisability": "",
"Status": "Đang khai thác",
"Lng": 106.692722,
"Lat": 10.76483,
"Search": "RTHD 227-229( THD",
"Routes": "01, 139, 152"
}
]
```
And with header:
```http
server: nginx/1.14.0 (Ubuntu)
date: Wed, 21 May 2025 12:58:16 GMT
content-type: application/json; charset=utf-8
content-length: 4551
connection: keep-alive
cache-control: no-cache
pragma: no-cache
expires: -1
access-control-allow-origin: http://buyttphcm.com.vn
x-aspnet-version: 4.0.30319
x-powered-by: ASP.NET
```
## Fields:
| Field | Type | Desc |
|-------------------|--------|---|
| StopId | Int | |
| Code | String | |
| Name | String | |
| StopType | String | |
| Zone | String | |
| Ward | String | |
| AddressNo | String | |
| Street | String | |
| SupportDisability | String | |
| Status | String | |
| Lng | Float | |
| Lat | Float | |
| Search | String | |
| Routes | String | |
security:
- noauthAuth: []
parameters:
- name: Host
in: header
schema:
type: string
example: apicms.ebms.vn
- name: User-Agent
in: header
schema:
type: string
example: >-
Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101
Firefox/138.0
- name: Accept
in: header
schema:
type: string
example: '*/*'
- name: Accept-Language
in: header
schema:
type: string
example: en-US,en;q=0.5
- name: Accept-Encoding
in: header
schema:
type: string
example: gzip, deflate
- name: Origin
in: header
schema:
type: string
example: http://buyttphcm.com.vn
- name: DNT
in: header
schema:
type: integer
example: '1'
- name: Sec-GPC
in: header
schema:
type: integer
example: '1'
- name: Connection
in: header
schema:
type: string
example: keep-alive
- name: Referer
in: header
schema:
type: string
example: http://apicms.ebms.vn/
- name: Priority
in: header
schema:
type: string
example: u=0
- name: lower_longtitude
in: path
schema:
type: number
required: true
example: '106.68651666641236'
- name: lower_latitude
in: path
schema:
type: number
required: true
example: '10.763876057931437'
- name: upper_longtitude
in: path
schema:
type: number
required: true
example: '106.70655641555786'
- name: upper_latitude
in: path
schema:
type: number
required: true
example: '10.772645263811139'
responses:
'200':
description: Successful response
content:
application/json: {}
/bright/{index_1}/{index_2}/{map_tile}:
get:
tags:
- Static resources
summary: '[stis] Get Map Tile'
description: Returns a PNG Image. Not much is known about the index scheme
security:
- noauthAuth: []
parameters:
- name: Host
in: header
schema:
type: string
example: map.stis.vn
- name: User-Agent
in: header
schema:
type: string
example: >-
Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101
Firefox/138.0
- name: Accept
in: header
schema:
type: string
example: >-
image/avif,image/webp,image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5
- name: Accept-Language
in: header
schema:
type: string
example: en-US,en;q=0.5
- name: Accept-Encoding
in: header
schema:
type: string
example: gzip, deflate
- name: DNT
in: header
schema:
type: integer
example: '1'
- name: Sec-GPC
in: header
schema:
type: integer
example: '1'
- name: Connection
in: header
schema:
type: string
example: keep-alive
- name: Referer
in: header
schema:
type: string
example: http://map.stis.vn/
- name: Priority
in: header
schema:
type: string
example: u=4, i
- name: index_1
in: path
schema:
type: integer
required: true
example: '16'
- name: index_2
in: path
schema:
type: integer
required: true
example: '52189'
- name: map_tile
in: path
schema:
type: string
required: true
example: 30797.png
responses:
'200':
description: Successful response
content:
application/json: {}
/v2/route/foot/106.68900299072266,10.768851280212402;106.689362,10.767676:
get:
tags:
- Get Routes
summary: '[thongtingiaothong] Request foot route based on trafic'
description: >-
Get walking routes persumably based on current traffic situation,
currently only returns 404
security:
- noauthAuth: []
parameters:
- name: Host
in: header
schema:
type: string
example: api.thongtingiaothong.vn
- name: User-Agent
in: header
schema:
type: string
example: >-
Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101
Firefox/138.0
- name: Accept
in: header
schema:
type: string
example: application/json, text/javascript, */*; q=0.01
- name: Accept-Language
in: header
schema:
type: string
example: en-US,en;q=0.5
- name: Accept-Encoding
in: header
schema:
type: string
example: gzip, deflate
- name: Origin
in: header
schema:
type: string
example: http://buyttphcm.com.vn
- name: DNT
in: header
schema:
type: integer
example: '1'
- name: Sec-GPC
in: header
schema:
type: integer
example: '1'
- name: Connection
in: header
schema:
type: string
example: keep-alive
- name: Referer
in: header
schema:
type: string
example: http://api.thongtingiaothong.vn/
- name: steps
in: query
schema:
type: boolean
example: 'false'
- name: geometries
in: query
schema:
type: string
example: polyline
- name: overview
in: query
schema:
type: string
example: full
responses:
'200':
description: Successful response
content:
application/json: {}
/pathfinding/getpathbystop/{start_pos}/{end_pos}/{number_of_stops}:
get:
tags:
- Get Routes
summary: '[ebms] Get Possible Bus Routes'
description: >
The response is a quite lengthy json array of possible bus routes from
point A to B, each item consits of the following:
- A `detail` array consisting of individual legs of the trip (say, "Walk
from A to B, then take bus number 10 from B to C", and walk from C to
D), following this scheme:
| Field | Data type | Desc. |
|-------|-----------|-------|
| ImageUrl | String or null | Image URL of the transportation type (uses back slashes "\" for some reason) |
| RouteNo | String or null | Bus route number |
| EndStop | String or null | Readable Final destination of the route |
| GetIn, GetOff | String | Readable Description of point, either stop name with code or `[Tọa độ điểm...]` |
| GetInLat | Number | Latitude of boarding location |
| GetInLng | Number | Longitude of boarding location |
| GetOffLat | Number | Latitude of alighting location |
| GetOffLng | Number | Longitude of alighting location |
| Halt | Number | ??? |
| Length | String (of number) | Bird's path between 2 points?? |
| Distance | String (of number) | Actual traversal Distance?? |
| Fare | Number | Ticket price (in Vietnamese Dong) |
- A Redundant coodinate of each point of note in the trips (eg. the
affordmentioned A, B, C and D, etc.) called `stops`:
| Field | Data type | Desc. |
|-------|-----------|-------|
| Name | String | Tọa độ điểm xuất phát |
| Lat | Float | Latitude coordinate (10.771464347839355) |
| Lng | Float | Longitude coordinate (106.69524383544922) |
| Type | Integer | Value: `0` == starting location; `1` == bus stops; `-2` == desitnation |
- A array of list of coordinates to plot the bus route, each Item
coressponse to a leg of a bus, in a really cursed format:
| Field | Data type | Desc. |
|-------|-----------|-------|
| `<Route_Number>_<Stop_Name_Start>_<Stop_Name_End>` (tentative name "Key") | JSON Array | Complex name in format |
Each key containing:
| Latitude | Float | Geographic latitude coordinates for points |
| Longitude | Float | Geographic longitude coordinates for points |
- A `Title`
- and a `Desc`
Example:
```json
[
{
"detail": [
{
"ImageUrl": "\\Assets\\Icon\\walk.png",
"RouteNo": null,
"EndStop": null,
"GetIn": "[Tọa độ điểm xuất phát] ",
"GetInLat": 10.771464347839355,
"GetInLng": 106.69524383544922,
"GetOff": "[Q1 187] Khách sạn New World",
"GetOffLat": 10.770964,
"GetOffLng": 106.695946,
"Halt": 0,
"Length": "68",
"Distance": "95",
"Fare": 0
},
{
"ImageUrl": null,
"RouteNo": "03",
"EndStop": "Bến xe buýt Sài Gòn",
"GetIn": "[Q1 187] Khách sạn New World",
"GetInLat": 10.770964,
"GetInLng": 106.695946,
"GetOff": "[BX 01] Bến xe buýt Sài Gòn",
"GetOffLat": 10.767676,
"GetOffLng": 106.689362,
"Halt": 0,
"Length": "163",
"Distance": "897",
"Fare": 6000
},
{
"ImageUrl": "\\Assets\\Icon\\walk.png",
"RouteNo": null,
"EndStop": null,
"GetIn": "[BX 01] Bến xe buýt Sài Gòn",
"GetInLat": 10.767676,
"GetInLng": 106.689362,
"GetOff": "[Tọa độ điểm đến] ",
"GetOffLat": 10.768851280212402,
"GetOffLng": 106.68900299072266,
"Halt": 0,
"Length": "98",
"Distance": "136",
"Fare": 0
}
],
"stops": [
{
"Name": "[Tọa độ điểm xuất phát] ",
"Lat": 10.771464347839355,
"Lng": 106.69524383544922,
"Type": 0
},
{
"Name": "[Q1 187] Khách sạn New World",
"Lat": 10.770964,
"Lng": 106.695946,
"Type": 1
},
{
"Name": "[Q1 188] Nguyễn Thị Nghĩa",
"Lat": 10.769952,
"Lng": 106.693495,
"Type": 1
},
{
"Name": "[Q1 189] Tôn Thất Tùng",
"Lat": 10.768761,
"Lng": 106.690469,
"Type": 1
},
{
"Name": "[BX 01] Bến xe buýt Sài Gòn",
"Lat": 10.767676,
"Lng": 106.689362,
"Type": 1
},
{
"Name": "[Tọa độ điểm đến] ",
"Lat": 10.768851280212402,
"Lng": 106.68900299072266,
"Type": -2
}
],
"coordRoute": {
"03_[Q1 187] Khách sạn New World_[BX 01] Bến xe buýt Sài Gòn": [
{
"Latitude": 10.770964,
"Longitude": 106.695946
},
{
"Latitude": 10.77096367,
"Longitude": 106.69594574
} // the rest were trimmed
]
},
"Title": "Đi tuyến: 03",
"Desc": "Số tuyến cần đi: 1\nĐi bộ: 0.2 km; Xe buýt: 0.9 km"
}
]
```
security:
- noauthAuth: []
parameters:
- name: Host
in: header
schema:
type: string
example: apicms.ebms.vn
- name: User-Agent
in: header
schema:
type: string
example: >-
Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101
Firefox/138.0
- name: Accept
in: header
schema:
type: string
example: application/json, text/javascript, */*; q=0.01
- name: Accept-Language
in: header
schema:
type: string
example: en-US,en;q=0.5
- name: Accept-Encoding
in: header
schema:
type: string
example: gzip, deflate
- name: Origin
in: header
schema:
type: string
example: http://buyttphcm.com.vn
- name: DNT
in: header
schema:
type: integer
example: '1'
- name: Sec-GPC
in: header
schema:
type: integer
example: '1'
- name: Connection
in: header
schema:
type: string
example: keep-alive
- name: Referer
in: header
schema:
type: string
example: http://apicms.ebms.vn/
- name: Priority
in: header
schema:
type: string
example: u=0
- name: start_pos
in: path
schema:
type: string
required: true
example: '{{end_latitude}},{{end_longtitude}}'
- name: end_pos
in: path
schema:
type: string
required: true
example: '{{start_latitude}},{{start_longtitude}}'
- name: number_of_stops
in: path
schema:
type: integer
required: true
example: '2'
responses:
'200':
description: Successful response
content:
application/json: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment