examples

import ambee_sdk as ambee
import datetime
x_api_key = "Your Key Here"
aq = ambee.air_quality(x_api_key=x_api_key)
aq.x_api_key
aq.get_latest(by='latlng', lat=12, lng=77)
aq.get_latest(by='postcode', postalCode=560020, countryCode="IN")
aq.get_latest(by='city', city="Mysore")
aq.get_latest(by='countrycode', countryCode="IN")
to_val = datetime.datetime.utcnow()
from_val = to_val - datetime.timedelta(days=1)
to_val = to_val.strftime("%Y-%m-%d %H:%M:%S")
to_val
from_val = from_val.strftime("%Y-%m-%d %H:%M:%S")
from_val
aq.get_historical(by='latlng', lat=12, lng=77, from_val=from_val, to_val=to_val)
aq.get_historical(by='postcode', postalCode=560020, countryCode="IN", from_val=from_val, to_val=to_val)
pollen = ambee.pollen(x_api_key=x_api_key)
pollen.get_latest(by='latlng', lat=12, lng=77)
pollen.get_latest(by='place', place='London')
pollen.get_historical(by='latlng', lat=12, lng=77, from_val=from_val, to_val=to_val)
pollen.get_historical(by='place', place='London', from_val=from_val, to_val=to_val)
pollen.get_forecast(by='latlng', lat=12, lng=77)
pollen.get_forecast(by='place', place='London')
weather = ambee.weather(x_api_key=x_api_key)
weather.get_latest(by='latlng', lat=12, lng=77)
weather.get_historical(by='latlng', lat=12, lng=77, from_val=from_val, to_val=to_val)
weather.get_historical(by='latlng', lat=12, lng=77, from_val=from_val, to_val=to_val, daily=True)
weather.get_forecast(by='latlng', lat=12, lng=77)
weather.get_forecast(by='latlng', lat=12, lng=77, daily=True)
weather.get_severe_weather(by='latlng', lat=12, lng=77)
weather.get_severe_weather(by='place', place='London')
weather.get_latest(by='latlng', lat=12, lng=77, units='si')
weather.get_historical(by='latlng', lat=12, lng=77, from_val=from_val, to_val=to_val, units='si')
weather.get_historical(by='latlng', lat=12, lng=77, from_val=from_val, to_val=to_val, daily=True, units='si')
weather.get_forecast(by='latlng', lat=12, lng=77, units='si')
weather.get_forecast(by='latlng', lat=12, lng=77, daily=True, units='si')
weather.get_severe_weather(by='latlng', lat=12, lng=77, units='si')
weather.get_severe_weather(by='place', place='London', units='si')
fire = ambee.fire(x_api_key=x_api_key)
fire.get_latest(by='latlng', lat=12, lng=77)
fire.get_latest(by='place', place='Mysore')
ndvi = ambee.ndvi(x_api_key=x_api_key)
ndvi.get_latest(by='latlng', lat=12, lng=77)