Skip to content

Instantly share code, notes, and snippets.

@rapee
Last active October 24, 2016 07:46
Show Gist options
  • Save rapee/3aaec527a551462cdc33ccff459c0521 to your computer and use it in GitHub Desktop.
Save rapee/3aaec527a551462cdc33ccff459c0521 to your computer and use it in GitHub Desktop.
CityGlide API Hack Manual

CityGlide.com API Hack

1) Get bus route of bus number

POST http://www.cityglide.com/api_json.php

MODE:get_route_poly
bus_lines:16
bound:1

[{"locations_type_id":"2", ... "origin_station":"no"}]

2) Get bus stops of bus number

POST http://www.cityglide.com/api.php

bus_lines:16
bound:1
stop_id:1110
MODE:get_marker

[{"stop_name":", ... ,"origin_station":"no"}]

3) Get bus stops at location

POST http://cityglide.com/api.php

nearest_station:13.731065,100.57014419999996
nearest_station_lat:13.731065
nearest_station_lng:100.57014419999996
keyword_station:โรงแรมนันตรา สุขุมวิท39
MODE:get_marker_all_station

{"943":{"locations_id":"12653","stop_name":"\u0e15", ...,"locations_type_id":"2"}]

4 What is this data?

POST http://www.cityglide.com/api.php

MODE:get_poly
bus_lines:16
bound:1
stop_id:1110

[{"stop_name": ... ,"locations_type_id":"2"}]

5) What is this data?

POST http://cityglide.com/api.php

origin:BTS ทองหล่อ (ทางออก 1)
MODE:get_poly_origin

{"1":{"routes_id":"58","stop_id":"791", "time_arrival":"15:20"}}

6) Get next estimated arrival time of bus number at this stop

POST http://cityglide.com/api_html.php

MODE:get_fast_bus
bus_line:511
bound:2
stop_id:791

[{"stop_name":"222", ..., "priority":111","locations_type_id":"2"}]

7) Get eta bus in one direction

POST http://cityglide.com/api_eta.php

MODE:get_eta
set_feature:feature2
bus_line:511
bound:2
stop_id:791
service_id:189
service_priority:41
service_latlng:13.751643,100.536446
service_route_id:58
Response: text/html
<div id="area-list-eta" class="class-area-list-eta">
        <ul class="area-time-line-eta">
      <li>
                                          <div class="area_render_fast_bus"><div class="box-hr-bus-fast"><div class="bus-ball"><p>ปอ </p><p class="bus-line-text">511</p></div><div class="output-bus-line"><p class="p-fast-bus-left">5.7 กม.</p><p class="p-fast-bus-right"><label>22 นาที</label><br>( 15:21 )</p><div class="cl"></div></div></div></div>
                                  <div class="cl"></div>
      </li>
      ...
    </ul>
    </div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment