Connecting to OpenWeatherMap
Using API Key Authentication
To obtain an API key, sign up for a free account at https://openweathermap.org/api and navigate to the API keys section of your dashboard. Copy your API key for use in the connection configuration.
After setting the following connection properties, you are ready to connect:
- AuthScheme: Set this to APIKey.
- APIKey: Set this to your OpenWeatherMap API key.
Available Tables
The OpenWeatherMap API Profile provides access to comprehensive weather and environmental data across 25 specialized tables:
- AccumulatedPrecipitation - Retrieve accumulated precipitation measurements over time periods with rainfall totals and measurement counts.
- AccumulatedTemperature - Access accumulated temperature data with temperature accumulation measurements over specified time periods.
- AIWeatherAssistant - Access AI-powered weather assistant with natural language query processing and intelligent weather recommendations.
- AirPollutionCurrent - Query current air quality data with pollution levels, air quality index and concentration measurements for various pollutants.
- AirPollutionForecast - Access air pollution forecasts with predicted air quality levels and pollutant concentration data.
- AirPollutionHistory - Retrieve historical air pollution data with time-series air quality measurements and pollution trend analysis.
- ClimaticForecast30Days - Access long-term climatic weather forecasts for up to 30 days with temperature trends and seasonal weather patterns.
- CurrentAndForecastWeatherData - Query current weather combined with hourly and daily forecasts using OpenWeatherMap's comprehensive One Call API 3.0.
- CurrentFireWeatherIndex - Access current fire weather index data with danger ratings, fire risk assessments and weather-based fire hazard indicators.
- CurrentWeatherData - Access current weather conditions with temperature, pressure, humidity, wind speed and weather descriptions for any location.
- DailyAggregation - Query daily aggregated weather summary data using One Call API day summary with consolidated weather information.
- DailyForecast16Days - Query extended daily weather forecasts for up to 16 days with temperature ranges, weather conditions and precipitation data.
- FiveDayThreeHourForecast - Access 5-day weather forecasts with 3-hour interval data including temperature, pressure, humidity and precipitation.
- ForcastFireWeatherIndex - Query fire weather index forecasts with predicted fire danger levels and weather-related wildfire risk assessments.
- Geocoding - Query reverse geocoding services to convert geographic coordinates to location names with place name resolution.
- History - Query comprehensive historical weather data for specified location and time period with time-series weather information.
- HourlyForecast4Days - Retrieve detailed hourly weather forecasts for 4 days with temperature, precipitation, wind and weather condition data.
- Locations - Access location management data for solar energy applications with coordinate information and location-specific metadata.
- RoadRisk - Retrieve current road weather risk conditions with safety alerts, hazardous weather warnings and transportation impact data.
- SolarIrradiance - Access current solar irradiance measurements with clear sky and cloudy sky conditions for solar energy applications.
- SolarPanelPowerOutput - Retrieve solar panel energy production predictions with power output calculations and irradiance measurements.
- SolarPanels - Query solar panel configuration data including panel specifications, tilt angles, azimuth settings and power capacity information.
- StatisticalWeatherData - Access statistical weather analysis with aggregations by year, month, or day including temperature, precipitation and climate statistics.
- WeatherDataForTimestamp - Retrieve historical weather data for specific timestamps with temperature, pressure, humidity and weather conditions using One Call API timemachine.
- WeatherOverview - Retrieve weather overview data with summary descriptions and human-readable weather information using One Call API overview.
Connection String Example
To connect to OpenWeatherMap using the CData API Driver:
Profile=C:\path\to\OpenWeatherMap.apip;AuthScheme=APIKey;ProfileSettings="APIKey=your_openweathermap_api_key";
Usage Examples
AccumulatedPrecipitation:
SELECT * FROM AccumulatedPrecipitation WHERE Latitude = 40.7128 AND Longitude = -74.0060 AND Start = '2024-01-01' AND End = '2024-01-31'
AccumulatedTemperature:
SELECT * FROM AccumulatedTemperature WHERE Latitude = 40.7128 AND Longitude = -74.0060 AND Start = '2024-01-01' AND End = '2024-01-31'
AIWeatherAssistant:
SELECT * FROM AIWeatherAssistant WHERE Prompt = 'What should I wear today in New York City?'
AirPollutionCurrent:
SELECT * FROM AirPollutionCurrent WHERE Latitude = 40.7128 AND Longitude = -74.0060
AirPollutionForecast:
SELECT * FROM AirPollutionForecast WHERE Latitude = 40.7128 AND Longitude = -74.0060
AirPollutionHistory:
SELECT * FROM AirPollutionHistory WHERE Latitude = 40.7128 AND Longitude = -74.0060 AND Start = '2024-01-01' AND End = '2024-01-31'
ClimaticForecast30Days:
SELECT * FROM ClimaticForecast30Days WHERE Latitude = 40.7128 AND Longitude = -74.0060
CurrentAndForecastWeatherData:
SELECT * FROM CurrentAndForecastWeatherData WHERE Latitude = 40.7128 AND Longitude = -74.0060
CurrentFireWeatherIndex:
SELECT * FROM CurrentFireWeatherIndex WHERE Latitude = 40.7128 AND Longitude = -74.0060
CurrentWeatherData:
SELECT * FROM CurrentWeatherData WHERE Latitude = 40.7128 AND Longitude = -74.0060
DailyAggregation:
SELECT * FROM DailyAggregation WHERE Latitude = 40.7128 AND Longitude = -74.0060 AND Date = '2024-01-15'
DailyForecast16Days:
SELECT * FROM DailyForecast16Days WHERE Latitude = 40.7128 AND Longitude = -74.0060
FiveDayThreeHourForecast:
SELECT * FROM FiveDayThreeHourForecast WHERE Latitude = 40.7128 AND Longitude = -74.0060
ForcastFireWeatherIndex:
SELECT * FROM ForcastFireWeatherIndex WHERE Latitude = 40.7128 AND Longitude = -74.0060
Geocoding:
SELECT * FROM Geocoding WHERE Latitude = 40.7128 AND Longitude = -74.0060
History:
SELECT * FROM History WHERE Latitude = 40.7128 AND Longitude = -74.0060 AND Type = 'hour'
HourlyForecast4Days:
SELECT * FROM HourlyForecast4Days WHERE Latitude = 40.7128 AND Longitude = -74.0060
Locations:
SELECT * FROM Locations
RoadRisk:
SELECT * FROM RoadRisk WHERE Latitude = 40.7128 AND Longitude = -74.0060 AND Datetime = '2024-01-15 12:00:00'
SolarIrradiance:
SELECT * FROM SolarIrradiance WHERE Latitude = 40.7128 AND Longitude = -74.0060
SolarPanelPowerOutput:
SELECT * FROM SolarPanelPowerOutput WHERE LocationId = 'F01E165B-22F3-4591-89D4-F238E92F6885' AND Date = '2024-01-15'
SolarPanels:
SELECT * FROM SolarPanels WHERE LocationId = 'F01E165B-22F3-4591-89D4-F238E92F6885'
StatisticalWeatherData:
SELECT * FROM StatisticalWeatherData WHERE Latitude = 40.7128 AND Longitude = -74.0060 AND AggregationType = 'year'
sys_indexes:
SELECT * FROM sys_indexes
WeatherDataForTimestamp:
SELECT * FROM WeatherDataForTimestamp WHERE Latitude = 40.7128 AND Longitude = -74.0060 AND Datetime = '2024-01-15 12:00:00'
WeatherOverview:
SELECT * FROM WeatherOverview WHERE Latitude = 40.7128 AND Longitude = -74.0060 AND Date = '2024-01-15'
Connection Properties
The connection string properties are the various options that can be used to establish a connection. This section provides a complete list of the options you can configure in the connection string for this provider.
| Property | Description |
| APIKey | Your OpenWeatherMap API key for authentication. |
| AuthScheme | The scheme used for authentication. Accepted entries are APIKey or None. Allowed values are: BASIC, NONE, NTLM, OAUTH, APIKEY, OAUTH_CLIENT |