Skill Tracer
Skills › Scientific Agent Skills › database-lookup › alphavantage.md

alphavantage.md

265 lines · skills/database-lookup/references/alphavantage.md at 5f2bc03

Open on GitHub
1# Alpha Vantage API Reference
2

Alpha Vantage API Reference

Raw lines 1 to 2
3## Overview
4Alpha Vantage provides APIs with free and paid entitlements for current and historical stock prices, forex rates, cryptocurrency data, technical indicators, and fundamental data (earnings, balance sheets, income statements). Covers global equities, ETFs, mutual funds, and commodities.
5

Overview

Alpha Vantage provides APIs with free and paid entitlements for current and historical stock prices, forex rates, cryptocurrency data, technical indicators, and fundamental data (earnings, balance sheets, income statements). Covers global equities, ETFs, mutual funds, and commodities.

Raw lines 3 to 5
6## Base URL
7```
8https://www.alphavantage.co/query
9```
11All requests use a single endpoint with `function` parameter to select the data type.

Base URL

https://www.alphavantage.co/query

All requests use a single endpoint with function parameter to select the data type.

Raw lines 6 to 12
13## Authentication
14- **API Key: REQUIRED.** Get a free key at https://www.alphavantage.co/support/#api-key
15- Pass as query parameter: `&apikey=YOUR_KEY`

Authentication

  • API Key: REQUIRED. Get a free key at https://www.alphavantage.co/support/#api-key
  • Pass as query parameter: &apikey=YOUR_KEY
Raw lines 13 to 16
17## Rate Limits
18- **Free tier:** 25 requests per day for available free endpoints. Entitlement and per-minute quotas vary by plan; do not assume every documented function is free.
19- **Premium tiers** available for higher limits (30, 75, 150+ calls/min).
20- Exceeding limits returns a polite JSON message, not an error code.
22---

Rate Limits

  • Free tier: 25 requests per day for available free endpoints. Entitlement and per-minute quotas vary by plan; do not assume every documented function is free.
  • Premium tiers available for higher limits (30, 75, 150+ calls/min).
  • Exceeding limits returns a polite JSON message, not an error code.

Raw lines 17 to 23
24## Key Endpoints (by `function` parameter)

Key Endpoints (by function parameter)

Raw lines 24 to 25
26### 1. Stock Time Series
28#### Intraday
29```
30GET /query?function=TIME_SERIES_INTRADAY&symbol={symbol}&interval={interval}&apikey={key}
31```
32| Parameter | Required | Values |
33|-----------|----------|--------|
34| `symbol` | Yes | Ticker symbol (e.g., `AAPL`, `MSFT`) |
35| `interval` | Yes | `1min`, `5min`, `15min`, `30min`, `60min` |
36| `outputsize` | No | `compact` (last 100 points, default) or `full` (full history) |
37| `adjusted` | No | `true` (default) or `false` |
38| `datatype` | No | `json` (default) or `csv` |
40**Example:**
41```
42https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=AAPL&interval=5min&apikey=YOUR_KEY
43```
45#### Daily
46```
47GET /query?function=TIME_SERIES_DAILY&symbol=AAPL&apikey=YOUR_KEY
48```
50#### Daily (Adjusted for splits/dividends)
51```
52GET /query?function=TIME_SERIES_DAILY_ADJUSTED&symbol=AAPL&outputsize=full&apikey=YOUR_KEY
53```
55#### Weekly / Monthly
56```
57GET /query?function=TIME_SERIES_WEEKLY_ADJUSTED&symbol=AAPL&apikey=YOUR_KEY
58GET /query?function=TIME_SERIES_MONTHLY_ADJUSTED&symbol=AAPL&apikey=YOUR_KEY
59```
61**Response (Daily):**
62```json
64 "Meta Data": {
65 "1. Information": "Daily Prices (open, high, low, close) and Volumes",
66 "2. Symbol": "AAPL",
67 "3. Last Refreshed": "2024-11-01",
68 "4. Output Size": "Compact",
69 "5. Time Zone": "US/Eastern"
70 },
71 "Time Series (Daily)": {
72 "2024-11-01": {
73 "1. open": "228.6900",
74 "2. high": "229.8600",
75 "3. low": "225.8200",
76 "4. close": "228.5200",
77 "5. volume": "50423432"
78 },
79 "2024-10-31": {
80 "1. open": "229.3400",
81 "2. high": "230.2000",
82 "3. low": "226.3700",
83 "4. close": "227.5500",
84 "5. volume": "51235678"
85 }
86 }
88```
90---

