The American Petroleum Institute gravity, or API gravity, is a measure of how heavy or light a petroleum liquid is compared to water. If its API gravity is greater than 10, it is lighter and floats on water; if less than 10, it is heavier and sinks. API gravity is thus an inverse measure of the relative density of a petroleum liquid and the density of water, but it is used to compare the relative densities of petroleum liquids. For example, if one petroleum liquid floats on another and is therefore less dense, it has a greater API gravity. Although mathematically, API gravity has no units (see the formula below), it is nevertheless referred to as being in "degrees". API gravity is gradated in degrees on a hydrometer instrument. The API scale was designed so that most values would fall between 10 and 70 API gravity degrees.
History of development 
The U.S. National Bureau of Standards in 1916 accepted the Baumé scale, developed in France in 1768, as the U.S. standard for measuring the specific gravity of liquids less dense than water. Investigation by the U.S. National Academy of Sciences found major errors in salinity and temperature controls that had caused serious variations in published values. Hydrometers in the U.S. had been manufactured and distributed widely with a modulus of 141.5 instead of the Baumé scale modulus of 140. The scale was so firmly established that by 1921 the remedy implemented by the American Petroleum Institute was to create the API Gravity scale, recognizing the scale that was actually being used.
API gravity formulas 
Conversely, the specific gravity of petroleum liquids can be derived from the API gravity value as
Thus, a heavy oil with a specific gravity of 1.0 (i.e., with the same density as pure water at 60°F) would have an API gravity of:
Using API gravity to calculate barrels of crude oil per metric ton 
In the oil industry, quantities of crude oil are often measured in metric tons. One can calculate the approximate number of barrels per metric ton for a given crude oil based on its API gravity:
So, for example, a metric ton of West Texas Intermediate (39.6° API) would contain about 7.6 barrels.
Measurement of API gravity from its density 
To derive the API gravity from the density, the density is first measured using either the hydrometer, detailed in ASTM D1298 or with the oscillating U-tube method detailed in ASTM D4052. Density adjustments at different temperatures, corrections for soda-lime glass expansion and contraction and meniscus corrections for opaque oils are detailed in the Petroleum Measurement Tables, details of usage specified in ASTM D1250. The specific gravity is then calculated from the formula below and the API gravity calculated from the first formula above.
Direct Measurement of API gravity (Hydrometer method) 
There are advantages to field testing and on-board conversion of measured volumes to volume correction. This method is detailed in ASTM D287.
Classifications or grades 
Generally speaking, oil with an API gravity between 40 and 45 commands the highest prices. Above 45 degrees the molecular chains become shorter and less valuable to refineries.
Crude oil is classified as light, medium or heavy, according to its measured API gravity.
- Light crude oil is defined as having an API gravity higher than 31.1 °API (less than 870 kg/m3)
- Medium oil is defined as having an API gravity between 22.3 °API and 31.1 °API (870 to 920 kg/m3)
- Heavy crude oil is defined as having an API gravity below 22.3 °API (920 to 1000 kg/m3)
- Extra heavy oil is defined with API gravity below 10.0 °API (greater than 1000 kg/m3)
Crude oil with API gravity less than 10 °API is referred to as extra heavy oil or bitumen. Bitumen derived from the oil sands deposits in the Alberta, Canada area has an API gravity of around 8 °API. It can be diluted with lighter hydrocarbons to produce diluted bitumen, having an API gravity of lower than 22.3 API, or further "upgraded" to an API gravity of 31 °API to 33 °API as synthetic crude.