Troubleshooting Guide
Common Issues and Solutions
Price Anomalies
Symptom: Prices appear 10x or 100x off expected values
Common Cause: Decimal point parsing error or unit confusion
Solution:
- Check the
currency
andunit
fields in the API response - For UK Natural Gas: Values are in pence (GBp), not pounds
- Verify against our expected ranges:
- UK Natural Gas: 30-200 pence/therm
- Brent/WTI: $20-$200/barrel
- Gold: $1,500-$3,000/oz
Prevention: Always validate units before processing prices
Symptom: Historical data shows inconsistent values
Common Cause: Data correction in progress or recently completed
Solution:
- Check for recent incident notifications
- Use the
/v1/commodities/{code}/status
endpoint for data quality info - Re-fetch historical data after corrections complete
Prevention: Subscribe to webhook notifications for data corrections
Symptom: Sudden price spikes or drops
Common Cause: Market volatility or feed issues
Solution:
- Compare with multiple time periods (3-min, hourly, daily averages)
- Check our status page for feed disruptions
- Verify against external sources for major market events
Prevention: Implement sanity checks in your application
API Access Issues
Symptom: 403 Forbidden on premium endpoints
Common Cause: Insufficient subscription tier
Solution:
- Check your current plan at dashboard.oilpriceapi.com
- Verify endpoint access requirements in documentation
- Upgrade plan if needed for premium features
Endpoint Access by Tier:
- Free/Hobby: Basic spot prices, limited history
- Starter: Extended history, more frequent updates
- Professional: Weather data, pipeline flows, WebSocket
- Business/Enterprise: All features, priority support
Symptom: 429 Rate Limit Exceeded
Common Cause: Too many requests in time window
Solution:
- Check response headers for rate limit info:
X-RateLimit-Limit
: Your limitX-RateLimit-Remaining
: Requests leftX-RateLimit-Reset
: Reset timestamp
- Implement exponential backoff
- Cache responses appropriately
Rate Limits by Tier:
- Free: 1,000/month
- Hobby: 10,000/month
- Starter: 50,000/month
- Professional: 100,000/month
- Business: 200,000/month
Symptom: Authentication failures
Common Cause: Invalid or expired API key
Solution:
- Verify API key in request headers:
Authorization: Token YOUR_API_KEY
- Check key status in dashboard
- Regenerate key if compromised
- Ensure no extra spaces or characters
- Use Token prefix, not Bearer
Data Feed Issues
Symptom: Missing data for specific time periods
Common Cause: Feed disruption or maintenance
Solution:
- Check our status page for maintenance windows
- Use fallback to last known good value
- Wait for backfill (usually within 15 minutes)
Affected Feeds & Recovery:
- EIA Storage: Weekly updates Thursdays 10:30 AM ET
- Weather Data: Daily updates, 6-hour recovery window
- Exchange Prices: 15-minute recovery for disruptions
Symptom: WebSocket connection drops frequently
Common Cause: Network issues or subscription limits
Solution:
- Implement automatic reconnection with backoff
- Check subscription includes WebSocket access
- Monitor for rate limiting on connections
- Use connection pooling for multiple streams
WebSocket Best Practices:
// Automatic reconnection example
let reconnectDelay = 1000;
const maxDelay = 30000;
function connect() {
const ws = new WebSocket('wss://api.oilpriceapi.com/v1/stream');
ws.onclose = () => {
setTimeout(() => {
reconnectDelay = Math.min(reconnectDelay * 2, maxDelay);
connect();
}, reconnectDelay);
};
ws.onopen = () => {
reconnectDelay = 1000; // Reset delay on successful connection
};
}
Historical Data Issues
Symptom: Gaps in historical price data
Common Cause: Market closures or feed availability
Solution:
- Check market hours for the commodity
- Account for weekends and holidays
- Use interpolation for minor gaps
- Contact support for extended outages
Market Hours:
- Oil/Gas: 24/5 (closed weekends)
- Precious Metals: 24/5 with reduced weekend liquidity
- UK Natural Gas: UK trading hours (8 AM - 6 PM GMT)
Symptom: Different values for same timestamp
Common Cause: Multiple data sources or corrections applied
Solution:
- Use the most recent API response
- Check
last_updated
field for data freshness - Prefer corrected data (check incident notifications)
Integration Issues
Symptom: Prices don't match website display
Common Cause: Different update frequencies or caching
Solution:
- Check update frequency for your tier
- Account for display rounding (website may show fewer decimals)
- Verify timezone handling (all times in UTC)
- Clear any client-side caches
Symptom: Webhook events not received
Common Cause: Endpoint configuration or network issues
Solution:
- Verify endpoint URL is publicly accessible
- Check webhook signature validation
- Ensure endpoint responds with 200 status
- Review webhook logs in dashboard
Webhook Debugging:
# Test your endpoint
curl -X POST https://your-endpoint.com/webhook \
-H "Content-Type: application/json" \
-H "X-OilPriceAPI-Signature: test" \
-d '{"event":"price.updated","commodity":"BRENT","price":85.50}'
Debugging Checklist
For Price Issues
- [ ] Verify currency and unit fields
- [ ] Check against expected ranges
- [ ] Compare multiple time periods
- [ ] Review recent corrections
- [ ] Validate timezone handling
For API Issues
- [ ] Confirm API key is valid
- [ ] Check rate limit headers
- [ ] Verify subscription tier
- [ ] Test with curl command
- [ ] Review error message details
For Data Quality
- [ ] Check status page
- [ ] Review incident notifications
- [ ] Compare with backup sources
- [ ] Contact support if persistent
Getting Help
Self-Service Resources
- Documentation: docs.oilpriceapi.com
- Status Page: status.oilpriceapi.com
- Dashboard: dashboard.oilpriceapi.com
- API Explorer: api.oilpriceapi.com/explorer
Contact Support
- Email: [email protected]
- Response Time:
- Critical: 3 business days
- Major: 3 business days
- Minor: 3 business days
- Include in Report:
- API key (first 8 characters only)
- Exact timestamp of issue
- Commodity code affected
- Expected vs actual values
- Error messages received
Emergency Contacts
For critical production issues affecting trading:
- Hotline: Available for Enterprise customers
- Escalation: Via account manager
- SLA: Based on subscription tier