API Status:
Online
Trend :
CCTV = Close Circuit Television
Notice :
ให้ข้อมูลภาพจาก กล้อง CCTV มีข้อมูลตำแหน่ง รูปภาพ และวัน เดือน ปี ที่บันทึกภาพ
Source :
กรมทางหลวง, การทางพิเศษแห่งประเทศไทย, กรุงเทพมหานคร, โครงการ Traffy Social Eyes
URL:
http://api.traffy.in.th/apis/apitraffy.php?format=…&api=…&available=…&key=…&appid=.. .
Formats:
HTTP Method:
GET
Requires Authentication :
true
API rate limited :
ไม่จำกัด
Parameters :
*format = รูป แบบของการแสดงผล (XML, JSON, CSV, JS, TABLE)
Example: http://api.traffy.in.th/apis/apitraffy.php?format=XML
*api = ประเภทของ api ที่ต้องการ (getCCTV)
Example: http://api.traffy.in.th/apis/apitraffy.php?format=XML&api=getCCTV
available = เลือกข้อมูลที่ต้องการแสดงผล (available=t ข้อมูลที่อัพเดต , available=f ข้อมูลที่ไม่อัพเดต)
Example:http://api.traffy.in.th/apis/apitraffy.php?format=XML&api=getCCTV&available=t
http://api.traffy.in.th/apis/apitraffy.php?format=XML&api=getCCTV&available=f
*key = รหัสที่ได้รับจากการลงทะเบียน (ลงทะเบียน)
Example: http://api.traffy.in.th/apis/apitraffy.php?format=XML&api=getCCTV&key=(คีย์ ที่ได้รับจากการลงทะเบียน)
*appid = id ที่ได้รับจากการลงทะเบียน (ลงทะเบียน)
Example:http://api.traffy.in.th/apis/apitraffy.php?format=XML&api=getCCTV&key=(คีย์ที่ได้รับจากการลงทะเบียน)&appid=(id ที่ได้รับจากการลงทะเบียน)
Required *
ตัวอย่างการเรียกใช้ getCCTV API :
Response :
XML format:
<info>
<cctv no=”ID” name=”English name” name_th=”Thai name”>
<point lat=”Latitude point” lng=”Longtitude point”/>
<available>Update Status</available>
<url>Iimage</url>
<lastupdate>last update time</lastupdate>
<src>Source</src>
<desc>Description</desc>
<list>Image list</list>
</cctv>
</info>
XML example:
<info>
<cctv no=”61″ name=”Dindaeng Expressway” name_th=”ทางด่วนดินแดง”>
<point lat=”13.7606″ lng=”100.5458″/>
<available>t</available>
<url>
http://api.traffy.in.th/apis/services/weerapat/imagecctv.php?id=61&num=0&appid=(id ที่ได้รับ จากการลงทะเบียน)&key=
(คีย์ที่ได้รับ จากการลงทะเบียน)
</url>
<lastupdate>2010-06-17 09:21:00</lastupdate>
<src>nectec</src>
<desc>
ToVipavadi 75.43 km/h, 11 cars,ToSukhumwit 107.51 km/h, 5 cars
</desc>
<list>
http://api.traffy.in.th/apis/services/weerapat/imagecctv.php?id=61&num=0&appid=(id ที่ได้รับ จากการลงทะเบียน)&key=
(คีย์ที่ได้รับ จากการลงทะเบียน),
http://api.traffy.in.th/apis/services/weerapat/imagecctv.php?id=61&num=1&appid=(id ที่ได้รับ จากการลงทะเบียน)&key=
(คีย์ที่ได้รับ จากการลงทะเบียน),
http://api.traffy.in.th/apis/services/weerapat/imagecctv.php?id=61&num=2&appid=(id ที่ได้รับ จากการลงทะเบียน)&key=
(คีย์ที่ได้รับ จากการลงทะเบียน),
http://api.traffy.in.th/apis/services/weerapat/imagecctv.php?id=61&num=3&appid=(id ที่ได้รับ จากการลงทะเบียน)&key=
(คีย์ที่ได้รับ จากการลงทะเบียน),
http://api.traffy.in.th/apis/services/weerapat/imagecctv.php?id=61&num=4&appid=(id ที่ได้รับ จากการลงทะเบียน)&key=
(คีย์ที่ได้รับ จากการลงทะเบียน)
</list>
</cctv>
</info>
JSON example:
[{159:{“name”:”Anusornsatan Exit”,
“name_th”:” ทางออกอนุสรณ์สถาน”,
“point”:{“lat”:13.94065,”lng”:100.612943},
“available”:”t”,
“lastupdate”:”2010-05-10 10:24:52″,
“url”:”http://www.traffy.in.th/cam/TOLLWAY01/2010/05/10/TOLLWAY01_2010-05-10_10-24-52.jpeg”,
“src”:”nectec”,
“desc”:””,
“list”:”http://www.traffy.in.th/cam/TOLLWAY01/2010/05/10/TOLLWAY01_2010-05-10_09-59-53.jpeg,
http://www.traffy.in.th/cam/TOLLWAY01/2010/05/10/TOLLWAY01_2010-05-10_10-04-55.jpeg,
http://www.traffy.in.th/cam/TOLLWAY01/2010/05/10/TOLLWAY01_2010-05-10_10-09-51.jpeg,
http://www.traffy.in.th/cam/TOLLWAY01/2010/05/10/TOLLWAY01_2010-05-10_10-19-51.jpeg,
http://www.traffy.in.th/cam/TOLLWAY01/2010/05/10/TOLLWAY01_2010-05-10_10-24-52.jpeg”}}]
CSV format:
ID, English name, Thai name, Latitude point, Longitude point, Update Status, last update time, Image, Source, Camlist
CSV example:
159,Anusornsatan Exit,ทางออกอนุสรณ์สถาน,13.94065,100.612943,t,2010-05-10 10:29:53,
http://www.traffy.in.th/cam/TOLLWAY01/2010/05/10/TOLLWAY01_2010-05-10_10-29-53.jpeg,nectec,,
http://www.traffy.in.th/cam/TOLLWAY01/2010/05/10/TOLLWAY01_2010-05-10_10-04-55.jpeg,
http://www.traffy.in.th/cam/TOLLWAY01/2010/05/10/TOLLWAY01_2010-05-10_10-09-51.jpeg,
http://www.traffy.in.th/cam/TOLLWAY01/2010/05/10/TOLLWAY01_2010-05-10_10-19-51.jpeg,
http://www.traffy.in.th/cam/TOLLWAY01/2010/05/10/TOLLWAY01_2010-05-10_10-24-52.jpeg,
http://www.traffy.in.th/cam/TOLLWAY01/2010/05/10/TOLLWAY01_2010-05-10_10-29-53.jpeg
JS format:
Function name (
{ID:{“name”:” English name “,
“name_th”:” Thai name “,
“point”:{“lat”: Latitude point,”lng”: Longitude point },
“available”:” Update Status”,
“lastupdate”:” last update time “,
“url”:” Image “,
“src”:” Source”,
“desc”:””,
“list”: “Camlist” }});
JS example (function name = ABC) :
ABC(
{159:{“name”:”Anusornsatan Exit”,
“name_th”:”ทางออกอนุสรณ์สถาน”,
“point”:{“lat”:13.94065,”lng”:100.612943},
“available”:”t”,
“lastupdate”:”2010-05-10 10:29:53″,
“url”:”http://www.traffy.in.th/cam/TOLLWAY01/2010/05/10/TOLLWAY01_2010-05-10_10-29-53.jpeg”,
“src”:”nectec”,
“desc”:””,
“list”:”http://www.traffy.in.th/cam/TOLLWAY01/2010/05/10/TOLLWAY01_2010-05-10_10-04-55.jpeg,
http://www.traffy.in.th/cam/TOLLWAY01/2010/05/10/TOLLWAY01_2010-05-10_10-09-51.jpeg,
http://www.traffy.in.th/cam/TOLLWAY01/2010/05/10/TOLLWAY01_2010-05-10_10-19-51.jpeg,
http://www.traffy.in.th/cam/TOLLWAY01/2010/05/10/TOLLWAY01_2010-05-10_10-24-52.jpeg,
http://www.traffy.in.th/cam/TOLLWAY01/2010/05/10/TOLLWAY01_2010-05-10_10-29-53.jpeg”}});