To track jet fuel costs with OilPriceAPI, request the code JET_FUEL_USD by name, send your API key from an environment variable in an Authorization: Token header, and keep four things from each response: price, unit, the observation date (source_date, or as_of for the full timestamp) and data_status. Multiply the price by your gallons and store the observation date with the result.

curl -s "https://api.oilpriceapi.com/v1/prices/latest?by_code=JET_FUEL_USD" \
  -H "Authorization: Token $OILPRICEAPI_KEY"

The same request in Python:

import os

import requests

response = requests.get(
    "https://api.oilpriceapi.com/v1/prices/latest",
    params={"by_code": "JET_FUEL_USD"},
    headers={"Authorization": f"Token {os.environ['OILPRICEAPI_KEY']}"},
    timeout=10,
)
response.raise_for_status()
data = response.json()["data"]

keep = {k: data[k] for k in ("price", "unit", "source_date", "as_of", "data_status")}
print(keep)

The fields sit under data in the response. A request without by_code returns BRENT_CRUDE_USD, a crude price per barrel, so always name the code.

Field What it holds Store it?
price The price in currency per unit Yes
currency, unit USD and gallon for this series Yes; check both before you multiply
source_date The observation date (YYYY-MM-DD) Yes; use it as the key for each row
as_of The observation timestamp in UTC Optional
data_status current, delayed or stale Yes
freshness age_seconds and expected_max_age_seconds Use it for the stale check
created_at, ingested_at When OilPriceAPI stored the value No; this is not the observation date

Workflow: request JET_FUEL_USD, keep price, unit and source_date, check data_status and freshness, then log gallons times price with the observation date

Updated November 26, 2026. Prices in the examples below are illustrative, not live quotes.

What JET_FUEL_USD measures

JET_FUEL_USD is the US Gulf Coast kerosene-type jet fuel spot price, FOB, in US dollars per gallon. EIA publishes it in a weekly batch, so a new value arrives about once a week, and the newest observation can be more than a week old just before the next batch. It is the same series as the live jet fuel price page, which is a quick way to check what your code receives.

It is a spot benchmark, not an airport or into-plane price. Use it to see how your fuel cost moves with the market, and keep the price your supplier invoices in its own column. For a per-barrel figure, multiply the per-gallon price by 42.

For Asia-Pacific, SINGAPORE_JET_KEROSENE_USD is a separate series quoted in USD per barrel, with its own Singapore jet kerosene page. Keep it in its own column: it is a different market and a different unit from the Gulf Coast price.

Poll once a day at most

Request the price once a day at most. Because the series arrives weekly, more frequent requests return the same observation and use up your request allowance. Treat source_date as the observation date: if it matches the last one you stored, there is nothing new to record.

Do not use created_at or ingested_at as the price date. They record when OilPriceAPI stored the value, which for a weekly batch can be several days after the observation.

Detect a stale value

data_status tells you whether the value is within the age expected for its series. Treat anything other than current as not confirmed current. The freshness object gives the numbers behind it: age_seconds is how old the observation is, and expected_max_age_seconds is the longest gap expected for this series (691,200 seconds, or 8 days, for the weekly jet fuel price).

def is_current(data):
    freshness = data.get("freshness") or {}
    age = freshness.get("age_seconds")
    limit = freshness.get("expected_max_age_seconds")
    return (
        data.get("data_status") == "current"
        and age is not None
        and limit is not None
        and age <= limit
    )

Do not rely on the stale flag alone. A weekly value can read delayed while stale is still false, typically just before the next batch arrives. When is_current returns False, keep the last value, label it with its source_date, and flag any report that uses it. Do not copy the previous week's price into a new week without saying so.

Track jet fuel costs week by week

The cost calculation is gallons times the price per gallon for the observation date you use. Example, with illustrative numbers rather than a live price: 120,000 gallons at an example price of $3.00 per gallon is 120,000 × 3.00 = $360,000. If your volumes are in barrels, convert first: gallons = barrels × 42.

Store the observation date with every number. A cost row without its source_date cannot be checked later, after the price has moved. This script appends one row per new observation to a CSV file, and skips the run if the observation is already logged:

import csv
import os
from datetime import datetime, timezone
from pathlib import Path

import requests

LOG = Path("jet_fuel_costs.csv")
FIELDS = ["source_date", "price_usd_per_gal", "gallons", "cost_usd",
          "data_status", "retrieved_at"]


def fetch_jet_fuel():
    response = requests.get(
        "https://api.oilpriceapi.com/v1/prices/latest",
        params={"by_code": "JET_FUEL_USD"},
        headers={"Authorization": f"Token {os.environ['OILPRICEAPI_KEY']}"},
        timeout=10,
    )
    response.raise_for_status()
    data = response.json()["data"]
    if data["code"] != "JET_FUEL_USD" or data["unit"] != "gallon":
        raise ValueError(f"Unexpected series: {data['code']} per {data['unit']}")
    return data


def record_week(gallons):
    data = fetch_jet_fuel()
    logged = set()
    if LOG.exists():
        with LOG.open(newline="") as f:
            logged = {row["source_date"] for row in csv.DictReader(f)}
    if data["source_date"] in logged:
        return None  # same observation as the last run: nothing new to store

    entry = {
        "source_date": data["source_date"],
        "price_usd_per_gal": data["price"],
        "gallons": gallons,
        "cost_usd": round(gallons * data["price"], 2),
        "data_status": data["data_status"],
        "retrieved_at": datetime.now(timezone.utc).isoformat(timespec="seconds"),
    }
    write_header = not LOG.exists()
    with LOG.open("a", newline="") as f:
        writer = csv.DictWriter(f, fieldnames=FIELDS)
        if write_header:
            writer.writeheader()
        writer.writerow(entry)
    return entry

Run record_week(gallons) once a day from a scheduler, passing the gallons for the period you are costing. Each row keeps the observation date, the price and unit, the gallons, the cost, the data_status at the time, and your own retrieval time in a separate column. The unit check stops the script before it multiplies gallons by a price in another unit.

Next steps

For retries, error handling and the rest of the request pattern in Python, see the Python oil price API tutorial. The Node.js tutorial shows the same request in JavaScript. Response fields and error codes are in the API documentation.

New accounts get a 7-day trial with 10,000 requests and no credit card. After that, the Free plan is 50 requests/day. The Developer plan is $19/month for 10,000 requests/month.

Start a 7-day trial (10,000 requests, no credit card) · See the Developer plan ($19/month)

FAQs

How often should I request the jet fuel price?

Once a day at most. JET_FUEL_USD arrives in a weekly batch, so more frequent requests return the same observation. Compare source_date with the last one you stored and record a new row only when it changes.

Which date should I store with the price?

source_date, the date the price was observed. created_at and ingested_at record when OilPriceAPI stored the value, which can be days later for a weekly series. Store your own retrieval time in a separate column.

Is this the price my airline or FBO pays?

No. It is the US Gulf Coast spot price, FOB, per gallon. What you pay is set by your supply contract. Track this price beside your invoice price, not instead of it.

Building a product or workflow that needs oil prices?

Compare API plans, historical coverage, and support for your use case.

Explore API plans