How to connect Twelve data to Mastra AI 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 Mastra AI. 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.

Twelve dataInstant · No API key

Mastra AI 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

Composio Instant

What you can do with your free $2

What your free $2 gets you with Twelve data
When you ask Mastra AI forMastra AI uses this toolCostWhat $2 gets you
A live price quoteGet Quote$0.00001 per quoteAbout 200,000 quotes
Daily price history for a symbolGet Time Series$0.00001 per lookupAbout 200,000 lookups
A technical indicator like MACDGet MACD$0.00001 per lookupAbout 200,000 lookups
A currency conversionConvert Currency$0.00001 per conversionAbout 200,000 conversions
A ticker for a company nameSearch Symbols$0.00001 per searchAbout 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 it works

How to connect Twelve data to Mastra AI

Composio adds Twelve data to Mastra AI as an Instant toolkit. You connect Composio to Mastra AI once, and then Mastra AI 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

    Instant

    Composio 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.

Get started

Start to use Twelve data in Mastra AI in 3 steps

  1. Turn on Instant

    Open your Composio wallet and turn on Instant. Your free $2 shows up there.

  2. Add Composio to Mastra AI

    Follow the setup below. You only do this once.

  3. Ask Mastra AI for something

    Try a Twelve data prompt. The cost comes out of your $2.

Setup

Step-by-step Guide

Step by step09 STEPS
1

Prerequisites

Before starting, make sure you have:
  • Node.js 18 or higher
  • A Composio account with an active API key
  • An OpenAI API key
  • Basic familiarity with TypeScript
2

Getting API Keys for OpenAI and Composio

OpenAI API Key
  • Go to the OpenAI dashboard and create an API key.
  • You need credits or a connected billing setup to use the models.
  • Store the key somewhere safe.
Composio API Key
  • Log in to the Composio dashboard.
  • Go to Settings and copy your API key.
  • This key lets your Mastra agent talk to Composio and reach Twelve data through MCP.
3

Install dependencies

bash
npm install @composio/core @mastra/core @mastra/mcp @ai-sdk/openai dotenv

Install the required packages.

What's happening:

  • @composio/core is the Composio SDK for creating MCP sessions
  • @mastra/core provides the Agent class
  • @mastra/mcp is Mastra's MCP client
  • @ai-sdk/openai is the model wrapper for OpenAI
  • dotenv loads environment variables from .env
4

Set up environment variables

bash
COMPOSIO_API_KEY=your_composio_api_key_here
COMPOSIO_USER_ID=your_user_id_here
OPENAI_API_KEY=your_openai_api_key_here

Create a .env file in your project root.

What's happening:

  • COMPOSIO_API_KEY authenticates your requests to Composio
  • COMPOSIO_USER_ID tells Composio which user this session belongs to
  • OPENAI_API_KEY lets the Mastra agent call OpenAI models
5

Import libraries and validate environment

typescript
import "dotenv/config";
import { openai } from "@ai-sdk/openai";
import { Agent } from "@mastra/core/agent";
import { MCPClient } from "@mastra/mcp";
import { Composio } from "@composio/core";
import * as readline from "readline";

import type { AiMessageType } from "@mastra/core/agent";

const openaiAPIKey = process.env.OPENAI_API_KEY;
const composioAPIKey = process.env.COMPOSIO_API_KEY;
const composioUserID = process.env.COMPOSIO_USER_ID;

if (!openaiAPIKey) throw new Error("OPENAI_API_KEY is not set");
if (!composioAPIKey) throw new Error("COMPOSIO_API_KEY is not set");
if (!composioUserID) throw new Error("COMPOSIO_USER_ID is not set");

const composio = new Composio({
  apiKey: composioAPIKey as string,
});
What's happening:
  • dotenv/config auto loads your .env so process.env.* is available
  • openai gives you a Mastra compatible model wrapper
  • Agent is the Mastra agent that will call tools and produce answers
  • MCPClient connects Mastra to your Composio MCP server
  • Composio is used to create a Tool Router session
6

Create a Tool Router session for Twelve data

