Spiral gives your agent every tool with one account. Browse the tools →

Gemini · Finance

How to Use Twelve Data historical prices in Gemini

Returns instrument metadata and historical open, high, low, and close bars, with volume where available. Use it to chart prices, calculate returns, or study movements across multiple periods.

Prompts to try with Twelve Data historical prices in Gemini

Copy an example into Gemini, or ask in your own words.

Use Twelve Data historical prices for AAPL and summarize the largest close-to-close changes in the returned data.

Twelve Data historical pricesGemini
Try asking
  • Use Twelve Data historical prices for BTC/USD and show the first and last returned closes and the percentage change between them.

  • Use Twelve Data historical prices to look this up and give me the result as a table.

  • Pull the latest numbers from Twelve Data historical prices and tell me what changed since last week.

  • Check Twelve Data historical prices and summarize what you find in three bullet points.

How to set up Twelve Data historical prices in Gemini

Pick the way that suits you. Each takes about two minutes.

Use the Gemini connector

  1. Open Connected Apps

    On your computer, go to gemini.google.com. At the bottom, click Settings › Connected Apps. If you don't see Connected Apps, click Personal Intelligence first, then Connected Apps.

  2. Add Spiral as a custom app

    Under Custom apps, click Add a custom app and paste this MCP server URL:

    https://api.spiral.ai/mcp
  3. Sign in to Spiral and approve

    Follow the on-screen instructions. Spiral opens: sign in, pick the organization and click Authorize. No API key.

Use the Spiral skill

  1. Send Gemini this message

    Your agent reads Spiral's skill and sets itself up.

    set up https://spiral.ai/SKILL.md
  2. Sign in or paste a key

    Approve Spiral in the browser, or give the agent a key from the console.

Use the Spiral CLI

  1. Install and sign in

    Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

    npx -y spiral-cli@latest init

Call the Spiral API

  1. Create an API key

    In the console, under API keys.

  2. Run Twelve Data historical prices

    One request; the result comes back by polling or a webhook.

    curl https://api.spiral.ai/v1/runs \
      -H "Authorization: Bearer $SPIRAL_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $(uuidgen)" \
      -d '{
        "provider": "alexandria",
        "model": "twelvedata/prices/series",
        "input": {
          "interval": "1min",
          "symbol": "<symbol>"
        }
      }'

Then paste one of the prompts above: Gemini finds Twelve Data historical prices on Spiral, shows the price and runs it.

Twelve Data historical prices providers and prices

Spiral runs Twelve Data historical prices through Alexandria. Open a card for today's price, with every fee included.

AlexandriaFinance
Twelve Data · Time series
twelvedata/prices/series

Settings you can ask for

Ask Gemini for any of these in your prompt.

SettingAllowed valuesDefaultDescription
Interval1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h and 4 more

Bar size. Required.

Dp-1 to 11

Decimal places from 0 to 11. -1 lets Twelve Data choose. Default -1.

TypeAmerican Depositary Receipt, Bond, Bond Fund, Closed-end Fund, Common Stock, Depositary Receipt, Digital Currency, ETF and 12 more

Asset class, used to disambiguate a ticker.

Orderasc or desc

Sort. Default desc, newest first.

Adjustall, splits, dividends, or none

Price adjustment. Default splits.

Preposton or off

Include US equity pre-market and post-market data. Twelve Data limits this to Pro and Venture plans and above, at 1min, 5min, 15min, and 30min. Default false.

Outputsize1 to 5000

Bars to return, from 1 to 5000. When omitted and no date is set, Twelve Data returns 30. A date range without outputsize returns up to the maximum. The credit is still one per symbol.

Previous closeon or off

Add the previous bar close on each point. Default false.

Every API field of Twelve Data · Time series is on its tool page: open its card above.

What can you do with Twelve Data historical prices in Gemini?

Get a market check for AAPL, MSFT, EUR/USD, or BTC/USD with calculations based on retrieved Twelve Data prices. A chat app can explain a quote's trading range or summarize the movements in returned historical bars.

Check an internal stock watchlist

Compare AAPL and MSFT using their latest prices, session snapshots, or recent historical closes. Calculate which moved more over the period represented by the retrieved data.

Monitor currency exposure

Use EUR/USD prices to estimate the dollar value of a euro-denominated business balance. Choose a latest reading, a session snapshot, or historical closes for a retrospective valuation.

Flag cryptocurrency price thresholds

Check whether BTC/USD crosses a chosen threshold using the latest price, a quote snapshot, or completed historical bars. Report which observation triggered the flag.

Value a hypothetical portfolio

Calculate the value of hypothetical AAPL, MSFT, and SPY positions using current prices or historical closes. Show each position's contribution and the observation period used.

Explain a stock's trading range

Use a quote's session and 52-week metrics to place AAPL's price in context, or calculate ranges from historical bars for a chosen period.

Build a historical price chart

Plot MSFT's returned OHLC bars and calculate close-to-close returns. Keep calculations tied to the available observations rather than assuming a complete history.

Questions about Twelve Data historical prices in Gemini

Can Gemini use Twelve Data historical prices?

Yes. Add Spiral to Gemini as an MCP server, and Gemini can find and run Twelve Data historical prices like any built-in tool.

How much does Twelve Data historical prices cost in Gemini?

Up to $0.17459 per run. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your Gemini plan is separate.

Do I need an Alexandria account to use Twelve Data historical prices in Gemini?

No. Spiral runs Twelve Data historical prices on its own Alexandria account. You sign in to Spiral once and never paste a key.

How long does it take to set up Twelve Data historical prices in Gemini?

About two minutes: open Connected Apps, then add Spiral as a custom app, then sign in to Spiral and approve.

Does Gemini wait while Twelve Data historical prices runs?

Twelve Data historical prices runs in the background. Gemini starts the run, checks on it and gives you the json when it's ready.

Does Twelve Data's US stock feed represent the whole market?

Its default real-time feed covers listed US equities, but the contributing venues represent approximately 5% of total US trading volume. OTC securities require separate licensing.

When is US end-of-day data available?

Twelve Data says US historical and end-of-day data becomes available after midnight Eastern Time on the next trading day following market close.

How much historical data does Twelve Data provide?

Daily equity history can extend to the first trading date, while intraday history typically spans months to years depending on the instrument. Historical requests return at most 5,000 data points each.

Why can Twelve Data prices differ from another chart?

Twelve Data derives intraday bars from tick-level data and says aggregation differences can produce different values across sources and brokers. Its default US real-time feed also represents approximately 5% of trading volume.

Can I redistribute Twelve Data prices to customers?

Twelve Data's terms require express authorization through redistribution rights or a separate written agreement for external display or redistribution. Receiving prices does not itself grant publication rights.

Get started

Start using Twelve Data historical prices in Gemini

One Spiral account for every tool your agent needs. No subscription; you pay per run.

Paste this into Gemini:

Set up Gemini

set up https://spiral.ai/SKILL.md
Are you an AI agent? See setup options