Alpaca Data logo

Alpaca Data

Community
gauss314
alpaca-data

Market Data API de Alpaca: acciones, crypto, opciones. Historical y real-time data para 5000+ stocks.

Overview

Publishergauss314
Repositoryskills
Skill namealpaca-data
Stars
250
Forks
35
Bundled files
4
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by gauss314 on GitHub. Read the source before you install it.

Installation

Install the Alpaca Data AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/gauss314/skills/tree/main/skills/alpaca-data
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/gauss314/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/alpaca-data .claude/skills/alpaca-data
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Alpaca Data in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Alpaca Data on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Alpaca Data is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Alpaca Data — Market Data API

API de datos de mercado con datos históricos y en tiempo real para acciones, crypto y opciones.

Base URL: https://data.alpaca.markets
SDK: pip install alpaca-py
Docs: docs.alpaca.markets


Autenticación

Obtener API Keys

  1. Ir a app.alpaca.markets
  2. Crear cuenta (paper trading es gratis)
  3. Ir a "API Keys" → Generate New Keys
  4. Guardar API Key y Secret Key

Configuración

python
import os
from alpaca.data.historical import StockHistoricalDataClient

# Keys (requerido para datos de acciones)
API_KEY = os.getenv("APCA_API_KEY_ID")
SECRET_KEY = os.getenv("APCA_API_SECRET_KEY")

client = StockHistoricalDataClient(API_KEY, SECRET_KEY)

# Crypto NO requiere keys
from alpaca.data.historical import CryptoHistoricalDataClient
crypto_client = CryptoHistoricalDataClient()

⚠️ NUNCA hardcodear keys en código que se comparte.


Rate Limits

PlanRequests/MinDatos
Free (IEX)200~5 años historia, 1 exchange
Paid (SIP)MayorTodas las bolsas US, ~7 años

Recomendaciones

  • Cachear datos — los datos históricos no cambian
  • Batch requests — pedir múltiples símbolos en una llamada
  • Usar limit=10000 — máximo por request
  • Paginar con next_page_token — para datos grandes

Data Feeds

FeedDescripciónCosto
iexInvestors Exchange (~2.5% del volumen)Gratis
sipTodas las bolsas US (consolidado)Paid
boatsBlue Ocean ATS (horas extendidas)Paid
otcOver-the-counterPaid

Free tier = solo IEX


Historical Stock Data

Bars (OHLCV)

python
from alpaca.data.requests import StockBarsRequest
from alpaca.data.timeframe import TimeFrame
from datetime import datetime

request = StockBarsRequest(
    symbol_or_symbols=["AAPL", "GOOGL"],
    timeframe=TimeFrame.Day,
    start=datetime(2023, 1, 1),
    end=datetime(2024, 12, 31),
    feed="iex"  # free tier
)

bars = client.get_stock_bars(request)
df = bars.df  # DataFrame

TimeFrames disponibles:

  • TimeFrame.Minute / TimeFrame(5, TimeFrame.Minute)
  • TimeFrame.Hour
  • TimeFrame.Day
  • TimeFrame.Week
  • TimeFrame.Month

Quotes (Bid/Ask)

python
from alpaca.data.requests import StockQuotesRequest

request = StockQuotesRequest(
    symbol_or_symbols=["AAPL"],
    start=datetime(2024, 1, 1),
    end=datetime(2024, 1, 31),
    feed="iex"
)

quotes = client.get_stock_quotes(request)

Trades

python
from alpaca.data.requests import StockTradesRequest

request = StockTradesRequest(
    symbol_or_symbols=["AAPL"],
    start=datetime(2024, 1, 1),
    feed="iex"
)

trades = client.get_stock_trades(request)

Latest Data

python
# Latest bar
bars = client.get_stock_latest_bar(["AAPL", "GOOGL"])

# Latest quote
quotes = client.get_stock_latest_quote(["AAPL"])

# Latest trade
trades = client.get_stock_latest_trade(["AAPL"])

Snapshots

python
from alpaca.data.requests import SnapshotRequest

request = SnapshotRequest(
    symbol_or_symbols=["AAPL", "GOOGL"]
)
snapshots = client.get_snapshot(request)

Historical Crypto Data

No requiere API keys

python
from alpaca.data.historical import CryptoHistoricalDataClient
from alpaca.data.requests import CryptoBarsRequest
from alpaca.data.timeframe import TimeFrame
from datetime import datetime