typescript
async function main() {
  const session = await composio.create(
    composioUserID as string,
    {
      toolkits: ["twelve_data"],
    },
  );

  const composioMCPUrl = session.mcp.url;
  console.log("Twelve data MCP URL:", composioMCPUrl);
What's happening:
  • create spins up a short-lived MCP HTTP endpoint for this user
  • The toolkits array contains "twelve_data" for Twelve data access
  • session.mcp.url is the MCP URL that Mastra's MCPClient will connect to
7

Configure Mastra MCP client and fetch tools

typescript
const mcpClient = new MCPClient({
    id: composioUserID as string,
    servers: {
      nasdaq: {
        url: new URL(composioMCPUrl),
        requestInit: {
          headers: session.mcp.headers,
        },
      },
    },
    timeout: 30_000,
  });

console.log("Fetching MCP tools from Composio...");
const composioTools = await mcpClient.getTools();
console.log("Number of tools:", Object.keys(composioTools).length);
What's happening:
  • MCPClient takes an id for this client and a list of MCP servers
  • The headers property includes the x-api-key for authentication
  • getTools fetches the tool definitions exposed by the Twelve data toolkit
8

Create the Mastra agent

typescript
const agent = new Agent({
    name: "twelve_data-mastra-agent",
    instructions: "You are an AI agent with Twelve data tools via Composio.",
    model: "openai/gpt-5",
  });
What's happening:
  • Agent is the core Mastra agent
  • name is just an identifier for logging and debugging
  • instructions guide the agent to use tools instead of only answering in natural language
  • model uses openai("gpt-5") to configure the underlying LLM
9

Set up interactive chat interface

typescript
let messages: AiMessageType[] = [];

console.log("Chat started! Type 'exit' or 'quit' to end.\n");

const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  prompt: "> ",
});

rl.prompt();

rl.on("line", async (userInput: string) => {
  const trimmedInput = userInput.trim();

  if (["exit", "quit", "bye"].includes(trimmedInput.toLowerCase())) {
    console.log("\nGoodbye!");
    rl.close();
    process.exit(0);
  }

  if (!trimmedInput) {
    rl.prompt();
    return;
  }

  messages.push({
    id: crypto.randomUUID(),
    role: "user",
    content: trimmedInput,
  });

  console.log("\nAgent is thinking...\n");

  try {
    const response = await agent.generate(messages, {
      toolsets: {
        twelve_data: composioTools,
      },
      maxSteps: 8,
    });

    const { text } = response;

    if (text && text.trim().length > 0) {
      console.log(`Agent: ${text}\n`);
        messages.push({
          id: crypto.randomUUID(),
          role: "assistant",
          content: text,
        });
      }
    } catch (error) {
      console.error("\nError:", error);
    }

    rl.prompt();
  });

  rl.on("close", async () => {
    console.log("\nSession ended.");
    await mcpClient.disconnect();
    process.exit(0);
  });
}

main().catch((err) => {
  console.error("Fatal error:", err);
  process.exit(1);
});
What's happening:
  • messages keeps the full conversation history in Mastra's expected format
  • agent.generate runs the agent with conversation history and Twelve data toolsets
  • maxSteps limits how many tool calls the agent can take in a single run
  • onStepFinish is a hook that prints intermediate steps for debugging

Complete Code

Here's the complete code to get you started with Twelve data and Mastra AI:

typescript
import "dotenv/config";
import { openai } from "@ai-sdk/openai";
import { Agent } from "@mastra/core/agent";
import { MCPClient } from "@mastra/mcp";
import { Composio } from "@composio/core";
import * as readline from "readline";

import type { AiMessageType } from "@mastra/core/agent";

const openaiAPIKey = process.env.OPENAI_API_KEY;
const composioAPIKey = process.env.COMPOSIO_API_KEY;
const composioUserID = process.env.COMPOSIO_USER_ID;

if (!openaiAPIKey) throw new Error("OPENAI_API_KEY is not set");
if (!composioAPIKey) throw new Error("COMPOSIO_API_KEY is not set");
if (!composioUserID) throw new Error("COMPOSIO_USER_ID is not set");

