alphavantage-api

from adaptationio/skrillz

No description

2 stars0 forksUpdated Jan 16, 2026
npx skills add https://github.com/adaptationio/skrillz --skill alphavantage-api

SKILL.md

Alpha Vantage API Integration

Financial data API providing stocks, forex, crypto, technical indicators, fundamental data, economic indicators, and AI-powered news sentiment analysis.

Quick Start

Authentication

# Environment variable (recommended)
export ALPHAVANTAGE_API_KEY="your_api_key"

# Or in .env file
ALPHAVANTAGE_API_KEY=your_api_key

Basic Usage (Python)

import requests
import os

API_KEY = os.getenv("ALPHAVANTAGE_API_KEY")
BASE_URL = "https://www.alphavantage.co/query"

def get_quote(symbol: str) -> dict:
    """Get real-time quote for a symbol."""
    response = requests.get(BASE_URL, params={
        "function": "GLOBAL_QUOTE",
        "symbol": symbol,
        "apikey": API_KEY
    })
    return response.json().get("Global Quote", {})

# Example
quote = get_quote("AAPL")
print(f"AAPL: ${quote['05. price']} ({quote['10. change percent']})")

Using Python Package

from alpha_vantage.timeseries import TimeSeries
from alpha_vantage.techindicators import TechIndicators

# Time series data
ts = TimeSeries(key=API_KEY, output_format='pandas')
data, meta = ts.get_daily(symbol='AAPL', outputsize='compact')

# Technical indicators
ti = TechIndicators(key=API_KEY, output_format='pandas')
rsi, meta = ti.get_rsi(symbol='AAPL', interval='daily', time_period=14)

API Functions Reference

Stock Time Series

FunctionDescriptionFree
TIME_SERIES_INTRADAY1-60min intervals
TIME_SERIES_DAILYDaily OHLCV
TIME_SERIES_DAILY_ADJUSTEDWith splits/dividends⚠️ Premium
TIME_SERIES_WEEKLYWeekly OHLCV
TIME_SERIES_MONTHLYMonthly OHLCV
GLOBAL_QUOTELatest quote
SYMBOL_SEARCHSearch symbols

Fundamental Data

FunctionDescriptionFree
OVERVIEWCompany overview
INCOME_STATEMENTIncome statements
BALANCE_SHEETBalance sheets
CASH_FLOWCash flow statements
EARNINGSEarnings history
EARNINGS_CALENDARUpcoming earnings
IPO_CALENDARUpcoming IPOs

Forex

FunctionDescriptionFree
CURRENCY_EXCHANGE_RATEReal-time rate
FX_INTRADAYIntraday forex
FX_DAILYDaily forex
FX_WEEKLYWeekly forex
FX_MONTHLYMonthly forex

Cryptocurrency

FunctionDescriptionFree
CURRENCY_EXCHANGE_RATECrypto rate
DIGITAL_CURRENCY_DAILYDaily crypto
DIGITAL_CURRENCY_WEEKLYWeekly crypto
DIGITAL_CURRENCY_MONTHLYMonthly crypto

Technical Indicators (50+)

CategoryIndicators
TrendSMA, EMA, WMA, DEMA, TEMA, KAMA, MAMA, T3, TRIMA
MomentumRSI, MACD, STOCH, WILLR, ADX, CCI, MFI, ROC, AROON, MOM
VolatilityBBANDS, ATR, NATR, TRANGE
VolumeOBV, AD, ADOSC
HilbertHT_TRENDLINE, HT_SINE, HT_PHASOR, etc.

Economic Indicators

FunctionDescriptionFree
REAL_GDPUS GDP
CPIConsumer Price Index
INFLATIONInflation rate
UNEMPLOYMENTUnemployment rate
FEDERAL_FUNDS_RATEFed funds rate
TREASURY_YIELDTreasury yields

Alpha Intelligence

FunctionDescriptionFree
NEWS_SENTIMENTAI sentiment analysis
TOP_GAINERS_LOSERSMarket movers
INSIDER_TRANSACTIONSInsider trades⚠️ Premium
ANALYTICS_FIXED_WINDOWAnalytics⚠️ Premium

Rate Limits

TierDailyPer MinutePrice
Free255$0
PremiumUnlimited75-1,200$49.99-$249.99/mo

Important: Rate limits are IP-based, not key-based.

Common Tasks

Task: Get Daily Stock Data

def get_daily_data(symbol: str, full: bool = False) -> dict:
    """Get daily OHLCV data."""
    response = requests.get(BASE_URL, params={
        "function": "TIME_SERIES_DAILY",
        "symbol": symbol,
        "outputsize": "full" if full else "compact",
        "apikey": API_KEY
    })
    return response.json().get("Time Series (Daily)", {})

# Example
data = get_daily_data("AAPL")
latest = list(data.items())[0]
print(f"{latest[0]}: Close ${latest[1]['4. close']}")

Task: Get Technical Indicator

def get_rsi(symbol: str, period: int = 14) -> dict:
    """Get RSI indicator values."""
    response = requests.get(BASE_URL, params={
        "function": "RSI",
        "symbol": symbol,
        "interval": "daily",
        "time_period": period,
        "series_type": "close",
        "apikey": API_KEY
    })
    return response.json().get("Technical Analysis: RSI", {})

# Example
rsi = get_rsi("AAPL")
latest_rsi = list(rsi.values())[0]["RSI"]
print(f"AAPL R

...
Read full content

Repository Stats

Stars2
Forks0