For AI Developers

Energy Data for
AI Agents

Real-time oil, gas, and commodity prices — ready for your LLM agent, RAG pipeline, or AI application. MCP server, LangChain tool, and LlamaIndex tool spec included.

177+
Commodities
Sub-second
Median Response Time
99.9%
Uptime
5+ yr
Price History

4 ways to integrate

Whether you're building with Claude, LangChain, LlamaIndex, or any other framework — we have a native integration for you.

MCP Server

Model Context Protocol

Works with Claude Desktop, Cursor, Windsurf, and VS Code. Ask natural language questions about energy prices directly in your AI editor.

npx oilpriceapi-mcp
Claude DesktopCursorWindsurfVS Code + Cline
GPT Action

OpenAI GPT Action

Add real-time energy data to any custom GPT. Drop in our OpenAPI schema and your GPT can query live commodity prices instantly.

openapi-schema.json
ChatGPT PlusCustom GPTsOpenAI Assistants
LangChain

LangChain Tool

Drop-in tool for any LangChain agent. Fetch real-time Brent, WTI, Henry Hub, and source-timestamped commodity prices with a single pip install.

pip install langchain-oilpriceapi
LangChain agentsLangGraph workflowsLCEL chains
LlamaIndex

LlamaIndex Tool Spec

Native tool spec for LlamaIndex agents and query engines. Works with any LLM backend — OpenAI, Anthropic, local models.

pip install llamaindex-oilpriceapi
LlamaIndex agentsQuery enginesReAct agents

Ready-to-use code

Copy, paste, and add your API key. Each snippet gives you live commodity data in your agent within minutes.

MCP Configjson
{
  "mcpServers": {
    "oilpriceapi": {
      "command": "npx",
      "args": ["-y", "oilpriceapi-mcp"],
      "env": {
        "OILPRICEAPI_KEY": "your-api-key"
      }
    }
  }
}
LangChainpython
from langchain_oilpriceapi import OilPriceAPITool
from langchain.agents import AgentExecutor, create_react_agent

tool = OilPriceAPITool(api_key="your-api-key")

agent = create_react_agent(
    llm=llm,
    tools=[tool],
    prompt=prompt
)

executor = AgentExecutor(agent=agent, tools=[tool])
result = executor.invoke({
    "input": "What is the current Brent crude price?"
})
LlamaIndexpython
from llama_index.tools.oilpriceapi import OilPriceAPIToolSpec
from llama_index.agent.openai import OpenAIAgent

tool_spec = OilPriceAPIToolSpec(api_key="your-api-key")
tools = tool_spec.to_tool_list()

agent = OpenAIAgent.from_tools(tools, verbose=True)

response = agent.chat(
    "Compare current WTI and Brent crude prices"
)
print(response)

What developers are building

From financial assistants to trading bots — real-time commodity data unlocks a new class of AI applications.

Financial AI Assistants

Build chatbots that answer questions about live oil prices, energy market trends, and commodity spreads. Ground your LLM with real data, not hallucinations.

Energy Trading Bots

Power automated agents that monitor Brent, WTI, and Henry Hub in real-time and trigger alerts or actions when price thresholds are hit.

Research Agents

Feed RAG pipelines with 5+ years of commodity price history. Let your agent analyze trends, compare time periods, and generate insights on demand.

Dashboard Builders

Enrich AI-generated dashboards and reports with source-timestamped energy values and broad coverage including crude oil, natural gas, refined products, and metals.

Start building in 5 minutes

Free tier includes 50 requests/day — enough to prototype your agent, test the data, and ship a proof of concept before you ever need a paid plan.

Get Your API Key — Free

No credit card required. Upgrade when you're ready.