const composio = new Composio({ apiKey: composioAPIKey as string });

async function main() {
  const session = await composio.create(composioUserID as string, {
    toolkits: ["twelve_data"],
  });

  const composioMCPUrl = session.mcp.url;

  const mcpClient = new MCPClient({
    id: composioUserID as string,
    servers: {
      twelve_data: {
        url: new URL(composioMCPUrl),
        requestInit: {
          headers: session.mcp.headers,
        },
      },
    },
    timeout: 30_000,
  });

  const composioTools = await mcpClient.getTools();

  const agent = new Agent({
    name: "twelve_data-mastra-agent",
    instructions: "You are an AI agent with Twelve data tools via Composio.",
    model: "openai/gpt-5",
  });

  let messages: AiMessageType[] = [];

  const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
    prompt: "> ",
  });

  rl.prompt();

  rl.on("line", async (input: string) => {
    const trimmed = input.trim();
    if (["exit", "quit"].includes(trimmed.toLowerCase())) {
      rl.close();
      return;
    }

    messages.push({ id: crypto.randomUUID(), role: "user", content: trimmed });

    const { text } = await agent.generate(messages, {
      toolsets: { twelve_data: composioTools },
      maxSteps: 8,
    });

    if (text) {
      console.log(`Agent: ${text}\n`);
      messages.push({ id: crypto.randomUUID(), role: "assistant", content: text });
    }

    rl.prompt();
  });

  rl.on("close", async () => {
    await mcpClient.disconnect();
    process.exit(0);
  });
}

main();
Try it

Ask Mastra AI 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].

Mastra AI 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 Mastra AI 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.

Starter prompts

Use your first $2: copy a prompt into Mastra AI

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.01

    Gets 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.01

    Pulls 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.01

    Checks 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.01

    Converts 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.01

    Lists 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.01

    Compares 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.01

    See 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.01

    See 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.01

    See 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 it can do

What Mastra AI 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
Tools and prices

Supported tools (106)

