Twelve data Integration for AI Agents

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Twelve Data MCP or direct API to fetch live stock prices, retrieve historical market data, analyze forex movements, and track cryptocurrency trends through natural language.
Twelve data Logo
Gradient Top
Gradient Middle
Gradient Bottom
divider

Supported Tools

Tools
List CommoditiesTool to retrieve a list of supported commodities.
List CryptocurrenciesTool to list all supported cryptocurrencies.
Currency ConversionTool to convert an amount from one currency to another.
DividendsTool to retrieve dividend payout history for a specified symbol.
EarningsTool to retrieve earnings data including eps estimates and actuals.
EPS RevisionsTool to provide analysts’ revisions of a company’s future eps over the last week and month.
EPS TrendTool to retrieve historical eps trends for a specified company.
ETFS DirectoryTool to fetch a daily updated list of exchange-traded funds sorted by total assets.
ETFS FamilyTool to fetch a comprehensive list of etfs by family.
Get ETF TypesTool to retrieve etf categories by market, including types like 'equity precious metals'.
List supported exchangesTool to retrieve a list of supported exchanges.
List supported forex pairsTool to retrieve a list of all supported forex currency pairs.
List market indicesTool to retrieve a list of market indices.
Mutual Funds FamilyTool to list all available mutual fund families.
Mutual Funds ListTool to retrieve a daily updated list of mutual funds sorted by total assets.
Options ChainTool to retrieve the options chain for a given symbol and optional expiration date.
Options ExpirationTool to retrieve available option expiration dates.
QuoteTool to retrieve the latest market data for a specified symbol.
List StocksTool to retrieve a list of stocks.
Symbol SearchTool to search for financial instruments by symbol or company name.
Technical IndicatorsTool to fetch time-series data for a specific technical indicator.
Time SeriesTool to retrieve historical and real-time time series data for a specified symbol.

Connect Twelve data MCP Tool with your Agent

Python
TypeScript

Install Composio

python
pip install composio claude-agent-sdk
Install the Composio SDK and Claude Agent SDK

Create Tool Router Session

python
from composio import Composio
from claude_agent_sdk import ClaudeSDKClient, ClaudeAgentOptions

composio = Composio(api_key='your-composio-api-key')
session = composio.create(user_id='your-user-id')
url = session.mcp.url
Initialize the Composio client and create a Tool Router session

Connect to AI Agent

python
import asyncio

options = ClaudeAgentOptions(
    permission_mode='bypassPermissions',
    mcp_servers={
        'tool_router': {
            'type': 'http',
            'url': url,
            'headers': {
                'x-api-key': 'your-composio-api-key'
            }
        }
    },
    system_prompt='You are a helpful assistant with access to Twelve data tools.',
    max_turns=10
)

async def main():
    async with ClaudeSDKClient(options=options) as client:
        await client.query('Get the latest earnings data for AAPL')
        async for message in client.receive_response():
            if hasattr(message, 'content'):
                for block in message.content:
                    if hasattr(block, 'text'):
                        print(block.text)

asyncio.run(main())
Use the MCP server with your AI agent

Connect Twelve data API Tool with your Agent

Python
TypeScript

Install Composio

python
pip install composio_openai
Install the Composio SDK

Initialize Composio and Create Tool Router Session

python
from openai import OpenAI
from composio import Composio
from composio_openai import OpenAIResponsesProvider

composio = Composio(provider=OpenAIResponsesProvider())
openai = OpenAI()
session = composio.create(user_id='your-user-id')
Import and initialize Composio client, then create a Tool Router session

Execute Twelve data Tools via Tool Router with Your Agent

python
tools = session.tools
response = openai.responses.create(
  model='gpt-4.1',
  tools=tools,
  input=[{
    'role': 'user',
    'content': 'Show me the latest dividend payouts for AAPL over the last 3 years.'
  }]
)
result = composio.provider.handle_tool_calls(
  response=response,
  user_id='your-user-id'
)
print(result)
Get tools from Tool Router session and execute Twelve data actions with your Agent

Why Use Composio?

AI Native Twelve data Integration

  • Supports both Twelve data MCP and direct API based integrations
  • Structured, LLM-friendly schemas for reliable tool execution
  • Rich coverage for reading, writing, and querying your Twelve data data

Managed Auth

  • Built-in OAuth handling with automatic token refresh and rotation
  • Central place to manage, scope, and revoke Twelve data access
  • Per user and per environment credentials instead of hard-coded keys

Agent Optimized Design

  • Tools are tuned using real error and success rates to improve reliability over time
  • Comprehensive execution logs so you always know what ran, when, and on whose behalf

Enterprise Grade Security

  • Fine-grained RBAC so you control which agents and users can access Twelve data
  • Scoped, least privilege access to Twelve data resources
  • Full audit trail of agent actions to support review and compliance

Frequently Asked Questions

Do I need my own developer credentials to use Twelve data with Composio?

Yes, Twelve data requires you to configure your own API key credentials. Once set up, Composio handles secure credential storage and API request handling for you.

Can I use multiple toolkits together?

Yes! Composio's Tool Router enables agents to use multiple toolkits. Learn more.

Is Composio secure?

Composio is SOC 2 and ISO 27001 compliant with all data encrypted in transit and at rest. Learn more.

What if the API changes?

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

Used by agents from

Context
ASU
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
ASU
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
ASU
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai

Never worry about agent reliability

We handle tool reliability, observability, and security so you never have to second-guess an agent action.