Curl
Python Requests
Zingu Apis
Javascript Fetch
curl 'https://api.weather.gov/zones/forecast/NYZ072/observations?start=2024-01-01T00%3A00%3A00Z&end=2024-01-07T23%3A59%3A59Z&limit=50' \
-H 'User-Agent: RobustAPI-Example/1.0'
import requests
resp = requests.get(
"https://api.weather.gov/zones/forecast/NYZ072/observations",
params={
'start': '2024-01-01T00:00:00Z',
'end': '2024-01-07T23:59:59Z',
'limit': 50,
},
headers={
'User-Agent': 'RobustAPI-Example/1.0',
},
)
data = resp.json()
import zingu_apis
api = zingu_apis.api("weather")
result = api.fetch("zones/forecast/{zoneId}/observations", start="2024-01-01T00:00:00Z", end="2024-01-07T23:59:59Z", limit=50)
for item in result:
print(item)
const resp = await fetch("https://api.weather.gov/zones/forecast/NYZ072/observations?start=2024-01-01T00%3A00%3A00Z&end=2024-01-07T23%3A59%3A59Z&limit=50", {
headers: {
"User-Agent": "RobustAPI-Example/1.0",
},
});
const data = await resp.json();