Alpha Vantage Alpha Vantage는 강력하고 개발자 친화적인 데이터 API와 스프레드시트를 통해 실시간 및 과거 금융 시장 데이터를 제공합니다.
해당 웹사이트에서 ALPHAVANTAGE_API_KEY를 생성하세요. AlphaVantageAPIWrapper를 사용하여 통화 환율을 가져올 수 있습니다.
import getpass
import os

os.environ["ALPHAVANTAGE_API_KEY"] = getpass.getpass()
from langchain_community.utilities.alpha_vantage import AlphaVantageAPIWrapper
alpha_vantage = AlphaVantageAPIWrapper()
alpha_vantage._get_exchange_rate("USD", "JPY")
{'Realtime Currency Exchange Rate': {'1. From_Currency Code': 'USD',
  '2. From_Currency Name': 'United States Dollar',
  '3. To_Currency Code': 'JPY',
  '4. To_Currency Name': 'Japanese Yen',
  '5. Exchange Rate': '148.19900000',
  '6. Last Refreshed': '2023-11-30 21:43:02',
  '7. Time Zone': 'UTC',
  '8. Bid Price': '148.19590000',
  '9. Ask Price': '148.20420000'}}
_get_time_series_daily 메서드는 지정된 글로벌 주식의 날짜, 일일 시가, 일일 고가, 일일 저가, 일일 종가, 일일 거래량을 반환하며, 최근 100개의 데이터 포인트를 포함합니다.
alpha_vantage._get_time_series_daily("IBM")
_get_time_series_weekly 메서드는 지정된 글로벌 주식의 주간 마지막 거래일, 주간 시가, 주간 고가, 주간 저가, 주간 종가, 주간 거래량을 반환하며, 20년 이상의 과거 데이터를 포함합니다.
alpha_vantage._get_time_series_weekly("IBM")
_get_quote_endpoint 메서드는 시계열 API의 경량 대안으로, 지정된 심볼의 최신 가격 및 거래량 정보를 반환합니다.
alpha_vantage._get_quote_endpoint("IBM")
{'Global Quote': {'01. symbol': 'IBM',
  '02. open': '156.9000',
  '03. high': '158.6000',
  '04. low': '156.8900',
  '05. price': '158.5400',
  '06. volume': '6640217',
  '07. latest trading day': '2023-11-30',
  '08. previous close': '156.4100',
  '09. change': '2.1300',
  '10. change percent': '1.3618%'}}
search_symbol 메서드는 입력된 텍스트를 기반으로 심볼 목록과 일치하는 회사 정보를 반환합니다.
alpha_vantage.search_symbols("IB")
_get_market_news_sentiment 메서드는 특정 자산에 대한 실시간 및 과거 시장 뉴스 감성을 반환합니다.
alpha_vantage._get_market_news_sentiment("IBM")
_get_top_gainers_losers 메서드는 미국 시장에서 상위 20개의 상승주, 하락주 및 가장 활발한 주식을 반환합니다.
alpha_vantage._get_top_gainers_losers()
wrapper의 run 메서드는 다음 매개변수를 받습니다: from_currency, to_currency. 주어진 통화 쌍에 대한 통화 환율을 가져옵니다.
alpha_vantage.run("USD", "JPY")
{'1. From_Currency Code': 'USD',
 '2. From_Currency Name': 'United States Dollar',
 '3. To_Currency Code': 'JPY',
 '4. To_Currency Name': 'Japanese Yen',
 '5. Exchange Rate': '148.19900000',
 '6. Last Refreshed': '2023-11-30 21:43:02',
 '7. Time Zone': 'UTC',
 '8. Bid Price': '148.19590000',
 '9. Ask Price': '148.20420000'}

Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.
I