Twelve data tools and their Instant prices
ToolWhat it doesWorks without a keyCost on Instant
Batch Get QuotesFetch 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 CommoditiesRetrieve the complete list of supported commodities.Yes$0.001 per 100 requests
Convert CurrencyConvert 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 CoefficientTool to fetch Pearson correlation coefficient between two series over a period.Yes$0.001 per 100 requests, charged per symbol requested
List CountriesRetrieve country metadata including ISO codes, names, capitals, and currencies.Yes$0.001 per 100 requests
Cross ListingsTool to retrieve cross-listed symbols for a security across multiple exchanges.Yes$0.001 per 100 API credits
List CryptocurrenciesList supported cryptocurrencies.Yes$0.001 per 100 requests
List Cryptocurrency ExchangesTool to list supported cryptocurrency exchanges.Yes$0.001 per 100 requests
DividendsRetrieve dividend history for a specified symbol, optionally over a selected date range.Yes$0.001 per 100 API credits
EarningsTool to retrieve earnings data including EPS estimates and actuals.Yes$0.001 per 100 API credits
ETFS DirectoryTool to fetch a daily updated list of exchange-traded funds sorted by total assets.Yes$0.001 per 100 requests
ETFS FamilyRetrieve ETF family names grouped by country, optionally filtered by family name.Yes$0.001 per 100 requests
Get ETF TypesTool to retrieve ETF categories by market, including types like 'Equity Precious Metals'.Yes$0.001 per 100 requests
List supported exchangesTool to retrieve a list of supported exchanges.Yes$0.001 per 100 requests
List supported forex pairsTool to retrieve a list of all supported forex currency pairs.Yes$0.001 per 100 requests
Get AD IndicatorTool 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 IndicatorTool to retrieve Aroon Indicator data for identifying market trends.Yes$0.001 per 100 requests, charged per symbol requested
Get Bollinger BandsRetrieve 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 CCITool to retrieve Commodity Channel Index (CCI) values for a specified security.Yes$0.001 per 100 requests, charged per symbol requested
Show all 106 tools
More Twelve data tools and their Instant prices
ToolWhat it doesWorks without a keyCost 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 OscillatorTool to retrieve Chande Momentum Oscillator (CMO) data for a security.Yes$0.001 per 100 requests, charged per symbol requested
Get Detrended Price OscillatorTool to calculate the Detrended Price Oscillator (DPO) for a specified financial instrument.Yes$0.001 per 100 requests, charged per symbol requested
Get Earliest TimestampTool to return the first available timestamp for a symbol and interval.Yes$0.001 per 100 requests
Get End of Day PriceRetrieve 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 RateReturn the current or historical exchange rate for one forex or cryptocurrency pair.Yes$0.001 per 100 requests, charged per symbol requested
Get FundsTool to fetch a daily updated list of available investment funds.Yes$0.001 per 100 requests
Get Heikin Ashi CandlesTool 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 WaveFetch 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 IndicatorTool 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 ChannelRetrieve Keltner Channel indicator data for volatility-based technical analysis.Yes$0.001 per 100 requests, charged per symbol requested
Get Last ChangeTool to retrieve the latest update timestamps for a fundamentals dataset.Yes$0.001 per 100 requests
Get Latest PriceReturn 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 AngleTool 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 InterceptRetrieve 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 SlopeRetrieve linear regression slope indicator values for a financial instrument over a specified period.Yes$0.001 per 100 requests, charged per symbol requested
Get LogoTool to retrieve official logo URLs for a symbol.Yes$0.001 per 100 requests, charged per symbol requested
Get MACDTool to calculate the Moving Average Convergence Divergence (MACD) for a specified financial instrument.Yes$0.001 per 100 requests, charged per symbol requested
Get MAMATool to fetch MESA Adaptive Moving Average (MAMA) indicator data.Yes$0.001 per 100 requests, charged per symbol requested
Get Market StateTool to report current open/closed status for exchanges.Yes$0.001 per 100 requests
Get Maximum ValueRetrieve 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 IndicatorTool 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 PriceTool 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 IndicatorTool 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 IndicatorTool 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 ProfileTool to retrieve company profile.Yes$0.001 per 100 API credits
Get QuoteReturn 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 VolumeTool to fetch relative volume (RVOL) data for a security.Yes$0.001 per 100 requests, charged per symbol requested
Get Simple Moving AverageReturn 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 SplitsTool to retrieve historical stock split events.Yes$0.001 per 100 API credits
Splits CalendarTool to retrieve a calendar of stock split events.Yes$0.001 per 100 API credits
Get Stochastic RSITool 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 ListTool 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 SeriesReturn 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 PriceTool 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 StocksList and filter stocks in Twelve Data's reference directory, one explicit page at a time.Yes$0.001 per 100 requests
Mutual Funds FamilyList the mutual fund families available from investment companies.Yes$0.001 per 100 requests
Mutual Funds ListTool to retrieve a daily updated list of mutual funds sorted by total assets.Yes$0.001 per 100 requests
Search SymbolsFind 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 ConversionYes$0.001 per 100 requests
Get PriceYes$0.001 per 100 requests, charged per symbol requested
QuoteYes$0.001 per 100 requests, charged per symbol requested
List StocksYes$0.001 per 100 requests
Symbol SearchYes$0.001 per 100 requests
Time SeriesYes$0.001 per 100 requests, charged per symbol requested
Cash FlowTool to get company cash flow statement.Needs your own keyBilled to your own Twelve data key
Consolidated Cash FlowRetrieve consolidated cash flow statements for a company, including modeled operating, investing, and financing cash flow details.Needs your own keyBilled to your own Twelve data key
EPS RevisionsTool to provide analysts’ revisions of a company’s future EPS over the last week and month.Needs your own keyBilled to your own Twelve data key
EPS TrendTool to retrieve EPS trend estimates for a specified company.Needs your own keyBilled to your own Twelve data key
ETF WorldTool to fetch comprehensive ETF analytics (summary, performance, risk, composition).Needs your own keyBilled to your own Twelve data key
ETF World CompositionTool to fetch global ETF composition details including sector, country, asset allocations, top holdings, and bond metrics.Needs your own keyBilled to your own Twelve data key
ETF World RiskRetrieve global ETF risk metrics, including volatility and valuation ratios.Needs your own keyBilled to your own Twelve data key
Balance SheetTool to retrieve a company's balance sheet (assets, liabilities, equity).Needs your own keyBilled to your own Twelve data key
Balance Sheet ConsolidatedTool to get raw consolidated balance sheet data (assets, liabilities, equity) for a company.Needs your own keyBilled to your own Twelve data key
Get BondsRetrieve a list of available bonds with optional symbol, exchange, or country filters.Needs your own keyBilled to your own Twelve data key
Global ETF PerformanceRetrieve global ETF performance metrics, including trailing and annual returns.Needs your own keyBilled to your own Twelve data key
Get exchange scheduleRetrieve trading sessions and hours for exchanges by date, including pre-market, main, and post-market sessions.Needs your own keyBilled to your own Twelve data key
Get Fund HoldersTool to retrieve mutual fund holders for a company.Needs your own keyBilled to your own Twelve data key
Get HLC3 AverageTool to calculate the High, Low, Close Average (HLC3) for a security over a specified period.Needs your own keyBilled to your own Twelve data key
Income StatementTool to retrieve a company's income statement data (annual or quarterly).Needs your own keyBilled to your own Twelve data key
Insider TransactionsREQUIRES PRO, ULTRA, OR ENTERPRISE PLAN.Needs your own keyBilled to your own Twelve data key
Get Available IntervalsTool to retrieve a list of available time intervals supported by the API.Needs your own keyBilled to your own Twelve data key
Key ExecutivesREQUIRES ULTRA OR ENTERPRISE PLAN.Needs your own keyBilled 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 keyBilled to your own Twelve data key
Market MoversRetrieve a snapshot of top gainers or losers for a specified market.Needs your own keyBilled to your own Twelve data key
Global Mutual Fund PerformanceGet global mutual fund performance metrics, including trailing, annual, quarterly, and load-adjusted returns.Needs your own keyBilled to your own Twelve data key
Mutual Funds World RiskFetch global mutual fund risk metrics, including standard deviation, beta, and Sharpe ratio.Needs your own keyBilled to your own Twelve data key
Global Mutual Fund SummaryRetrieve a global mutual fund summary snapshot with key identifiers and attributes.Needs your own keyBilled to your own Twelve data key
Global Mutual Fund SustainabilityGet global mutual fund sustainability and ESG metrics, including scores and pillar breakdowns.Needs your own keyBilled to your own Twelve data key
Price TargetTool to fetch analysts' price target dataset for equities.Needs your own keyBilled to your own Twelve data key
RecommendationsRetrieve aggregated analyst recommendations for a stock.Needs your own keyBilled to your own Twelve data key
Get ROCR100Tool to calculate the Rate of Change Ratio 100 (ROCR100) for a security.Needs your own keyBilled to your own Twelve data key
Get StatisticsTool to retrieve key company statistics including valuation and financial overview.Needs your own keyBilled to your own Twelve data key
Get Usage LimitsRetrieve the connected key's current minute usage, limit, and timestamp, along with daily usage, daily limit, and plan category when available.Needs your own keyBilled to your own Twelve data key
List market indicesTool to retrieve a list of market indices.Needs your own keyBilled to your own Twelve data key
Institutional HoldersTool to retrieve institutional holders positions for a company.Needs your own keyBilled to your own Twelve data key
Mutual Funds World CompositionFetch global mutual fund portfolio composition, including sectors, asset allocation, top holdings, and bond metrics.Needs your own keyBilled to your own Twelve data key
Options ChainTool to retrieve the options chain for a given symbol and optional expiration date.Needs your own keyBilled to your own Twelve data key
Options ExpirationTool to retrieve available option expiration dates.Needs your own keyBilled to your own Twelve data key
Technical IndicatorsTool to fetch time-series data for a specific technical indicator.Needs your own keyBilled to your own Twelve data key
Pricing

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.
Help

Troubleshooting

  1. 1. Mastra AI 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. 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. 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.

FAQ

Frequently asked questions

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.

Get $2 starter credit