+++++ตัวอย่างโค้ดเรียกดูข้อมูลของกรมอุตุฯ (เป็น node.js กับ python)++++
ช่วงนี้ไทยอาจเจอมรสุมเข้ามาในช่วง 4-6 ส.ค เราก็ควรติดตามข้อมูลจากกรมอุตุฯ อย่างใกล้ชิดนะครับ ทั้งนี้กรมอุตุฯ เขาเปิดบริการ API มานานพอควร เราสามารถเรียกดูข้อมูลอุตุนิยมวิทยา + ข้อมูลแผ่นดินไหว ได้อย่างง่ายๆ ซึ่งมีอยู่ 11 API ให้เลือกใช้ ตามลิงค์ http://data.tmd.go.th/api/index1.php
แต่ก่อนใช้งานต้องสมัครเว็บข้างบน เพื่อขอ user id กับ user key เสียก่อน แล้วก็จะมีเมลมาให้เรายืนยันอีกที
อันนี้เป็นรูปแบบ url เวลาเรียกดูข้อมูล "ข่าวเตือนภัยสภาพอากาศ ข่าวสารภูมิอากาศ ข่าวการติดตามสภาพอากาศร้าย"
http://data.tmd.go.th/api/WeatherWarningNews/v1/…
ตรงคำว่า demo กับ demokey ก็ให้ใส่ user id กับ user key ที่เราได้มา
ทั้งนี้โดยดีฟอลต์เมื่อส่ง request นี้ไป ก็จะได้ response กลับมาเป็น XML
ถ้าอยากได้ Response แบบ json ก็ให้ใส่ &format=json ต่อท้าย url เดิมประมาณเนี่ย
http://data.tmd.go.th/api/WeatherWarningNews/v1/…
สำหรับตัวอย่างซอร์สโค้ดเขียนโปรแกรม เอาไว้เรียกดูข้อมูล API ของกรมอุตุฯ ผมทำให้ดู 2 ภาษาเป็น Node.js กับ Python
https://gist.github.com/ad…/fbbc2fdeddb43dca3a33eade0d8555c0
สำหรับคู่มือ API อย่างละเอียด ก็ตามลิงค์นี้นะครับ
http://data.tmd.go.th/api/doc/reference/WeatherToday.pdf
同時也有10000部Youtube影片,追蹤數超過2,910的網紅コバにゃんチャンネル,也在其Youtube影片中提到,...
「python response json」的推薦目錄:
- 關於python response json 在 โปรแกรมเมอร์ไทย Thai programmer Facebook 的最讚貼文
- 關於python response json 在 コバにゃんチャンネル Youtube 的最佳解答
- 關於python response json 在 大象中醫 Youtube 的最佳貼文
- 關於python response json 在 大象中醫 Youtube 的最佳貼文
- 關於python response json 在 What's the best way to parse a JSON response from the ... 的評價
- 關於python response json 在 response.json() raises inconsistent exception type #5794 的評價
- 關於python response json 在 Python Requests | JSON - YouTube 的評價
python response json 在 コバにゃんチャンネル Youtube 的最佳解答
python response json 在 大象中醫 Youtube 的最佳貼文
python response json 在 大象中醫 Youtube 的最佳貼文
python response json 在 response.json() raises inconsistent exception type #5794 的推薦與評價
:raises json.JSONDecodeError: If the response body does not contain valid json and simplejson is not installed on Python 3. ... <看更多>
python response json 在 Python Requests | JSON - YouTube 的推薦與評價
The Requests library has a built in JSON decoder that can be used to parse JSON content into Python ... ... <看更多>
python response json 在 What's the best way to parse a JSON response from the ... 的推薦與評價
... <看更多>
相關內容