How to use your API Key
To authenticate, include your API key in the request header as follows:
Header:
x-api-key: YOUR_API_KEY
Replace YOUR_API_KEY
with the API key you generated from the dashboard.
Curl
curl -X GET "https://api-open.data.gov.sg/v2/public/api/collections" \
-H "x-api-key: YOUR_API_KEY"
Python
import requests
headers = {"x-api-key": "YOUR_API_KEY"}
response = requests.get("https://api-open.data.gov.sg/v2/public/api/collections", headers=headers)
print(response.json())
Keep your API key secure. Do not share your key or expose it in client-side code.
For details on obtaining your API key, see How to request an API key.
Last updated
Was this helpful?