Skip to content

Releases: OilpriceAPI/oilpriceapi-node

v0.3.1 - Timeout Fix

25 Nov 22:54

Choose a tag to compare

Fixed

  • Increased default timeout from 30s to 90s to handle slow historical price queries
  • Added "type": "module" to package.json to eliminate module warnings
  • Updated User-Agent to v0.3.1

Changed

  • Default timeout: 30000ms90000ms (90 seconds)
  • Package size: 9.6 kB (down from 9.7 kB)

Quality Assurance

  • ✅ All 7 QA tests passing (100% success rate)
  • ✅ Historical prices endpoint working
  • ✅ Zero production users affected

Links

v0.3.0 - Commodities Endpoints

25 Nov 10:55

Choose a tag to compare

✨ New Features

Commodity Metadata Endpoints

  • getCommodities() - Retrieve metadata for all 41 supported commodities
  • getCommodityCategories() - Get commodities organized by category (oil, gas, renewable, etc.)
  • getCommodity(code) - Get detailed metadata for a specific commodity

New TypeScript Interfaces

  • Commodity - Full commodity metadata with validation ranges
  • CommoditiesResponse - Response from getCommodities()
  • CommodityCategory - Category with its commodities
  • CategoriesResponse - Response from getCommodityCategories()

📦 Installation

npm install oilpriceapi@0.3.0

📚 Usage Example

import { OilPriceAPI } from 'oilpriceapi';

const client = new OilPriceAPI({ apiKey: 'your_key' });

// Get all commodities
const { commodities } = await client.getCommodities();
console.log(`Found ${commodities.length} commodities`);

// Get commodity categories
const categories = await client.getCommodityCategories();
console.log(categories.oil.commodities); // All oil commodities

// Get specific commodity
const wti = await client.getCommodity('WTI_USD');
console.log(wti.name); // "WTI Crude Oil"

📈 Coverage

SDK now supports 5 out of 34 API endpoints (14.7%):

  • ✅ Prices (latest, historical)
  • ✅ Commodities (list, categories, details)

See GitHub Issues for remaining endpoint coverage roadmap.

🔗 Links

v0.2.0 - Production Ready Release

24 Nov 22:03

Choose a tag to compare

🎉 Production-Ready Release

✨ New Features

  • Automatic retries with exponential backoff
  • Request timeout handling with AbortController
  • Debug logging mode for detailed request/response logs
  • Smart error handling with intelligent retry logic
  • Rate limit handling with Retry-After header support

📦 Installation

npm install oilpriceapi

🔧 Configuration Options

  • retries: Maximum retry attempts (default: 3)
  • retryDelay: Initial delay between retries in ms (default: 1000)
  • retryStrategy: Backoff strategy - 'exponential', 'linear', or 'fixed' (default: 'exponential')
  • timeout: Request timeout in milliseconds (default: 30000)
  • debug: Enable debug logging (default: false)

📚 Documentation

See README

🔗 Links

v0.1.0 - Initial Release

24 Nov 22:20

Choose a tag to compare

🎉 Initial Release

✨ Features

  • Basic API client with TypeScript support
  • Latest prices endpoint support
  • Historical prices endpoint support
  • Custom error classes (AuthenticationError, RateLimitError, NotFoundError, ServerError)
  • Zero runtime dependencies
  • Full TypeScript type definitions
  • Comprehensive README documentation

📦 Supported Endpoints

  • GET /v1/prices/latest - Get latest commodity prices
  • GET /v1/prices - Get historical commodity prices

📚 Documentation

See README