OilPriceAPI Documentation
GitHub
GitHub
  • Interactive Explorer

    • Interactive API Explorer
  • Price Data

    • API Reference
    • Get Latest Prices
    • Historical Prices
  • Commodities

    • List Commodities
    • Get Commodity Details
  • Marine Fuels

    • List Marine Fuel Ports
    • Get Port Details with Prices
  • Premium Endpoints

    • All Prices API - One Call, All Commodities
    • Cushing Oil Storage Intelligence API
    • Drilling Intelligence API
    • Marine Fuels API
    • ICE Brent Futures API

Marine Fuels API

Overview

Comprehensive marine fuel pricing data for major global ports. Track bunker fuel prices for maritime operations, compliance planning, and arbitrage opportunities.

Endpoints

EndpointDescriptionAccess
/v1/prices/marine-fuelsLatest prices at all portsAll tiers
/v1/prices/marine-fuels/latestFiltered latest pricesAll tiers
/v1/prices/marine-fuels/portsList available portsAll tiers
/v1/prices/marine-fuels/historicalHistorical price dataPaid tiers only

Fuel Types

CodeDescriptionSulfur ContentISO Spec
MGO_05SMarine Gas Oil0.5%ISO 8217 DMA
VLSFOVery Low Sulfur Fuel Oil0.5%ISO 8217 RMG380
HFO_380Heavy Fuel Oil 3803.5%ISO 8217 RMG380
HFO_180Heavy Fuel Oil 1803.5%ISO 8217 RMG180

Major Ports

Port CodePort NameRegionCountry
SGSINSingaporeAsia-PacificSingapore
NLRTMRotterdamEuropeNetherlands
USTXHHoustonAmericasUSA
AEDXBDubaiMiddle EastUAE
JPYOKYokohamaAsia-PacificJapan
KRPUSBusanAsia-PacificSouth Korea
GBLONLondonEuropeUK
DEHAMHamburgEuropeGermany

Get All Marine Fuel Prices

curl -X GET "https://api.oilpriceapi.com/v1/prices/marine-fuels" \
  -H "Authorization: Token YOUR_API_KEY"

Response:

{
  "status": "success",
  "data": {
    "prices": [
      {
        "port_code": "SGSIN",
        "port_name": "Singapore",
        "country": "Singapore",
        "region": "Asia-Pacific",
        "coordinates": {
          "lat": 1.290270,
          "lng": 103.851959
        },
        "fuels": [
          {
            "fuel_type": "VLSFO",
            "fuel_name": "Very Low Sulfur Fuel Oil",
            "price": 625.50,
            "formatted": "$625.50",
            "currency": "USD",
            "unit": "MT",
            "source": "platts",
            "timestamp": "2025-09-20T14:30:00.000Z",
            "quality_grade": "ISO 8217 RMG380"
          },
          {
            "fuel_type": "MGO_05S",
            "fuel_name": "Marine Gas Oil 0.5%S",
            "price": 785.25,
            "formatted": "$785.25",
            "currency": "USD",
            "unit": "MT",
            "source": "platts",
            "timestamp": "2025-09-20T14:30:00.000Z",
            "quality_grade": "ISO 8217 DMA"
          }
        ]
      }
    ],
    "ports": [
      {"code": "SGSIN", "name": "Singapore", "country": "Singapore"},
      {"code": "NLRTM", "name": "Rotterdam", "country": "Netherlands"}
    ]
  }
}

Get Specific Port Prices

curl -X GET "https://api.oilpriceapi.com/v1/prices/marine-fuels/latest?port=SGSIN&fuel_type=VLSFO" \
  -H "Authorization: Token YOUR_API_KEY"

Response:

{
  "status": "success",
  "data": {
    "prices": [
      {
        "fuel_type": "VLSFO",
        "fuel_name": "Very Low Sulfur Fuel Oil",
        "price": 625.50,
        "formatted": "$625.50/MT",
        "currency": "USD",
        "unit": "MT",
        "source": "platts",
        "timestamp": "2025-09-20T14:30:00.000Z",
        "quality_grade": "ISO 8217 RMG380"
      }
    ],
    "filters": {
      "port": "SGSIN",
      "fuel_type": "VLSFO"
    }
  }
}

