Skip to content

Latest commit

 

History

History
23 lines (15 loc) · 639 Bytes

README.md

File metadata and controls

23 lines (15 loc) · 639 Bytes

URA Token Package

This is a small example to obtain URA API token.

Register for your access key with URA

Example:

import requests
import json

from ura_token import ura_token

u=ura_token.ura_token('<place your ura access key here>')

url="https://www.ura.gov.sg/uraDataService/invokeUraDS?service=Car_Park_Availability"
myobj = {'AccessKey': u.get_accesskey(), 'token': u.get_token(), 'User-Agent': 'Mozilla/5.0'}
resp = requests.post(url, headers=myobj)

print(json.dumps(resp.json()['Result'], indent=4))

Questions or bugs, please write to chengguan.teo@gmail.com.