How to connect Twelve data to Codex in 2 mins: No API key needed

You can download price history for a list of tickers, backtest a moving average crossover and value a portfolio file at today's prices from Codex. 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

Codex 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 Codex forCodex 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 Codex

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

    Follow the setup below. You only do this once.

  3. Ask Codex for something

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

Setup

How to install Twelve data MCP in Codex

Run the setup command

Run this command in your terminal to add the Composio MCP server to Codex.

Terminal

It will initiate the authentication in a browser window, authorize Codex to access your Composio account.

Composio authentication page

(Optional) Authenticate with OAuth

To authenticate manually, run the login command to open a browser window and authorize Codex to access your Composio account.

bash
codex mcp login composio

Verify the connection

Run codex mcp list to confirm Composio appears as a registered MCP server.

bash
codex mcp list

Codex App

Codex App follows the same approach as VS Code.

  1. Click ⚙️ on the bottom left → MCP Servers → + Add servers → Streamable HTTP:
  2. Fill the header and Key fields with { "x-consumer-api-key" = "ck_*******" }.
  3. The Key is the Composio API key, that you can find on dashboard.composio.dev
  4. Click on Authenticate and authorize Codex to your Composio account and you're all set.
Codex App MCP setup
  1. Restart and verify if it's there in .codex/config.toml
bash
[mcp_servers.composio]
url = "https://connect.composio.dev/mcp"
http_headers = { "x-consumer-api-key" = "ck_*******" }

Try it

Ask Codex for a Twelve data task. The first time, Composio asks you to connect your Twelve data account.

For example, ask it to:

  • "List all supported cryptocurrencies today"
  • "Convert 100 USD to EUR right now"
  • "Show recent dividend payouts for AAPL"
Try it

Ask Codex for something with Twelve data

Start a new chat and try this prompt:

For each symbol in tickers.txt (up to 20), pull 2 years of daily prices and save them as data/prices/[symbol].csv with date, open, high, low, close and volume. Print a line for any symbol that failed.

Codex 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 Codex 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 Codex

Each prompt runs on Instant, and the cost next to it is about what it takes from your $2.

  • Download price history for a list of tickers

    Less than $0.01

    Pulls two years of daily prices for every symbol in a file and saves one CSV per symbol.

    For each symbol in tickers.txt (up to 20), pull 2 years of daily prices and save them as data/prices/[symbol].csv with date, open, high, low, close and volume. Print a line for any symbol that failed.

  • Backtest a moving average crossover

    Less than $0.01

    Pulls five years of prices, then writes and runs a script that tests the strategy against buy and hold.

    Pull 5 years of daily prices for [ticker] and save them to prices.csv. Write and run a script that backtests a 50-day and 200-day moving average crossover. Write backtest.md with the total return next to buy and hold, the number of trades and the largest drawdown.

  • Value a portfolio file at today's prices

    Less than $0.01

    Reads your holdings from a CSV, gets a quote for each and writes a report with values and gains.

    Read portfolio.csv (symbol, shares, cost per share; up to 24 rows). Get the latest quote for each symbol and write portfolio-report.md with the current value, gain or loss and weight of each holding, plus the totals.

  • Build a correlation matrix for your holdings

    Less than $0.01

    Pulls a year of prices for each symbol and runs a script to show which holdings move together.

    For each symbol in tickers.txt (up to 8), pull 1 year of daily closes. Run a script that works out the correlation of daily returns between every pair. Write correlation.csv and tell me the 3 most and the 3 least correlated pairs.

  • Convert a file of foreign invoices to your currency

    Less than $0.01

    Converts every row of an invoice file at the exchange rate on that row's date.

    For each row in invoices.csv (date, amount, currency; up to 50 rows), convert the amount to [USD] at the exchange rate on that row's date. Write invoices-converted.csv with the rate used and the converted amount, and print the total.

  • Export stock split histories for a ticker list

    Less than $0.01

    Build a CSV of historical split events.

    I want you to read tickers.txt, up to 50 symbols. Get split history for each from Twelve Data and write splits.csv with symbol, date and ratio, one row per event. Write symbols with no returned events to splits-none.txt.

  • Check exchange states from a file

    Less than $0.01

    Record which exchanges are open at the time of a run.

    I want you to read exchanges.txt, up to 20 exchange codes. Check each market state with Twelve Data and write exchange-states.json with the code, reported state and the time this script ran.

  • Find the earliest daily history for each ticker

    Less than $0.01

    Create a data coverage report for a symbol list.

    I want you to read tickers.txt, up to 100 symbols. Ask Twelve Data for each symbol’s earliest daily timestamp. Write coverage.csv with symbol and first available date. Keep errors in coverage-errors.csv.

What it can do

What Codex 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. Codex 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