List Available Ports

curl -X GET "https://api.oilpriceapi.com/v1/prices/marine-fuels/ports" \
  -H "Authorization: Token YOUR_API_KEY"

Response:

{
  "status": "success",
  "data": {
    "ports": [
      {
        "code": "SGSIN",
        "name": "Singapore",
        "country": "Singapore",
        "region": "Asia-Pacific",
        "major_port": true,
        "coordinates": {
          "lat": 1.290270,
          "lng": 103.851959
        },
        "fuel_services": ["VLSFO", "MGO_05S", "HFO_380"],
        "trading_hours": "24/7",
        "timezone": "Asia/Singapore",
        "recent_prices": [...]
      }
    ],
    "count": 25
  }
}

Historical Data (Paid Tiers)

Track price trends and analyze historical patterns:

curl -X GET "https://api.oilpriceapi.com/v1/prices/marine-fuels/historical?port=NLRTM&fuel_type=VLSFO&days=30" \
  -H "Authorization: Token YOUR_API_KEY"

Response:

{
  "status": "success",
  "data": {
    "prices": [
      {
        "fuel_type": "VLSFO",
        "price": 625.50,
        "formatted": "$625.50/MT",
        "timestamp": "2025-09-20T14:00:00.000Z"
      },
      {
        "fuel_type": "VLSFO",
        "price": 624.75,
        "formatted": "$624.75/MT",
        "timestamp": "2025-09-20T10:00:00.000Z"
      }
    ],
    "metadata": {
      "port": "NLRTM",
      "fuel_type": "VLSFO",
      "days": 30,
      "count": 180,
      "period": {
        "start": "2025-08-21T00:00:00.000Z",
        "end": "2025-09-20T14:00:00.000Z"
      }
    }
  }
}

Implementation Examples

JavaScript - Port Price Comparison

class MarineFuelAnalyzer {
  constructor(apiKey) {
    this.apiKey = apiKey;
    this.baseUrl = 'https://api.oilpriceapi.com/v1/prices';
  }

  async comparePortPrices(fuelType = 'VLSFO') {
    const response = await fetch(
      `${this.baseUrl}/marine-fuels/latest?fuel_type=${fuelType}`,
      {
        headers: { 'Authorization': `Token ${this.apiKey}` }
      }
    );

    const data = await response.json();
    return this.analyzeSpread(data.data.prices);
  }

  analyzeSpread(prices) {
    const sorted = prices.sort((a, b) => a.price - b.price);
    const cheapest = sorted[0];
    const mostExpensive = sorted[sorted.length - 1];

    return {
      cheapest: {
        port: cheapest.port_code,
        price: cheapest.price
      },
      mostExpensive: {
        port: mostExpensive.port_code,
        price: mostExpensive.price
      },
      spread: mostExpensive.price - cheapest.price,
      arbitrageOpportunity: (mostExpensive.price - cheapest.price) > 50
    };
  }
}

Python - IMO 2020 Compliance Calculator

import requests
from datetime import datetime, timedelta

