The following table lists values included in the response body of a
currentConditions request. Values in bold blue have changed from METRIC to
IMPERIAL units:
Weather API feature
METRIC (default)
IMPERIAL
Current Time
2025-03-06T11:08:49.126979608Z
3/6/2025, 6:08:49 AM
Time Zone
America/New_York
America/New_York
Is Daytime
FALSE
FALSE
Weather Description
Mostly cloudy
Mostly cloudy
Temperature
11.5 °C
52.7 °F
Feels Like
9.9 °C
49.7 °F
Dew Point
8.7 °C
47.6 °F
Heat Index
11.5 °C
52.7 °F
Wind Chill
9.9 °C
49.7 °F
Relative Humidity
83 %
83 %
UV Index
0
0
Precipitation Probability
9 %
9 %
Precipitation
0 mm
0 in
Thunderstorm Probability
0
0
Air Pressure
991.47 mb
991.47 mb
Wind Direction
275 °
275 °
Wind Direction (Cardinal)
WEST
WEST
Wind Speed
14 km/h
9 mph
Wind Gust
27 km/h
17 mph
Visibility
10 km
6 mi
Cloud Cover
65 %
65 %
Temperature Change
1.4 °C
2.6 °F
Max Temperature
13.2 °C
55.8 °F
Min Temperature
10.1 °C
50.1 °F
QPF
27.5564 mm
1.0849 in
Units systems in the world
Unit systems by country
Most countries outside of the United States use the METRIC system, while the
United States uses the IMPERIAL system. Some countries, such as the United
Kingdom and Canada, use a hybrid of both systems. For a map and full list of
countries that use the metric system, see
Metrication.
Convert units from Weather API response
Convert units manually
You can convert units manually using the following script:
functionconvert(conversionType,value){if(value===null||value===undefined||typeofvalue!=='number'){return"Invalid input";// Handle null, undefined, or non-numeric input}switch(conversionType){case'C_to_F':// Celsius to FahrenheitletconvertedCtoF=(value*9/5)+32;returnconvertedCtoF.toFixed(2)+" °F";case'mm_to_in':// Millimeters to InchesletconvertedMmToIn=value*0.0393701;returnconvertedMmToIn.toFixed(2)+" in";case'km_to_mi':// Kilometers to MilesletconvertedKmToMi=value*0.621371;returnconvertedKmToMi.toFixed(2)+" mi";case'km/h_to_mph':// Kilometers per hour to Miles per hourletconvertedKmHToMph=value*0.621371;returnconvertedKmHToMph.toFixed(2)+" mph";case'millibar_to_psi':// Millibar to PSIletconvertedMillibarToPsi=value*0.0145038;returnconvertedMillibarToPsi.toFixed(2)+" psi";default:return"Invalid conversion type";}}console.log(convert('C_to_F',10));// Output: 50.00 °Fconsole.log(convert('mm_to_in',25));// Output: 0.98 inconsole.log(convert('invalid_type',5));// Output: Invalid conversion type
Convert units using a library
You can also use a library such as
convert-units to convert units:
// moduleimportconvertfrom'convert-units';// or script inclusion// <script src="https://unpkg.com/convert@5.8.0/dist/index.js" ></script> // let convert = convert.convertfunctionconvertWithLibrary(conversionType,value){if(value===null||value===undefined||typeofvalue!=='number'){return"Invalid input";}try{switch(conversionType){case'C_to_F':letconvertedCtoF=convert(value,'C').to('F');returnconvertedCtoF.toFixed(2)+" °F";case'mm_to_in':letconvertedMmToIn=convert(value,'mm').to('in');returnconvertedMmToIn.toFixed(2)+" in";case'km_to_mi':letconvertedKmToMi=convert(value,'km').to('mi');returnconvertedKmToMi.toFixed(2)+" mi";case'km/h_to_mph':// km/h is not directly supported, so we convert km to mi// then assume it's per hourletconvertedKmToMiValue=convert(value,'km').to('mi');returnconvertedKmToMiValue.toFixed(2)+" mph";case'millibar_to_psi':// millibar is not directly supported, so convert millibar to bar, then bar to psiletbarValue=value/1000;letconvertedMillibarToPsi=convert(barValue,'bar').to('psi');returnconvertedMillibarToPsi.toFixed(2)+" psi";default:return"Invalid conversion type";}}catch(error){console.error("Conversion error:",error);return"Conversion failed";}}console.log(convertWithLibrary('C_to_F',10));// Output: 50.00 °Fconsole.log(convertWithLibrary('mm_to_in',25));// Output: 0.98 inconsole.log(convertWithLibrary('invalid_type',5));// Output: Invalid conversion type
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-18 UTC."],[],[],null,["# Weather API unit systems\n\nYou can choose from `METRIC` or `IMPERIAL` for all Weather API endpoints.\n\nTo request a unit system, set `units_system` to `METRIC` or `IMPERIAL`. No\n`units_system` specified will default to `METRIC`. \n\n```html\nhttps://weather.googleapis.com/v1/currentConditions:lookup?key=YOUR_API_KEY&location.latitude=LATITUDE&location.longitude=LONGITUDE&units_system=IMPERIAL\n```\n\nWeather API values changed from METRIC to IMPERIAL units\n--------------------------------------------------------\n\nThe following table lists the Weather API response values that can be\nconverted between unit systems.\n\n| **Unit Conversion (Metric to Imperial)** | **Weather API Values** |\n|--------------------------------------------|----------------------------------------------------------------------|\n| Celsius (°C) to Fahrenheit (°F) | Temperature, Feels Like, Dew Point, Heat Index, Wind Chill, Wet Bulb |\n| Millimeters (mm) to Inches (in) | Precipitation, QPF, Ice Thickness |\n| Kilometers/hour (km/h) to Miles/hour (mph) | Wind Speed, Wind Gust |\n| Kilometers (km) to Miles (mi) | Visibility |\n\n| **Note:** Air Pressure (mb) is not converted to PSI.\n\nExample for currentConditions response\n--------------------------------------\n\nThe following table lists values included in the response body of a\n`currentConditions` request. Values in bold blue have changed from `METRIC` to\n`IMPERIAL` units:\n\n| **Weather API feature** | **METRIC (default)** | **IMPERIAL** |\n|---------------------------|--------------------------------|----------------------|\n| Current Time | 2025-03-06T11:08:49.126979608Z | 3/6/2025, 6:08:49 AM |\n| Time Zone | America/New_York | America/New_York |\n| Is Daytime | FALSE | FALSE |\n| Weather Description | Mostly cloudy | Mostly cloudy |\n| Temperature | 11.5 °C | **52.7 °F** |\n| Feels Like | 9.9 °C | **49.7 °F** |\n| Dew Point | 8.7 °C | **47.6 °F** |\n| Heat Index | 11.5 °C | **52.7 °F** |\n| Wind Chill | 9.9 °C | **49.7 °F** |\n| Relative Humidity | 83 % | 83 % |\n| UV Index | 0 | 0 |\n| Precipitation Probability | 9 % | 9 % |\n| Precipitation | 0 mm | **0 in** |\n| Thunderstorm Probability | 0 | 0 |\n| Air Pressure | 991.47 mb | 991.47 mb |\n| Wind Direction | 275 ° | 275 ° |\n| Wind Direction (Cardinal) | WEST | WEST |\n| Wind Speed | 14 km/h | **9 mph** |\n| Wind Gust | 27 km/h | **17 mph** |\n| Visibility | 10 km | **6 mi** |\n| Cloud Cover | 65 % | 65 % |\n| Temperature Change | 1.4 °C | **2.6 °F** |\n| Max Temperature | 13.2 °C | **55.8 °F** |\n| Min Temperature | 10.1 °C | **50.1 °F** |\n| QPF | 27.5564 mm | **1.0849 in** |\n\nUnits systems in the world\n--------------------------\n\n### Unit systems by country\n\nMost countries outside of the United States use the `METRIC` system, while the\nUnited States uses the `IMPERIAL` system. Some countries, such as the United\nKingdom and Canada, use a hybrid of both systems. For a map and full list of\ncountries that use the metric system, see\n[Metrication](https://en.wikipedia.org/wiki/Metrication).\n\nConvert units from Weather API response\n---------------------------------------\n\n### Convert units manually\n\nYou can convert units manually using the following script: \n\n```json\nfunction convert(conversionType, value) {\n if (value === null || value === undefined || typeof value !== 'number') {\n return \"Invalid input\"; // Handle null, undefined, or non-numeric input\n }\n\n switch (conversionType) {\n case 'C_to_F': // Celsius to Fahrenheit\n let convertedCtoF = (value * 9 / 5) + 32;\n return convertedCtoF.toFixed(2) + \" °F\";\n case 'mm_to_in': // Millimeters to Inches\n let convertedMmToIn = value * 0.0393701;\n return convertedMmToIn.toFixed(2) + \" in\";\n case 'km_to_mi': // Kilometers to Miles\n let convertedKmToMi = value * 0.621371;\n return convertedKmToMi.toFixed(2) + \" mi\";\n case 'km/h_to_mph': // Kilometers per hour to Miles per hour\n let convertedKmHToMph = value * 0.621371;\n return convertedKmHToMph.toFixed(2) + \" mph\";\n case 'millibar_to_psi': // Millibar to PSI\n let convertedMillibarToPsi = value * 0.0145038;\n return convertedMillibarToPsi.toFixed(2) + \" psi\";\n default:\n return \"Invalid conversion type\";\n }\n}\n\nconsole.log(convert('C_to_F', 10)); // Output: 50.00 °F\nconsole.log(convert('mm_to_in', 25)); // Output: 0.98 in\nconsole.log(convert('invalid_type', 5)); // Output: Invalid conversion type\n```\n\n### Convert units using a library\n\nYou can also use a library such as\n[convert-units](https://www.npmjs.com/package/convert-units) to convert units: \n\n\n // module\n\n import convert from 'convert-units';\n\n // or script inclusion\n // \u003cscript src=\"https://unpkg.com/convert@5.8.0/dist/index.js\" \u003e\u003c/script\u003e \n // let convert = convert.convert\n\n function convertWithLibrary(conversionType, value) {\n if (value === null || value === undefined || typeof value !== 'number') {\n return \"Invalid input\";\n }\n\n try {\n switch (conversionType) {\n case 'C_to_F':\n let convertedCtoF = convert(value, 'C').to('F');\n return convertedCtoF.toFixed(2) + \" °F\";\n case 'mm_to_in':\n let convertedMmToIn = convert(value, 'mm').to('in');\n return convertedMmToIn.toFixed(2) + \" in\";\n case 'km_to_mi':\n let convertedKmToMi = convert(value, 'km').to('mi');\n return convertedKmToMi.toFixed(2) + \" mi\";\n case 'km/h_to_mph':\n // km/h is not directly supported, so we convert km to mi\n // then assume it's per hour\n let convertedKmToMiValue = convert(value, 'km').to('mi');\n return convertedKmToMiValue.toFixed(2) + \" mph\";\n case 'millibar_to_psi':\n // millibar is not directly supported, so convert millibar to bar, then bar to psi\n let barValue = value / 1000;\n let convertedMillibarToPsi = convert(barValue, 'bar').to('psi');\n return convertedMillibarToPsi.toFixed(2) + \" psi\";\n default:\n return \"Invalid conversion type\";\n }\n } catch (error) {\n console.error(\"Conversion error:\", error);\n return \"Conversion failed\";\n }\n }\n\n console.log(convertWithLibrary('C_to_F', 10)); // Output: 50.00 °F\n console.log(convertWithLibrary('mm_to_in', 25)); // Output: 0.98 in\n console.log(convertWithLibrary('invalid_type', 5)); // Output: Invalid conversion type"]]