1. Stock Time Series

Intraday

GET /query?function=TIME_SERIES_INTRADAY&symbol={symbol}&interval={interval}&apikey={key}
ParameterRequiredValues
symbolYesTicker symbol (e.g., AAPL, MSFT)
intervalYes1min, 5min, 15min, 30min, 60min
outputsizeNocompact (last 100 points, default) or full (full history)
adjustedNotrue (default) or false
datatypeNojson (default) or csv

Example:

https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=AAPL&interval=5min&apikey=YOUR_KEY

Daily

GET /query?function=TIME_SERIES_DAILY&symbol=AAPL&apikey=YOUR_KEY

Daily (Adjusted for splits/dividends)

GET /query?function=TIME_SERIES_DAILY_ADJUSTED&symbol=AAPL&outputsize=full&apikey=YOUR_KEY

Weekly / Monthly

GET /query?function=TIME_SERIES_WEEKLY_ADJUSTED&symbol=AAPL&apikey=YOUR_KEY
GET /query?function=TIME_SERIES_MONTHLY_ADJUSTED&symbol=AAPL&apikey=YOUR_KEY

Response (Daily):

{
  "Meta Data": {
    "1. Information": "Daily Prices (open, high, low, close) and Volumes",
    "2. Symbol": "AAPL",
    "3. Last Refreshed": "2024-11-01",
    "4. Output Size": "Compact",
    "5. Time Zone": "US/Eastern"
  },
  "Time Series (Daily)": {
    "2024-11-01": {
      "1. open": "228.6900",
      "2. high": "229.8600",
      "3. low": "225.8200",
      "4. close": "228.5200",
      "5. volume": "50423432"
    },
    "2024-10-31": {
      "1. open": "229.3400",
      "2. high": "230.2000",
      "3. low": "226.3700",
      "4. close": "227.5500",
      "5. volume": "51235678"
    }
  }
}

Raw lines 26 to 91
92### 2. Stock Search (Symbol Lookup)
93```
94GET /query?function=SYMBOL_SEARCH&keywords={query}&apikey={key}
95```
97**Example:**
98```
99https://www.alphavantage.co/query?function=SYMBOL_SEARCH&keywords=microsoft&apikey=YOUR_KEY
100```
102**Response:**
103```json
105 "bestMatches": [
106 {
107 "1. symbol": "MSFT",
108 "2. name": "Microsoft Corporation",
109 "3. type": "Equity",
110 "4. region": "United States",
111 "5. marketOpen": "09:30",
112 "6. marketClose": "16:00",
113 "7. timezone": "UTC-04",
114 "8. currency": "USD",
115 "9. matchScore": "1.0000"
116 }
117 ]
119```
121---

2. Stock Search (Symbol Lookup)

GET /query?function=SYMBOL_SEARCH&keywords={query}&apikey={key}

Example:

https://www.alphavantage.co/query?function=SYMBOL_SEARCH&keywords=microsoft&apikey=YOUR_KEY

Response:

{
  "bestMatches": [
    {
      "1. symbol": "MSFT",
      "2. name": "Microsoft Corporation",
      "3. type": "Equity",
      "4. region": "United States",
      "5. marketOpen": "09:30",
      "6. marketClose": "16:00",
      "7. timezone": "UTC-04",
      "8. currency": "USD",
      "9. matchScore": "1.0000"
    }
  ]
}

Raw lines 92 to 122
123### 3. Global Quote (Real-Time Price)
124```
125GET /query?function=GLOBAL_QUOTE&symbol=AAPL&apikey=YOUR_KEY
126```
128The default quote updates at end of day. Real-time and delayed US quotes require
129the relevant entitlement; intraday, daily-adjusted and some indicators (including
130MACD) are premium. Check function-specific documentation before choosing a call.
132Returns latest price, volume, change, change percent for a single symbol.
134---

