Skip to content

Instantly share code, notes, and snippets.

@alext234
Created September 26, 2019 05:14
Show Gist options
  • Save alext234/465e615db9163cb99b332ba7501fb3ad to your computer and use it in GitHub Desktop.
Save alext234/465e615db9163cb99b332ba7501fb3ad to your computer and use it in GitHub Desktop.
Singapore NEA PSI API
import requests
from datetime import date
from datetime import timedelta
day = date.today()-timedelta(days=0)
dayStr = day.strftime("%Y-%m-%d")
rPsi = requests.get("https://api.data.gov.sg/v1/environment/psi?date=" + dayStr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment