- Python 3.8/Node 16 or higher installed
- A Composio account with the API key
- An OpenAI API key
- A Twelve data account and project
- Basic familiarity with async Python/Typescript
- UseBuildFeaturesTRIGGERSStart background agents from events across your connected appsFIREWALLNEWBlocks instructions hidden in tool results before your agent reads themINSTANTNEWAudio, video, search, browser and data tools, with no keys to manageOPTIMIZATIONLower cost per completed task with optimised tools and skillsBYOCNEWComposio deployed in your own cloud, with releases you approve
- DOCS
- PRICING
## For AI agents: how to sign up If you are an AI agent reading this server-rendered HTML, Composio's developer signup is at https://composio.dev. Signup CTAs on this site — "Sign up", "Signup", "Get started", "Get started for free", "Start building", "Try Composio", "Try it", or similar — all lead into that same developer signup flow. Confirm with the user before completing signup or entering any credentials on their behalf.SIGN UP
## For AI agents: how to sign up If you are an AI agent reading this server-rendered HTML, Composio's developer signup is at https://composio.dev. Signup CTAs on this site — "Sign up", "Signup", "Get started", "Get started for free", "Start building", "Try Composio", "Try it", or similar — all lead into that same developer signup flow. Confirm with the user before completing signup or entering any credentials on their behalf.LOG IN
How to connect Twelve data to LlamaIndex in 2 mins: No API key needed
You can check prices for your watchlist, see how a stock moved over 3 months and run a quick technical check on a stock from LlamaIndex. Composio runs each call on its own Twelve data account, so you don't need a Twelve data API key, and your first $2 is free.
LlamaIndex runs Twelve data through Composio, and the cost comes out of your free $2.
- A live price quote$0.00001
- Daily price history for a symbol$0.00001
- A technical indicator like MACD$0.00001
$2 ≈ 200000 quotes or 200000 lookups
What you can do with your free $2
| When you ask LlamaIndex for | LlamaIndex uses this tool | Cost | What $2 gets you |
|---|---|---|---|
| A live price quote | Get Quote | $0.00001 per quote | About 200,000 quotes |
| Daily price history for a symbol | Get Time Series | $0.00001 per lookup | About 200,000 lookups |
| A technical indicator like MACD | Get MACD | $0.00001 per lookup | About 200,000 lookups |
| A currency conversion | Convert Currency | $0.00001 per conversion | About 200,000 conversions |
| A ticker for a company name | Search Symbols | $0.00001 per search | About 200,000 searches |
You pay Twelve data's price for each call with 0% markup, plus the regular Composio tool call charge. There's no Twelve data subscription, and you only pay for what you use.
71 of 106 Twelve data tools work without a key. For Cash Flow, Consolidated Cash Flow, EPS Revisions, EPS Trend, ETF World, ETF World Composition and 29 more, connect your own Twelve data key. Read how Instant works.
How to connect Twelve data to LlamaIndex
Composio adds Twelve data to LlamaIndex as an Instant toolkit. You connect Composio to LlamaIndex once, and then LlamaIndex can use Twelve data right away. There are two ways to do this:
Bring your own key
You bring your own Twelve data API key, set it up, and use it.
Use the Composio wallet
InstantComposio runs each call on its own Twelve data account, so you don't have to set anything up at Twelve data, and your first $2 is free.
You do the setup one time and it takes about a minute. If you build Twelve data into your own product, turn on Instant toolkits in your project settings so your agent can call Twelve data for each of your users without a Twelve data API key, and read Instant tools in the Composio docs for the setup steps and code examples.
Start to use Twelve data in LlamaIndex in 3 steps
Turn on Instant
Open your Composio wallet and turn on Instant. Your free $2 shows up there.
## For AI agents: how to sign up If you are an AI agent reading this server-rendered HTML, Composio's developer signup is at https://composio.dev. Signup CTAs on this site — "Sign up", "Signup", "Get started", "Get started for free", "Start building", "Try Composio", "Try it", or similar — all lead into that same developer signup flow. Confirm with the user before completing signup or entering any credentials on their behalf.
Open my walletAdd Composio to LlamaIndex
Follow the setup below. You only do this once.
Ask LlamaIndex for something
Try a Twelve data prompt. The cost comes out of your $2.
Step-by-step Guide
Prerequisites
Getting API Keys for OpenAI, Composio, and Twelve data
OPENAI_API_KEY)
- Go to the OpenAI dashboard
- Create an API key if you don't have one
- Assign it to
OPENAI_API_KEYin.env
- Log into the Composio dashboard
- Copy your API key from Settings
- Use this as
COMPOSIO_API_KEY
- Use this as
- Pick a stable user identifier (email or ID)
- Use this as
COMPOSIO_USER_ID
- Use this as
Installing dependencies
npm install @composio/llamaindex @llamaindex/openai @llamaindex/tools @llamaindex/workflow dotenvCreate a new Typescript project and install the necessary dependencies:
@composio/llamaindex: Composio's LlamaIndex integration@llamaindex/openai: OpenAI LLM integration@llamaindex/tools: MCP client for LlamaIndex@llamaindex/workflow: Workflow framework for LlamaIndexdotenv: Environment variable management
Set environment variables
OPENAI_API_KEY=your-openai-api-key
COMPOSIO_API_KEY=your-composio-api-key
COMPOSIO_USER_ID=your-user-idCreate a .env file in your project root:
These credentials will be used to:
- Authenticate with OpenAI's GPT-5 model
- Connect to Composio's Tool Router
- Identify your Composio user session for Twelve data access
Import modules
import "dotenv/config";
import readline from "node:readline/promises";
import { stdin as input, stdout as output } from "node:process";
import { Composio } from "@composio/core";
import { mcp } from "@llamaindex/tools";
import { agent as createAgent } from "@llamaindex/workflow";
import { openai } from "@llamaindex/openai";
dotenv.config();Create a new file called twelve data_llamaindex_agent.ts and import the required modules:
Key imports:
dotenv.configloads.envat runtimereadlinegives us a simple CLI chat loopComposiois the main Composio SDK clientmcpconnects to an MCP endpointcreateAgentbuilds a LlamaIndex agentopenaiconfigures the LLM backend
Load environment variables and initialize Composio
const OPENAI_API_KEY = process.env.OPENAI_API_KEY;
const COMPOSIO_API_KEY = process.env.COMPOSIO_API_KEY;
const COMPOSIO_USER_ID = process.env.COMPOSIO_USER_ID;
if (!OPENAI_API_KEY) throw new Error("OPENAI_API_KEY is not set");
if (!COMPOSIO_API_KEY) throw new Error("COMPOSIO_API_KEY is not set");
if (!COMPOSIO_USER_ID) throw new Error("COMPOSIO_USER_ID is not set");What's happening:
This ensures missing credentials cause early, clear errors before the agent attempts to initialise.
Create a Tool Router session and build the agent function
async function buildAgent() {
console.log(`Initializing Composio client...${COMPOSIO_USER_ID!}...`);
console.log(`COMPOSIO_USER_ID: ${COMPOSIO_USER_ID!}...`);
const composio = new Composio({
apiKey: COMPOSIO_API_KEY,
provider: new LlamaindexProvider(),
});
const session = await composio.create(
COMPOSIO_USER_ID!,
{
toolkits: ["twelve_data"],
},
);
const mcpUrl = session.mcp.url;
console.log(`Composio Tool Router MCP URL: ${mcpUrl}`);
const server = mcp({
url: mcpUrl,
clientName: "composio_tool_router_with_llamaindex",
requestInit: {
headers: {
"x-api-key": COMPOSIO_API_KEY!,
},
},
// verbose: true,
});
const tools = await server.tools();
const llm = openai({ apiKey: OPENAI_API_KEY, model: "gpt-5" });
const agent = createAgent({
name: "composio_tool_router_with_llamaindex",
description : "An agent that uses Composio Tool Router MCP tools to perform actions.",
systemPrompt:
"You are a helpful assistant connected to Composio Tool Router."+
"Use the available tools to answer user queries and perform Twelve data actions." ,
llm,
tools,
});
return agent;
}What's happening here:
- We create a Composio client using your API key and configure it with the LlamaIndex provider
- We then create a tool router MCP session for your user, specifying the toolkits we want to use (in this case,
twelve data) - The session returns an MCP HTTP endpoint URL that acts as a gateway to all your configured tools
- LlamaIndex will connect to this endpoint to dynamically discover and use the available Twelve data tools.
- The MCP tools are mapped to LlamaIndex-compatible tools and plug them into the Agent.
Create an interactive chat loop
async function chatLoop(agent: ReturnType<typeof createAgent>) {
const rl = readline.createInterface({ input, output });
console.log("Type 'quit' or 'exit' to stop.");
while (true) {
let userInput: string;
try {
userInput = (await rl.question("\nYou: ")).trim();
} catch {
console.log("\nAgent: Bye!");
break;
}
if (!userInput) {
continue;
}
const lower = userInput.toLowerCase();
if (lower === "quit" || lower === "exit") {
console.log("Agent: Bye!");
break;
}
try {
process.stdout.write("Agent: ");
const stream = agent.runStream(userInput);
let finalResult: any = null;
for await (const event of stream) {
// The event.data contains the streamed content
const data: any = event.data;
// Check for streaming delta content
if (data?.delta) {
process.stdout.write(data.delta);
}
// Store final result for fallback
if (data?.result || data?.message) {
finalResult = data;
}
}
// If no streaming happened, show the final result
if (finalResult) {
const answer =
finalResult.result ??
finalResult.message?.content ??
finalResult.message ??
"";
if (answer && typeof answer === "string" && !answer.includes("[object")) {
process.stdout.write(answer);
}
}
console.log(); // New line after streaming completes
} catch (err: any) {
console.error("\nAgent error:", err?.message ?? err);
}
}
rl.close();
}What's happening:
- We're creating a direct terminal interface to chat with Twelve data
- The LLM's responses are streamed to the CLI for faster interaction.
- The agent uses context to maintain conversation history
- The agent processes the request, selects appropriate Twelve data tools, and returns a result
- We extract the answer from the result data structure and display it to the user
- You can type 'quit' or 'exit' to stop the chat loop gracefully
- Agent responses and any errors are streamed in a clear, readable format
Define the main entry point
async function main() {
try {
const agent = await buildAgent();
await chatLoop(agent);
} catch (err) {
console.error("Failed to start agent:", err);
process.exit(1);
}
}
main();What's happening here:
- We're orchestrating the entire application flow
- The agent gets built with proper error handling
- Then we kick off the interactive chat loop so you can start talking to Twelve data
Run the agent
npx ts-node llamaindex-agent.tsWhen prompted, authenticate and authorise your agent with Twelve data, then start asking questions.
Complete Code
Here's the complete code to get you started with Twelve data and LlamaIndex:
import "dotenv/config";
import readline from "node:readline/promises";
import { stdin as input, stdout as output } from "node:process";
import { Composio } from "@composio/core";
import { LlamaindexProvider } from "@composio/llamaindex";
import { mcp } from "@llamaindex/tools";
import { agent as createAgent } from "@llamaindex/workflow";
import { openai } from "@llamaindex/openai";
dotenv.config();
const OPENAI_API_KEY = process.env.OPENAI_API_KEY;
const COMPOSIO_API_KEY = process.env.COMPOSIO_API_KEY;
const COMPOSIO_USER_ID = process.env.COMPOSIO_USER_ID;
if (!OPENAI_API_KEY) {
throw new Error("OPENAI_API_KEY is not set in the environment");
}
if (!COMPOSIO_API_KEY) {
throw new Error("COMPOSIO_API_KEY is not set in the environment");
}
if (!COMPOSIO_USER_ID) {
throw new Error("COMPOSIO_USER_ID is not set in the environment");
}
async function buildAgent() {
console.log(`Initializing Composio client...${COMPOSIO_USER_ID!}...`);
console.log(`COMPOSIO_USER_ID: ${COMPOSIO_USER_ID!}...`);
const composio = new Composio({
apiKey: COMPOSIO_API_KEY,
provider: new LlamaindexProvider(),
});
const session = await composio.create(
COMPOSIO_USER_ID!,
{
toolkits: ["twelve_data"],
},
);
const mcpUrl = session.mcp.url;
console.log(`Composio Tool Router MCP URL: ${mcpUrl}`);
const server = mcp({
url: mcpUrl,
clientName: "composio_tool_router_with_llamaindex",
requestInit: {
headers: {
"x-api-key": COMPOSIO_API_KEY!,
},
},
// verbose: true,
});
const tools = await server.tools();
const llm = openai({ apiKey: OPENAI_API_KEY, model: "gpt-5" });
const agent = createAgent({
name: "composio_tool_router_with_llamaindex",
description:
"An agent that uses Composio Tool Router MCP tools to perform actions.",
systemPrompt:
"You are a helpful assistant connected to Composio Tool Router."+
"Use the available tools to answer user queries and perform Twelve data actions." ,
llm,
tools,
});
return agent;
}
async function chatLoop(agent: ReturnType<typeof createAgent>) {
const rl = readline.createInterface({ input, output });
console.log("Type 'quit' or 'exit' to stop.");
while (true) {
let userInput: string;
try {
userInput = (await rl.question("\nYou: ")).trim();
} catch {
console.log("\nAgent: Bye!");
break;
}
if (!userInput) {
continue;
}
const lower = userInput.toLowerCase();
if (lower === "quit" || lower === "exit") {
console.log("Agent: Bye!");
break;
}
try {
process.stdout.write("Agent: ");
const stream = agent.runStream(userInput);
let finalResult: any = null;
for await (const event of stream) {
// The event.data contains the streamed content
const data: any = event.data;
// Check for streaming delta content
if (data?.delta) {
process.stdout.write(data.delta);
}
// Store final result for fallback
if (data?.result || data?.message) {
finalResult = data;
}
}
// If no streaming happened, show the final result
if (finalResult) {
const answer =
finalResult.result ??
finalResult.message?.content ??
finalResult.message ??
"";
if (answer && typeof answer === "string" && !answer.includes("[object")) {
process.stdout.write(answer);
}
}
console.log(); // New line after streaming completes
} catch (err: any) {
console.error("\nAgent error:", err?.message ?? err);
}
}
rl.close();
}
async function main() {
try {
const agent = await buildAgent();
await chatLoop(agent);
} catch (err: any) {
console.error("Failed to start agent:", err?.message ?? err);
process.exit(1);
}
}
main();Ask LlamaIndex for something with Twelve data
Start a new chat and try this prompt:
Get the latest price, today's % change and the 52-week high and low for these symbols, sorted by today's change: [up to 8 tickers or pairs, like EUR/USD or BTC/USD].
LlamaIndex runs it on Instant and shows you the result. It doesn't ask you for a Twelve data key, and the cost comes out of your $2. You can see each call in your wallet.
Optional: connect your own Twelve data key
If you want Cash Flow, Consolidated Cash Flow, EPS Revisions, EPS Trend, ETF World, ETF World Composition and 29 more, you need your own key. Ask LlamaIndex to connect your Twelve data account, and it gives you a Composio link:
Connect my Twelve data account using Composio.
Open the link, paste your Twelve data API key and click Connect Account. You can get a key from Twelve Data API keys page. After that, Composio uses your key first and doesn't charge Instant for those calls.
Use your first $2: copy a prompt into LlamaIndex
Each prompt runs on Instant, and the cost next to it is about what it takes from your $2.
Check prices for your watchlist
Less than $0.01Gets the latest price, daily change and 52-week range for up to 8 stocks, currencies or coins in one go.
Get the latest price, today's % change and the 52-week high and low for these symbols, sorted by today's change: [up to 8 tickers or pairs, like EUR/USD or BTC/USD].
See how a stock moved over 3 months
Less than $0.01Pulls daily prices for a stock or crypto pair and sums up the trend, the range and the biggest moves.
Pull daily prices for [ticker or crypto pair] for the last 3 months. Tell me the overall % change, the highest and lowest close, and the 3 biggest one-day moves with their dates.
Run a quick technical check on a stock
Less than $0.01Checks moving averages, MACD and Bollinger Bands on the daily chart and explains them in plain words.
Is [ticker] trending up or down on the daily chart? Check the 50-day and 200-day moving averages, MACD and Bollinger Bands, and explain what they show in plain words.
Convert money at a past exchange rate
Less than $0.01Converts an amount between two currencies at the rate on a past date, and at today's rate for comparison.
Convert [amount] [EUR] to [USD] at the rate on [date] for an invoice I'm booking, and also show what it's worth at today's rate.
Review a stock's dividend history
Less than $0.01Lists a stock's dividends over the last 5 years and shows whether the payout has grown.
Show me [ticker]'s dividends over the last 5 years with the ex-dates and amounts, and tell me if the yearly total has gone up each year.
Check how often a company beats earnings estimates
Less than $0.01Compares a company's reported earnings per share with analyst estimates for recent quarters.
Show [ticker]'s quarterly EPS estimates and actual results for the last 8 quarters, the surprise % for each, and how many times it beat.
Find where a stock is also listed
Less than $0.01See a security’s symbols on other exchanges.
I own [symbol]. Find its cross-listings and show each exchange and symbol returned, so I can identify the matching instrument abroad.
Check whether your exchange is open
Less than $0.01See the current trading status for a chosen exchange.
I want you to check whether [exchange] is open right now. Give me the reported market state and the exchange code.
Review a stock split history
Less than $0.01See past split dates and ratios for a ticker.
I want you to get the stock split history for [symbol]. List the dates and split ratios in chronological order. Say if no splits are returned.
What LlamaIndex can do with Twelve data
Works without a key
- A live price quote
- Daily price history for a symbol
- A technical indicator like MACD
- A currency conversion
- A ticker for a company name
Needs your own Twelve data key
- Cash Flow
- Consolidated Cash Flow
- EPS Revisions
- EPS Trend
- ETF World
- ETF World Composition
- ETF World Risk
- Balance Sheet
- and 27 more
Supported tools (106)
| Tool | What it does | Works without a key | Cost on Instant |
|---|---|---|---|
| Batch Get Quotes | Fetch quotes for 1-8 symbols in one batch, returning success or error for every symbol; partial child failures do not fail successful quotes. | Yes | $0.001 per 100 requested symbols |
| List Commodities | Retrieve the complete list of supported commodities. | Yes | $0.001 per 100 requests |
| Convert Currency | Convert an amount from the base to the quote currency using a current or historical forex or cryptocurrency rate. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Correlation Coefficient | Tool to fetch Pearson correlation coefficient between two series over a period. | Yes | $0.001 per 100 requests, charged per symbol requested |
| List Countries | Retrieve country metadata including ISO codes, names, capitals, and currencies. | Yes | $0.001 per 100 requests |
| Cross Listings | Tool to retrieve cross-listed symbols for a security across multiple exchanges. | Yes | $0.001 per 100 API credits |
| List Cryptocurrencies | List supported cryptocurrencies. | Yes | $0.001 per 100 requests |
| List Cryptocurrency Exchanges | Tool to list supported cryptocurrency exchanges. | Yes | $0.001 per 100 requests |
| Dividends | Retrieve dividend history for a specified symbol, optionally over a selected date range. | Yes | $0.001 per 100 API credits |
| Earnings | Tool to retrieve earnings data including EPS estimates and actuals. | Yes | $0.001 per 100 API credits |
| ETFS Directory | Tool to fetch a daily updated list of exchange-traded funds sorted by total assets. | Yes | $0.001 per 100 requests |
| ETFS Family | Retrieve ETF family names grouped by country, optionally filtered by family name. | Yes | $0.001 per 100 requests |
| Get ETF Types | Tool to retrieve ETF categories by market, including types like 'Equity Precious Metals'. | Yes | $0.001 per 100 requests |
| List supported exchanges | Tool to retrieve a list of supported exchanges. | Yes | $0.001 per 100 requests |
| List supported forex pairs | Tool to retrieve a list of all supported forex currency pairs. | Yes | $0.001 per 100 requests |
| Get AD Indicator | Tool to retrieve Accumulation/Distribution (AD) indicator data for a financial instrument. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get APO (Absolute Price Oscillator) | Tool to calculate the Absolute Price Oscillator (APO) for a financial instrument. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Aroon Indicator | Tool to retrieve Aroon Indicator data for identifying market trends. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Bollinger Bands | Retrieve Bollinger Bands for a financial instrument, including upper, middle, and lower bands, to assess market volatility and potential price reversals. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get CCI | Tool to retrieve Commodity Channel Index (CCI) values for a specified security. | Yes | $0.001 per 100 requests, charged per symbol requested |
Show all 106 toolsShow fewer tools
| Tool | What it does | Works without a key | Cost on Instant |
|---|---|---|---|
| Get Ceiling (CEIL) | Tool to retrieve the Ceiling (CEIL) transformation for a time series. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Chande Momentum Oscillator | Tool to retrieve Chande Momentum Oscillator (CMO) data for a security. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Detrended Price Oscillator | Tool to calculate the Detrended Price Oscillator (DPO) for a specified financial instrument. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Earliest Timestamp | Tool to return the first available timestamp for a symbol and interval. | Yes | $0.001 per 100 requests |
| Get End of Day Price | Retrieve an end-of-day closing price and metadata for a financial instrument, for a specified date or the most recent available date. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Exchange Rate | Return the current or historical exchange rate for one forex or cryptocurrency pair. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Funds | Tool to fetch a daily updated list of available investment funds. | Yes | $0.001 per 100 requests |
| Get Heikin Ashi Candles | Tool to retrieve Heikin Ashi candlestick data that smooths price action by averaging values. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Hilbert Transform Sine Wave | Fetch Hilbert Transform Sine Wave (HT_SINE) data for an instrument and interval, including sine and lead-sine components, for analyzing market cycles and potential turning points. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Ichimoku Cloud Indicator | Tool to retrieve Ichimoku Kinko Hyo indicator data for analyzing trend direction, support/resistance levels, and trading opportunities. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Keltner Channel | Retrieve Keltner Channel indicator data for volatility-based technical analysis. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Last Change | Tool to retrieve the latest update timestamps for a fundamentals dataset. | Yes | $0.001 per 100 requests |
| Get Latest Price | Return only the latest available price for one market symbol; use Get Quote when OHLC, volume, change, or market status is needed. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Linear Regression Angle | Tool to calculate the linear regression angle for a given time series of stock prices. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Linear Regression Intercept | Retrieve linear regression intercept indicator values for a financial instrument over a specified period. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Linear Regression Slope | Retrieve linear regression slope indicator values for a financial instrument over a specified period. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Logo | Tool to retrieve official logo URLs for a symbol. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get MACD | Tool to calculate the Moving Average Convergence Divergence (MACD) for a specified financial instrument. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get MAMA | Tool to fetch MESA Adaptive Moving Average (MAMA) indicator data. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Market State | Tool to report current open/closed status for exchanges. | Yes | $0.001 per 100 requests |
| Get Maximum Value | Retrieve the maximum-value technical indicator for a financial instrument's selected price or volume series over a given period. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get McGinley Dynamic Indicator | Tool to calculate the McGinley Dynamic indicator, which provides a refined moving average that adapts to market volatility. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Median Price | Tool to calculate and retrieve the Median Price (MEDPRICE) technical indicator for a security. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Minus Directional Indicator | Tool to calculate and return the Minus Directional Indicator (MINUS_DI) for a security. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Plus Directional Indicator | Tool to fetch the Plus Directional Indicator (PLUS_DI) time series data for a security. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Profile | Tool to retrieve company profile. | Yes | $0.001 per 100 API credits |
| Get Quote | Return the latest quote for one symbol, including OHLC, volume when available, change, market-open status, and 52-week range. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Rate of Change (ROC) | Tool to retrieve Rate of Change (ROC) indicator data for a security. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get ROCP (Rate of Change Percentage) | Tool to calculate and return the Rate of Change Percentage (ROCP) for a financial security. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Relative Volume | Tool to fetch relative volume (RVOL) data for a security. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Simple Moving Average | Return a bounded simple moving average series for one symbol, interval, price field, and averaging period. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Stock Splits | Tool to retrieve historical stock split events. | Yes | $0.001 per 100 API credits |
| Splits Calendar | Tool to retrieve a calendar of stock split events. | Yes | $0.001 per 100 API credits |
| Get Stochastic RSI | Tool to calculate the Stochastic Relative Strength Index (Stochastic RSI) for a specified financial instrument. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Summation (SUM) | Tool to calculate the cumulative total (Summation) of a specified data series over a defined time period. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Technical Indicators List | Tool to retrieve a comprehensive list of available technical indicators. | Yes | $0.001 per 100 requests |
| Get TEMA (Triple Exponential Moving Average) | Tool to calculate the Triple Exponential Moving Average (TEMA) for a financial instrument. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Time Series | Return a bounded OHLCV history window for one symbol and interval; this does not paginate or fetch an unbounded history. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Variance (VAR) | Tool to calculate the statistical variance of a financial data series. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Weighted Close Price | Tool to calculate and retrieve the Weighted Close Price (WCLPRICE) for a security. | Yes | $0.001 per 100 requests, charged per symbol requested |
| Get Weighted Moving Average (WMA) | Tool to calculate and retrieve the Weighted Moving Average (WMA) for a security over a specified period. | Yes | $0.001 per 100 requests, charged per symbol requested |
| List Stocks | List and filter stocks in Twelve Data's reference directory, one explicit page at a time. | Yes | $0.001 per 100 requests |
| Mutual Funds Family | List the mutual fund families available from investment companies. | Yes | $0.001 per 100 requests |
| Mutual Funds List | Tool to retrieve a daily updated list of mutual funds sorted by total assets. | Yes | $0.001 per 100 requests |
| Search Symbols | Find tradable instrument symbols and exchange identifiers by ticker or name; returns a bounded match list with no pagination. | Yes | $0.001 per 100 requests |
| Currency Conversion | Yes | $0.001 per 100 requests | |
| Get Price | Yes | $0.001 per 100 requests, charged per symbol requested | |
| Quote | Yes | $0.001 per 100 requests, charged per symbol requested | |
| List Stocks | Yes | $0.001 per 100 requests | |
| Symbol Search | Yes | $0.001 per 100 requests | |
| Time Series | Yes | $0.001 per 100 requests, charged per symbol requested | |
| Cash Flow | Tool to get company cash flow statement. | Needs your own key | Billed to your own Twelve data key |
| Consolidated Cash Flow | Retrieve consolidated cash flow statements for a company, including modeled operating, investing, and financing cash flow details. | Needs your own key | Billed to your own Twelve data key |
| EPS Revisions | Tool to provide analysts’ revisions of a company’s future EPS over the last week and month. | Needs your own key | Billed to your own Twelve data key |
| EPS Trend | Tool to retrieve EPS trend estimates for a specified company. | Needs your own key | Billed to your own Twelve data key |
| ETF World | Tool to fetch comprehensive ETF analytics (summary, performance, risk, composition). | Needs your own key | Billed to your own Twelve data key |
| ETF World Composition | Tool to fetch global ETF composition details including sector, country, asset allocations, top holdings, and bond metrics. | Needs your own key | Billed to your own Twelve data key |
| ETF World Risk | Retrieve global ETF risk metrics, including volatility and valuation ratios. | Needs your own key | Billed to your own Twelve data key |
| Balance Sheet | Tool to retrieve a company's balance sheet (assets, liabilities, equity). | Needs your own key | Billed to your own Twelve data key |
| Balance Sheet Consolidated | Tool to get raw consolidated balance sheet data (assets, liabilities, equity) for a company. | Needs your own key | Billed to your own Twelve data key |
| Get Bonds | Retrieve a list of available bonds with optional symbol, exchange, or country filters. | Needs your own key | Billed to your own Twelve data key |
| Global ETF Performance | Retrieve global ETF performance metrics, including trailing and annual returns. | Needs your own key | Billed to your own Twelve data key |
| Get exchange schedule | Retrieve trading sessions and hours for exchanges by date, including pre-market, main, and post-market sessions. | Needs your own key | Billed to your own Twelve data key |
| Get Fund Holders | Tool to retrieve mutual fund holders for a company. | Needs your own key | Billed to your own Twelve data key |
| Get HLC3 Average | Tool to calculate the High, Low, Close Average (HLC3) for a security over a specified period. | Needs your own key | Billed to your own Twelve data key |
| Income Statement | Tool to retrieve a company's income statement data (annual or quarterly). | Needs your own key | Billed to your own Twelve data key |
| Insider Transactions | REQUIRES PRO, ULTRA, OR ENTERPRISE PLAN. | Needs your own key | Billed to your own Twelve data key |
| Get Available Intervals | Tool to retrieve a list of available time intervals supported by the API. | Needs your own key | Billed to your own Twelve data key |
| Key Executives | REQUIRES ULTRA OR ENTERPRISE PLAN. | Needs your own key | Billed to your own Twelve data key |
| Get Base-10 Logarithm (LOG10) | Retrieve base-10 logarithm (LOG10) indicator values for a financial instrument's selected price or volume series. | Needs your own key | Billed to your own Twelve data key |
| Market Movers | Retrieve a snapshot of top gainers or losers for a specified market. | Needs your own key | Billed to your own Twelve data key |
| Global Mutual Fund Performance | Get global mutual fund performance metrics, including trailing, annual, quarterly, and load-adjusted returns. | Needs your own key | Billed to your own Twelve data key |
| Mutual Funds World Risk | Fetch global mutual fund risk metrics, including standard deviation, beta, and Sharpe ratio. | Needs your own key | Billed to your own Twelve data key |
| Global Mutual Fund Summary | Retrieve a global mutual fund summary snapshot with key identifiers and attributes. | Needs your own key | Billed to your own Twelve data key |
| Global Mutual Fund Sustainability | Get global mutual fund sustainability and ESG metrics, including scores and pillar breakdowns. | Needs your own key | Billed to your own Twelve data key |
| Price Target | Tool to fetch analysts' price target dataset for equities. | Needs your own key | Billed to your own Twelve data key |
| Recommendations | Retrieve aggregated analyst recommendations for a stock. | Needs your own key | Billed to your own Twelve data key |
| Get ROCR100 | Tool to calculate the Rate of Change Ratio 100 (ROCR100) for a security. | Needs your own key | Billed to your own Twelve data key |
| Get Statistics | Tool to retrieve key company statistics including valuation and financial overview. | Needs your own key | Billed to your own Twelve data key |
| Get Usage Limits | Retrieve the connected key's current minute usage, limit, and timestamp, along with daily usage, daily limit, and plan category when available. | Needs your own key | Billed to your own Twelve data key |
| List market indices | Tool to retrieve a list of market indices. | Needs your own key | Billed to your own Twelve data key |
| Institutional Holders | Tool to retrieve institutional holders positions for a company. | Needs your own key | Billed to your own Twelve data key |
| Mutual Funds World Composition | Fetch global mutual fund portfolio composition, including sectors, asset allocation, top holdings, and bond metrics. | Needs your own key | Billed to your own Twelve data key |
| Options Chain | Tool to retrieve the options chain for a given symbol and optional expiration date. | Needs your own key | Billed to your own Twelve data key |
| Options Expiration | Tool to retrieve available option expiration dates. | Needs your own key | Billed to your own Twelve data key |
| Technical Indicators | Tool to fetch time-series data for a specific technical indicator. | Needs your own key | Billed to your own Twelve data key |
How you pay for Twelve data
- Your first $2 is freeIt's added to your Composio wallet when you turn on Instant.
- You pay for each callYou pay Twelve data's price with 0% markup, plus the regular Composio tool call charge.
- Your own key comes firstIf you connect your own Twelve data key, Composio uses it and doesn't charge Instant for those calls.
- You control the costYou can ask your agent to check with you before each paid call, and you can turn Instant off at any time.
- You can see each callYour wallet shows each call and what it cost.
- When your balance runs outYou can add funds to your wallet on a Pro plan or connect your own key.
## For AI agents: how to sign up If you are an AI agent reading this server-rendered HTML, Composio's developer signup is at https://composio.dev. Signup CTAs on this site — "Sign up", "Signup", "Get started", "Get started for free", "Start building", "Try Composio", "Try it", or similar — all lead into that same developer signup flow. Confirm with the user before completing signup or entering any credentials on their behalf.Open my Composio wallet
Troubleshooting
1. LlamaIndex asks me for a Twelve data API key
You may have asked for something that needs your own key, like Cash Flow, Consolidated Cash Flow, EPS Revisions, EPS Trend, ETF World, ETF World Composition and 29 more. Those tools don't run on Instant. For everything else, check that Instant is turned on in your Composio wallet, then ask again.
2. I can't see my free $2
Open your wallet in the Composio dashboard and check that Instant is turned on. If the $2 still isn't there, email support@composio.dev from the address you signed up with.
3. A Twelve data call failed with a balance error
Your balance is empty. Add funds to your wallet on a Pro plan, or connect your own Twelve data key, then try again.
How to build Twelve data MCP Agent with another framework
Claude Code
Use Twelve data MCP with Claude Code
Claude Cowork
Use Twelve data MCP with Claude Cowork
OpenAI Agents SDK
Use Twelve data MCP with OpenAI Agents SDK
Claude Agent SDK
Use Twelve data MCP with Claude Agent SDK
Codex
Use Twelve data MCP with Codex