3. Global Quote (Real-Time Price)

GET /query?function=GLOBAL_QUOTE&symbol=AAPL&apikey=YOUR_KEY

The default quote updates at end of day. Real-time and delayed US quotes require the relevant entitlement; intraday, daily-adjusted and some indicators (including MACD) are premium. Check function-specific documentation before choosing a call.

Returns latest price, volume, change, change percent for a single symbol.


Raw lines 123 to 135
136### 4. Forex (FX) Rates
138#### Real-Time Exchange Rate
139```
140GET /query?function=CURRENCY_EXCHANGE_RATE&from_currency=USD&to_currency=EUR&apikey=YOUR_KEY
141```
143#### FX Time Series
144```
145GET /query?function=FX_DAILY&from_symbol=EUR&to_symbol=USD&apikey=YOUR_KEY
146GET /query?function=FX_WEEKLY&from_symbol=EUR&to_symbol=USD&apikey=YOUR_KEY
147GET /query?function=FX_MONTHLY&from_symbol=EUR&to_symbol=USD&apikey=YOUR_KEY
148GET /query?function=FX_INTRADAY&from_symbol=EUR&to_symbol=USD&interval=5min&apikey=YOUR_KEY
149```
151---

4. Forex (FX) Rates

Real-Time Exchange Rate

GET /query?function=CURRENCY_EXCHANGE_RATE&from_currency=USD&to_currency=EUR&apikey=YOUR_KEY

FX Time Series

GET /query?function=FX_DAILY&from_symbol=EUR&to_symbol=USD&apikey=YOUR_KEY
GET /query?function=FX_WEEKLY&from_symbol=EUR&to_symbol=USD&apikey=YOUR_KEY
GET /query?function=FX_MONTHLY&from_symbol=EUR&to_symbol=USD&apikey=YOUR_KEY
GET /query?function=FX_INTRADAY&from_symbol=EUR&to_symbol=USD&interval=5min&apikey=YOUR_KEY

Raw lines 136 to 152
153### 5. Cryptocurrency
155#### Real-Time Exchange Rate
156```
157GET /query?function=CURRENCY_EXCHANGE_RATE&from_currency=BTC&to_currency=USD&apikey=YOUR_KEY
158```
160#### Crypto Time Series
161```
162GET /query?function=DIGITAL_CURRENCY_DAILY&symbol=BTC&market=USD&apikey=YOUR_KEY
163GET /query?function=DIGITAL_CURRENCY_WEEKLY&symbol=BTC&market=USD&apikey=YOUR_KEY
164GET /query?function=DIGITAL_CURRENCY_MONTHLY&symbol=BTC&market=USD&apikey=YOUR_KEY
165```
167---

5. Cryptocurrency

Real-Time Exchange Rate

GET /query?function=CURRENCY_EXCHANGE_RATE&from_currency=BTC&to_currency=USD&apikey=YOUR_KEY

Crypto Time Series

GET /query?function=DIGITAL_CURRENCY_DAILY&symbol=BTC&market=USD&apikey=YOUR_KEY
GET /query?function=DIGITAL_CURRENCY_WEEKLY&symbol=BTC&market=USD&apikey=YOUR_KEY
GET /query?function=DIGITAL_CURRENCY_MONTHLY&symbol=BTC&market=USD&apikey=YOUR_KEY