class IMO2020ComplianceTracker:
    """Track fuel costs for IMO 2020 sulfur regulations"""

    def __init__(self, api_key):
        self.api_key = api_key
        self.base_url = 'https://api.oilpriceapi.com/v1/prices'

    def get_compliance_fuel_costs(self, port_code):
        """Get compliant fuel options for a specific port"""

        response = requests.get(
            f'{self.base_url}/marine-fuels/latest',
            params={'port': port_code},
            headers={'Authorization': f'Token {self.api_key}'}
        )

        data = response.json()['data']

        # Filter for IMO 2020 compliant fuels (≤ 0.5% sulfur)
        compliant_fuels = {
            'MGO_05S': None,
            'VLSFO': None
        }

        for fuel in data['prices']:
            if fuel['fuel_type'] in compliant_fuels:
                compliant_fuels[fuel['fuel_type']] = fuel['price']

        return {
            'port': port_code,
            'compliant_options': compliant_fuels,
            'cheapest_compliant': min(
                (k, v) for k, v in compliant_fuels.items() if v
            ),
            'timestamp': datetime.utcnow().isoformat()
        }

    def calculate_voyage_fuel_cost(self, port_code, fuel_consumption_mt, fuel_type='VLSFO'):
        """Calculate total fuel cost for a voyage"""

        costs = self.get_compliance_fuel_costs(port_code)
        fuel_price = costs['compliant_options'].get(fuel_type, 0)

        return {
            'port': port_code,
            'fuel_type': fuel_type,
            'price_per_mt': fuel_price,
            'consumption_mt': fuel_consumption_mt,
            'total_cost': fuel_price * fuel_consumption_mt,
            'alternative_fuel': costs['cheapest_compliant']
        }

Ruby - Bunker Alert System

class BunkerPriceAlert
  def initialize(api_key)
    @api_key = api_key
    @base_url = 'https://api.oilpriceapi.com/v1/prices'
  end

  def check_price_threshold(port, fuel_type, threshold)
    uri = URI("#{@base_url}/marine-fuels/latest")
    uri.query = URI.encode_www_form(
      port: port,
      fuel_type: fuel_type
    )

    request = Net::HTTP::Get.new(uri)
    request['Authorization'] = "Token #{@api_key}"

    response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
      http.request(request)
    end

    data = JSON.parse(response.body)
    current_price = data['data']['prices'].first['price']

    {
      alert: current_price <= threshold,
      current_price: current_price,
      threshold: threshold,
      port: port,
      fuel_type: fuel_type,
      message: current_price <= threshold ?
        "ALERT: #{fuel_type} at #{port} is $#{current_price}/MT (below $#{threshold})" :
        "#{fuel_type} at #{port}: $#{current_price}/MT"
    }
  end

  def monitor_multiple_ports(fuel_type, threshold)
    ports = ['SGSIN', 'NLRTM', 'USTXH', 'AEDXB']
    alerts = []

    ports.each do |port|
      result = check_price_threshold(port, fuel_type, threshold)
      alerts << result if result[:alert]
      sleep(0.5) # Rate limit consideration
    end

    alerts
  end
end

Use Cases

1. Bunker Procurement Planning

  • Compare prices across ports on shipping routes
  • Identify optimal refueling locations
  • Track price trends for budget forecasting

2. IMO 2020 Compliance

  • Monitor compliant fuel availability
  • Track VLSFO vs MGO price spreads
  • Calculate compliance cost impacts

3. Arbitrage Opportunities

  • Identify price disparities between regions
  • Monitor spread trends
  • Alert on threshold breaches

4. Fleet Operations

  • Optimize fuel procurement strategies
  • Budget voyage costs
  • Track fuel expense trends

Parameters Reference

/marine-fuels/latest

ParameterTypeRequiredDescription
portstringNoPort code (e.g., SGSIN)
fuel_typestringNoFuel type (e.g., VLSFO)
limitintegerNoMax results (default: 50, max: 100)

/marine-fuels/historical

ParameterTypeRequiredDescription
portstringYesPort code
fuel_typestringYesFuel type
daysintegerNoDays of history (1-365, default: 30)

Error Responses

Invalid Port Code

{
  "error": "Invalid port code: INVALID"
}

Historical Data Access Denied (Free Tier)

{
  "error": "Historical marine fuel data requires a paid subscription",
  "status": 403
}

Data Updates

  • Prices updated every 4 hours
  • Major ports have higher update frequency
  • Data sourced from Platts, Argus, and port authorities

Next Steps

  • ICE Brent Futures API
  • All Prices Endpoint
  • Historical Data API
Prev
Drilling Intelligence API
Next
ICE Brent Futures API