A declarative python library for fetching market data from the NYSE and NASDAQ.
- Uses pandas by default
- Uses asyncio and aiohttp for large async requests
import easy_alpaca as alpaca
alpaca.config.API_KEY = ("ALPACA_API")
alpaca.config.API_SECRET = ("ALPACA_SECRET")
df = alpaca.bars.snapshot(
HISTORICAL=True
)
df = alpaca.bars.snapshot(
HISTORICAL=False
)
Warning: only start or end accepted (NOT BOTH) Warning: limit only tested up to 365 (in days)
df = alpaca.bars.get(
ticker = 'NVDA',
start = '2020-09-23',
end = 'null',
limit = 100,
adjustment = 'all',
)
df = alpaca.news.snapshot(
LATEST=True
)
df = alpaca.news.get('AAPL')