Raw lines 153 to 168
169### 6. Technical Indicators
170```
171GET /query?function={INDICATOR}&symbol={symbol}&interval={interval}&time_period={n}&series_type={type}&apikey={key}
172```
174| Parameter | Required | Description |
175|-----------|----------|-------------|
176| `function` | Yes | Indicator name (see list below) |
177| `symbol` | Yes | Ticker symbol |
178| `interval` | Yes | `1min`, `5min`, `15min`, `30min`, `60min`, `daily`, `weekly`, `monthly` |
179| `time_period` | Yes* | Number of data points for calculation (e.g., 14 for RSI) |
180| `series_type` | Yes* | `close`, `open`, `high`, `low` |
182*Required for most indicators; some (like MACD, BBANDS) have additional parameters.
184**Common Indicator Functions:**
185`SMA`, `EMA`, `WMA`, `DEMA`, `TEMA`, `VWAP`, `RSI`, `MACD`, `STOCH`, `ADX`, `CCI`, `AROON`, `BBANDS`, `AD`, `OBV`, `ATR`, `WILLR`, `MOM`
187**Example -- RSI (14-day):**
188```
189https://www.alphavantage.co/query?function=RSI&symbol=AAPL&interval=daily&time_period=14&series_type=close&apikey=YOUR_KEY
190```
192**Example -- MACD:**
193```
194https://www.alphavantage.co/query?function=MACD&symbol=AAPL&interval=daily&series_type=close&apikey=YOUR_KEY
195```
197---

6. Technical Indicators

GET /query?function={INDICATOR}&symbol={symbol}&interval={interval}&time_period={n}&series_type={type}&apikey={key}
ParameterRequiredDescription
functionYesIndicator name (see list below)
symbolYesTicker symbol
intervalYes1min, 5min, 15min, 30min, 60min, daily, weekly, monthly
time_periodYes*Number of data points for calculation (e.g., 14 for RSI)
series_typeYes*close, open, high, low

*Required for most indicators; some (like MACD, BBANDS) have additional parameters.

Common Indicator Functions: SMA, EMA, WMA, DEMA, TEMA, VWAP, RSI, MACD, STOCH, ADX, CCI, AROON, BBANDS, AD, OBV, ATR, WILLR, MOM

Example -- RSI (14-day):

https://www.alphavantage.co/query?function=RSI&symbol=AAPL&interval=daily&time_period=14&series_type=close&apikey=YOUR_KEY

Example -- MACD:

https://www.alphavantage.co/query?function=MACD&symbol=AAPL&interval=daily&series_type=close&apikey=YOUR_KEY

Raw lines 169 to 198
199### 7. Fundamental Data
201#### Company Overview
202```
203GET /query?function=OVERVIEW&symbol=AAPL&apikey=YOUR_KEY
204```
205Returns: market cap, PE ratio, EPS, dividend yield, 52-week high/low, sector, description, and ~60 other fields.
207#### Income Statement
208```
209GET /query?function=INCOME_STATEMENT&symbol=AAPL&apikey=YOUR_KEY
210```
212#### Balance Sheet
213```
214GET /query?function=BALANCE_SHEET&symbol=AAPL&apikey=YOUR_KEY
215```
217#### Cash Flow
218```
219GET /query?function=CASH_FLOW&symbol=AAPL&apikey=YOUR_KEY
220```
222#### Earnings
223```
224GET /query?function=EARNINGS&symbol=AAPL&apikey=YOUR_KEY
225```
227Returns both annual and quarterly earnings (EPS, estimated EPS, surprise).
229---

7. Fundamental Data

Company Overview

GET /query?function=OVERVIEW&symbol=AAPL&apikey=YOUR_KEY

Returns: market cap, PE ratio, EPS, dividend yield, 52-week high/low, sector, description, and ~60 other fields.

Income Statement

GET /query?function=INCOME_STATEMENT&symbol=AAPL&apikey=YOUR_KEY

Balance Sheet

GET /query?function=BALANCE_SHEET&symbol=AAPL&apikey=YOUR_KEY

Cash Flow

GET /query?function=CASH_FLOW&symbol=AAPL&apikey=YOUR_KEY

Earnings

GET /query?function=EARNINGS&symbol=AAPL&apikey=YOUR_KEY

Returns both annual and quarterly earnings (EPS, estimated EPS, surprise).


