Skip to content

Tips & Tricks

Specifying locations

When specifying locations using latitude & longitude coordinates, there is no need to specify more than two decimal places.

Calling multiple locations

If you need weather data for multiple locations, it will be much quicker to make a single API call rather than iterate through each location one by one. In order to specify coordinates for thousands of locations, it's easier to do it with POST operation. To keep track of the data for each location, a location_id parameter can be provided.

Note the slight difference in the way data is specified for the POST operation as shown below:

import requests

api_key = 'your-api-key'

r = requests.post('https://api.oikolab.com/weather',
                 data={'param': ['temperature', 'wind_speed'],
                       'lat': [ ... ],
                       'lon': [ ... ]',
                       'location_id': [ ... ]',
                       }
                 headers={'api-key': api_key}
                 )

Notes on Precipitation

Weather forecasting would be much simpler if we didn't have to deal with water. From clouds to hails and deluge, hydrodynamics of water in the atmosphere is an incredibly complex phenomenon which is not easily captured by reanalysis or even observation data. For application where this is critical, we recommend considering CHIRPS rain dataset.