Unit groups and units of measurement

The Weather API includes a unitGroup parameter that controls the units of measurement used in the response. This article lists the units used for each supported unit group.

The four supported unit group IDs are:

  • us – United States customary units
  • metric – Metric units
  • uk – United Kingdom mixed units
  • base – Base or scientific units

If you do not specify unitGroup, the API defaults to us.

For example, the following request returns temperatures in degrees Celsius, precipitation in millimeters, and wind speeds in kilometers per hour:

https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/London,UK?unitGroup=metric&key=YOUR_API_KEY

The unitGroup value is case-sensitive and must be one of the four IDs listed above. An unsupported value returns an error.

us – United States units

Weather variableUnit of measurement
Temperature, dew point, heat index, wind chill, and feels-like temperatureDegrees Fahrenheit (°F)
PrecipitationInches
Precipitation rateInches per hour
Snow and snow depthInches
Wind speed and wind gustMiles per hour
VisibilityMiles
Atmospheric pressureHectopascals (hPa), numerically equivalent to millibars
Wave and swell heightFeet
Hail sizeInches
Solar radiationWatts per square meter (W/m²)
Solar energyMegajoules per square meter (MJ/m²)

metric – Metric units

Weather variableUnit of measurement
Temperature, dew point, heat index, wind chill, and feels-like temperatureDegrees Celsius (°C)
PrecipitationMillimeters
Precipitation rateMillimeters per hour
Snow and snow depthCentimeters
Wind speed and wind gustKilometers per hour
VisibilityKilometers
Atmospheric pressureHectopascals (hPa), numerically equivalent to millibars
Wave and swell heightMeters
Hail sizeMillimeters
Solar radiationWatts per square meter (W/m²)
Solar energyMegajoules per square meter (MJ/m²)

uk – United Kingdom units

The uk unit group combines metric and imperial units commonly used in the United Kingdom. Temperatures and precipitation use metric units, while wind speed and visibility use miles.

Weather variableUnit of measurement
Temperature, dew point, heat index, wind chill, and feels-like temperatureDegrees Celsius (°C)
PrecipitationMillimeters
Precipitation rateMillimeters per hour
Snow and snow depthCentimeters
Wind speed and wind gustMiles per hour
VisibilityMiles
Atmospheric pressureHectopascals (hPa), numerically equivalent to millibars
Wave and swell heightMeters
Hail sizeInches
Solar radiationWatts per square meter (W/m²)
Solar energyMegajoules per square meter (MJ/m²)

base – Base or scientific units

Weather variableUnit of measurement
Temperature, dew point, heat index, wind chill, and feels-like temperatureKelvin (K)
PrecipitationMillimeters
Precipitation rateMillimeters per hour
Snow and snow depthCentimeters
Wind speed and wind gustMeters per second
VisibilityKilometers
Atmospheric pressureHectopascals (hPa), numerically equivalent to millibars
Wave and swell heightMeters
Hail sizeMillimeters
Solar radiationWatts per square meter (W/m²)
Solar energyMegajoules per square meter (MJ/m²)

Values that do not change with the unit group

Some Weather API values are dimensionless or always use the same unit. These values are not affected by the unitGroup parameter.

Weather variableUnit or scale
Relative humidityPercent (%)
Cloud coverPercent (%)
Precipitation probabilityPercent (%)
Precipitation coveragePercent (%)
Wind, wave, and swell directionDegrees from north (0–360°)
UV indexIndex value
Solar radiationWatts per square meter (W/m²)
Solar energyMegajoules per square meter (MJ/m²)
Air-quality pollutant concentrationsMicrograms per cubic meter (µg/m³)
US and European air-quality indexesIndex value
Moon phaseFraction from 0 to 1
Severe-weather riskIndex value

The unit group changes the units in which values are returned; it does not change the underlying weather data, location, date range, or response structure.