client = CryptoHistoricalDataClient()

request = CryptoBarsRequest(
    symbol_or_symbols=["BTC/USD", "ETH/USD"],
    timeframe=TimeFrame.Day,
    start=datetime(2023, 1, 1),
    end=datetime(2024, 12, 31)
)

bars = client.get_crypto_bars(request)
df = bars.df

Crypto Orderbook

python
from alpaca.data.requests import CryptoLatestQuoteRequest

request = CryptoLatestQuoteRequest(symbol_or_symbols=["BTC/USD"])
quotes = client.get_crypto_latest_quote(request)

Historical Options Data

Option Chains

python
# Obtener contratos disponibles
from alpaca.data.requests import OptionContractsRequest

request = OptionContractsRequest(
    underlying_symbols=["AAPL"],
    expiration_date_gte="2024-01-01",  # desde esta fecha
    expiration_date_lte="2024-12-31",  # hasta esta fecha
    strike_price_gte=100,  # strikes mínimo
    strike_price_lte=200   # strikes máximo
)

contracts = client.get_option_contracts(request)

Option Bars/Trades/Quotes

python
from alpaca.data.requests import OptionBarsRequest

# Buscar contract ID primero
contract_id = "6e58f870-fe73-4583-81e4-b9a37892c36f"

request = OptionBarsRequest(
    symbol_or_contract_ids=[contract_id],
    start=datetime(2024, 1, 1),
    end=datetime(2024, 1, 31)
)

bars = client.get_option_bars(request)

Options Tickers Reference

Ver ./references/options_reference.md para:

  • Símbolos de opciones (AAPL240119C00100000)
  • Parámetros de filtrado
  • Trading levels requeridos

News

python
from alpaca.data.requests import StockNewsRequest

request = StockNewsRequest(
    symbol_or_symbols=["AAPL", "GOOGL"],
    start=datetime(2024, 1, 1),
    end=datetime(2024, 1, 31)
)

news = client.get_stock_news(request)

Screener

python
from alpaca.data.requests import MostActivesRequest

request = MostActivesRequest(
    by="volume",  # volume, share, number
    top=10,
    date="2024-01-15"
)

movers = client.get_most_actives(request)

WebSocket Real-Time (Opcional)

python
from alpaca.data.stream import StockDataStream

ws = StockDataStream(API_KEY, SECRET_KEY)

async def handle_bar(bar):
    print(bar)

ws.subscribe_bars(handle_bar, "AAPL", "GOOGL")
ws.run()

Scripts de Descarga

Usá los scripts en ./scripts/:

bash
# Descargar bars de acciones
python ./scripts/download_stock_bars.py --symbols AAPL,GOOGL --days 365 --output data/

# Descargar crypto
python ./scripts/download_crypto_bars.py --symbols BTC,ETH --days 90 --output data/

# Descargar option contracts
python ./scripts/download_options.py --symbol AAPL --output data/

Errores Comunes

ErrorCausaSolución
403 ForbiddenKeys inválidas o sin permisosVerificar API keys
429 Too Many RequestsRate limitEsperar, usar cache
Empty responseSin datos para el símboloVerificar símbolo
"options_enabled"Symbol sin opcionesUsar símbolo con opciones

Comparación con Otras APIs

FeatureAlpacaAlpha VantageData912
Free tier✅ IEX (1 exchange)✅ 25/day✅ Todo ARS
Stocks US✅✅❌
Crypto✅✅❌
Opciones✅❌❌
Historical depth~5 años IEXLimitadoLimitado
SDK Python✅ alpaca-py✅❌

Elegí Alpaca para: datos de EE.UU. (stocks, crypto, opciones), datos intraday.
Elegí Data912 para: datos del mercado argentino.
Elegí Alpha Vantage para: indicadores técnicos, forex.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Alpaca Data AI skill do?

Market Data API de Alpaca: acciones, crypto, opciones. Historical y real-time data para 5000+ stocks.

Why use Alpaca Data on TypingMind?

Because you install it once and use it with any model. Alpaca Data is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Alpaca Data in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/gauss314/skills/tree/main/skills/alpaca-data. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Alpaca Data?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Alpaca Data?

As many as you like. As long as a model supports skills, you can use Alpaca Data with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Alpaca Data AI skill free?

Yes. It is published on GitHub by gauss314 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