API gravity calculator
A crude with a specific gravity of 0.85 reads 34.970588235294 degrees on the American Petroleum Institute scale and is classed as light. Enter the specific gravity at 60/60 °F to get the degrees, the grade and every step of the sum. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Specific gravity
- 0.85
- Api
- 34.9705882353 °API
- Api gravity
- 34.9705882353
- Classification
- light
Traders checking a crude assay, lab technicians transcribing a hydrometer reading, pipeline engineers comparing grade schedules, and students verifying homework all share the same deterministic path.
What the petroleum gravity scale tells you
The American Petroleum Institute scale is the density language of the oil industry. It says how heavy or light a crude oil or refined product is compared with water at the reference temperature of 60 °F, and it is standardized in ASTM D287. The input is the specific gravity on the 60/60 °F basis, the liquid's density divided by that of water at the same temperature, so it carries no units. The conversion is exact: divide 141.5 by the specific gravity, then subtract 131.5. Because the specific gravity sits in the denominator, a lighter liquid gives a higher number of degrees.
Reading the result without slips
Next to the degrees you get a grade, light, medium, heavy or extra-heavy, plus the formula and the substitution steps, ready to paste into a lab notebook or a cargo report. With a specific gravity of 0.85 the result is 34.970588235294 degrees, classed as light. Traders checking a crude assay, technicians transcribing a hydrometer reading and pipeline engineers comparing grade schedules all follow that same path. The usual slip is typing a density with units instead of the dimensionless specific gravity on the 60/60 °F basis. A value of zero or below has no meaning on this scale and is rejected rather than turned into a number.
What you can do with it
Homework and hydrometer practice
Students verify hand calculations of the 141.5 formula with deterministic steps before submitting petroleum engineering assignments.
FAQ
How do I convert specific gravity into petroleum gravity degrees?
Divide 141.5 by the specific gravity and subtract 131.5. A specific gravity of 0.85 gives 34.970588235294 degrees, and the result lists each substitution so you can check it by hand.
Which specific gravity should I enter?
The relative density on the standard 60/60 °F basis: the density of the liquid divided by the density of water, both at 60 °F. It is a plain number with no units, so do not type a density in kilograms or grams.
What do light, medium, heavy and extra-heavy mean in the result?
They are the grade shown next to the degrees, a quick way to say how heavy or light the liquid is compared with water. A specific gravity of 0.85, for example, is labelled light.
Who defines this gravity scale?
The American Petroleum Institute defined it, and it is standardized in ASTM D287. It expresses how heavy or light a petroleum liquid is compared with water at the reference temperature of 60 °F.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/phys/api-gravity \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"specific_gravity":0.85}'const res = await fetch("https://api.kit.forhosting.com/phys/api-gravity", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"specific_gravity": 0.85
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/phys/api-gravity",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"specific_gravity": 0.85
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/phys/api-gravity", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"specific_gravity":0.85}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"specific_gravity":0.85}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/phys/api-gravity", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"specific_gravity": 0.85
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "phys.api_gravity",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_abs | 1000000000000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
An API gravity calculator turns the specific gravity of a petroleum liquid into degrees API using the industry's exact hydrometer formula, with no tables and no hand arithmetic. Enter the specific gravity of your crude oil or refined product — the relative density measured at the standard sixty over sixty degrees Fahrenheit basis — and the tool returns the corresponding degrees API, a light, medium, heavy, or extra-heavy classification, the formula string, and the substitution steps you can paste into a lab notebook or cargo report. Specific gravity of zero or below is physically meaningless for this scale, so the solver rejects it with a clear invalid_input error instead of inventing a number.
What API gravity is and how the formula works
Defined by the American Petroleum Institute and standardized in ASTM D287, it expresses how heavy or light a petroleum liquid is compared with water at the reference temperature of sixty degrees Fahrenheit. Specific gravity here means relative density on the sixty over sixty degrees Fahrenheit basis — the density of the liquid divided by the density of water, both at the reference temperature — so it is a pure dimensionless number with no units attached. API gravity is the density scale the petroleum industry actually speaks. The relationship to specific gravity is exact and algebraic: degrees API equals one hundred forty-one point five divided by the specific gravity, minus one hundred thirty-one point five. Water itself, with specific gravity exactly one, lands at exactly ten degrees API, which makes ten the dividing line: liquids above ten degrees API float on water, liquids below it sink. Light crudes such as West Texas Intermediate sit around forty degrees API, medium grades cluster in the twenties and low thirties, heavy crudes fall between ten and twenty-two, and extra-heavy bitumens drop below ten. Because the formula divides by specific gravity, the scale is undefined when specific gravity is zero and physically meaningless when it is negative; this calculator rejects both with an invalid_input error naming the field, rather than returning an infinite or absurd result. It applies only the closed-form definition — no temperature volume correction factors, no blend rules, no table interpolation — so the answer you get is the pure definitional value you would compute by hand, rounded to twelve decimal places for reproducibility across systems.
How to call the API and read the response
The value must be a finite number, or a strict numeric string without currency symbols or thousand separators, within an absolute magnitude of one trillion, and it must be greater than zero. Send a JSON body with one required field, specific_gravity, which also answers to the aliases sg, value, gravity, relative_density, and density so existing payloads integrate without renaming. On success the response echoes the rounded specific_gravity, then gives api and api_gravity — the same degrees API figure under two keys for convenience — plus unit set to the degrees API symbol, a classification of light, medium, heavy, or extra heavy following the common industry bands, the formula string showing the exact constants used, a plain English message summarizing the result, and a steps array listing the ordered substitution lines from input through classification. Validation failures — a missing field, a non-finite value, a magnitude beyond the limit, or specific gravity of zero or below — return invalid_input with a message that names the offending field, and failed tasks are never charged against prepaid balance. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price. This makes the capability safe to wire into dashboards, mobile apps, batch assay processors, or any client that holds a relative density reading and needs the degrees API figure for display, tickets, or mixed SI and imperial reports.
Practical tips, limits, and when to use this calculator
Send bare numbers when you control the client; string input is accepted only when it matches a strict finite numeric pattern, so reject locale-formatted values on your side before calling. Remember that this tool applies the definitional formula only: custody transfer and official reporting often require temperature-corrected volumes from ASTM D1250 tables, which are out of scope here. Stay within the published absolute limit of one trillion so intermediate division cannot overflow, and treat the classification band as an informal industry convention rather than a contractual boundary. Classic reference points make good sanity checks: specific gravity one must return exactly ten degrees API, a light crude around zero point eight five returns roughly thirty-five degrees API, and a heavy crude near zero point nine three returns about twenty degrees API. If you need the reverse direction, or conversions into absolute density units such as kilograms per cubic metre, grams per cubic centimetre, or pounds per gallon, use the dedicated API gravity converter capability instead — this calculator deliberately does one thing, specific gravity to degrees API, and does it deterministically. This landing serves people searching for an API gravity calculator, degrees API from specific gravity, or a petroleum hydrometer formula check; it is not a general unit converter, not a density tool for other industries, and not a blend or temperature-correction engine. Failed calls return invalid_input and consume no balance, which keeps exploratory scripts and client-side validation probes cheap while you integrate.
Integration use cases
Crude assay and cargo tickets
Labs and cargo clerks convert a measured specific gravity into degrees API so assays, bills of lading, and tickets report the industry-standard figure.
Grade classification checks
Traders and schedulers turn a relative density reading into degrees API and read the light, medium, or heavy band before nominating a crude grade.
Technical questions
What is the formula for API gravity from specific gravity?
°API = 141.5 / SG − 131.5, where SG is the specific gravity (relative density) of the liquid on the 60/60 °F basis.
What is the API gravity of water?
Water has SG = 1 at the reference basis, which corresponds to exactly 10 °API — the dividing line between liquids that float and sink.
What happens if specific gravity is zero or negative?
The tool returns an invalid_input error naming the field. API gravity is undefined at zero and physically meaningless below it; failed tasks are never charged.
How are light, medium, and heavy crudes classified?
A common convention: light above 31.1 °API, medium from 22.3 to 31.1, heavy from 10 to 22.3, and extra heavy below 10 °API (denser than water).
Is the API gravity calculator free?
Yes in the browser, with the same deterministic algorithm. The prepaid API costs a flat $0.002 per successful request.