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.
4 ways to integrate
Whether you're building with Claude, LangChain, LlamaIndex, or any other framework — we have a native integration for you.
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-mcpOpenAI 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.jsonLangChain 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-oilpriceapiLlamaIndex Tool Spec
Native tool spec for LlamaIndex agents and query engines. Works with any LLM backend — OpenAI, Anthropic, local models.
pip install llamaindex-oilpriceapiReady-to-use code
Copy, paste, and add your API key. Each snippet gives you live commodity data in your agent within minutes.
{
"mcpServers": {
"oilpriceapi": {
"command": "npx",
"args": ["-y", "oilpriceapi-mcp"],
"env": {
"OILPRICEAPI_KEY": "your-api-key"
}
}
}
}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?"
})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 — FreeNo credit card required. Upgrade when you're ready.