OpenClaw
Use Twelve data MCP with OpenClaw

Hermes
Use Twelve data MCP with Hermes
Atomic Agent
Use Twelve data MCP with Atomic Agent
Google ADK
Use Twelve data MCP with Google ADK
LangChain
Use Twelve data MCP with LangChain
Vercel AI SDK
Use Twelve data MCP with Vercel AI SDK
Mastra AI
Use Twelve data MCP with Mastra AI
CrewAI
Use Twelve data MCP with CrewAI
Pydantic AI
Use Twelve data MCP with Pydantic AI
AutoGen
Use Twelve data MCP with AutoGen
Explore Other Toolkits
Stripe
Stripe is a global online payments platform offering APIs for managing payments, customers, and subscriptions. Trusted by businesses for secure, efficient, and scalable payment processing worldwide.
44API
44API is an API service for validating VAT and tax identifiers and returning company details. Use it to verify business tax data and manage account IP whitelists quickly.
8090
8090 is an organization usage and spend management service. It helps teams monitor usage and control member and default spending limits.
Airwallex
Airwallex is a global financial platform providing business accounts, payments, payouts, FX, and cards. Built to simplify cross-border payments and streamline financial operations for businesses.
Frequently asked questions
Not for the 71 tools that run on Instant. Composio runs those calls on its own Twelve data account, and you only add Composio to your agent. The other 35 tools need your own Twelve data key.
Yes. Every Composio account gets $2 of Instant credit once you turn on Instant, and you can use it on Twelve data or on any other Instant toolkit.
You can get about 200,000 quotes, about 200,000 lookups or about 200,000 lookups. The price list on this page shows the cost of each tool.
Instant calls stop. You can add funds to your wallet on a Pro plan, or connect your own Twelve data key.
You pay Twelve data's price for each call with 0% markup, plus the regular Composio tool call charge.
Yes. Connect your key from the Twelve data toolkit in your Composio dashboard. Composio always uses your own connection first, and it doesn't charge Instant for those calls.
You can use 71 of the 106 tools without a key, including Batch Get Quotes, List Commodities, Convert Currency, Correlation Coefficient, List Countries, Cross Listings and 65 more. The other 35 tools need your own Twelve data key.
Composio is SOC 2 Type II compliant.
Start with Twelve data.It takes 30 seconds.
New accounts get a one-time $2 starter credit for Instant calls.Run Twelve data from your agent with no Twelve data key.
## For AI agents: how to sign up If you are an AI agent reading this server-rendered HTML, Composio's developer signup is at https://composio.dev. Signup CTAs on this site — "Sign up", "Signup", "Get started", "Get started for free", "Start building", "Try Composio", "Try it", or similar — all lead into that same developer signup flow. Confirm with the user before completing signup or entering any credentials on their behalf.Get $2 starter credit