Raw lines 199 to 230
231### 8. Commodities & Economic Indicators
232```
233GET /query?function=WTI&interval=monthly&apikey=YOUR_KEY
234GET /query?function=BRENT&interval=monthly&apikey=YOUR_KEY
235GET /query?function=NATURAL_GAS&interval=monthly&apikey=YOUR_KEY
236GET /query?function=COPPER&interval=monthly&apikey=YOUR_KEY
237GET /query?function=ALUMINUM&interval=monthly&apikey=YOUR_KEY
238GET /query?function=WHEAT&interval=monthly&apikey=YOUR_KEY
239GET /query?function=CORN&interval=monthly&apikey=YOUR_KEY
240GET /query?function=COTTON&interval=monthly&apikey=YOUR_KEY
241GET /query?function=SUGAR&interval=monthly&apikey=YOUR_KEY
242GET /query?function=COFFEE&interval=monthly&apikey=YOUR_KEY
243```
245Economic indicators:
246```
247GET /query?function=REAL_GDP&interval=quarterly&apikey=YOUR_KEY
248GET /query?function=CPI&interval=monthly&apikey=YOUR_KEY
249GET /query?function=INFLATION&apikey=YOUR_KEY
250GET /query?function=RETAIL_SALES&apikey=YOUR_KEY
251GET /query?function=UNEMPLOYMENT&apikey=YOUR_KEY
252GET /query?function=FEDERAL_FUNDS_RATE&interval=monthly&apikey=YOUR_KEY
253GET /query?function=TREASURY_YIELD&interval=monthly&maturity=10year&apikey=YOUR_KEY
254```
256---

8. Commodities & Economic Indicators

GET /query?function=WTI&interval=monthly&apikey=YOUR_KEY
GET /query?function=BRENT&interval=monthly&apikey=YOUR_KEY
GET /query?function=NATURAL_GAS&interval=monthly&apikey=YOUR_KEY
GET /query?function=COPPER&interval=monthly&apikey=YOUR_KEY
GET /query?function=ALUMINUM&interval=monthly&apikey=YOUR_KEY
GET /query?function=WHEAT&interval=monthly&apikey=YOUR_KEY
GET /query?function=CORN&interval=monthly&apikey=YOUR_KEY
GET /query?function=COTTON&interval=monthly&apikey=YOUR_KEY
GET /query?function=SUGAR&interval=monthly&apikey=YOUR_KEY
GET /query?function=COFFEE&interval=monthly&apikey=YOUR_KEY

Economic indicators:

GET /query?function=REAL_GDP&interval=quarterly&apikey=YOUR_KEY
GET /query?function=CPI&interval=monthly&apikey=YOUR_KEY
GET /query?function=INFLATION&apikey=YOUR_KEY
GET /query?function=RETAIL_SALES&apikey=YOUR_KEY
GET /query?function=UNEMPLOYMENT&apikey=YOUR_KEY
GET /query?function=FEDERAL_FUNDS_RATE&interval=monthly&apikey=YOUR_KEY
GET /query?function=TREASURY_YIELD&interval=monthly&maturity=10year&apikey=YOUR_KEY

Raw lines 231 to 257
258## Notes
259- All values are returned as strings in JSON.
260- JSON keys use numbered prefixes (e.g., `"1. open"`, `"2. high"`).
261- Time series data is keyed by date/timestamp strings, not arrays.
262- When rate limited, the API returns: `{"Note": "Thank you for using Alpha Vantage! ..."}`
263- For `outputsize=full`, daily data goes back 20+ years.
264- `datatype=csv` is available only on endpoints that document it. Inspect JSON `Information`, `Note`, and `Error Message` fields even after HTTP 200.
265- Free tier is very restrictive (25/day). For production use, a premium key is recommended.

Notes

  • All values are returned as strings in JSON.
  • JSON keys use numbered prefixes (e.g., "1. open", "2. high").
  • Time series data is keyed by date/timestamp strings, not arrays.
  • When rate limited, the API returns: {"Note": "Thank you for using Alpha Vantage! ..."}
  • For outputsize=full, daily data goes back 20+ years.
  • datatype=csv is available only on endpoints that document it. Inspect JSON Information, Note, and Error Message fields even after HTTP 200.
  • Free tier is very restrictive (25/day). For production use, a premium key is recommended.
Raw lines 258 to 265