
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
alpha-vantage-client
Advanced tools
A comprehensive Python client for Alpha Vantage API with configuration-driven endpoints
A comprehensive, configuration-driven Python client for Alpha Vantage API with support for all endpoints including stocks, forex, crypto, commodities, economic indicators, and Alpha Intelligence features.
pip install alpha-vantage-client
from alpha_vantage_client import AlphaVantageClient
# Initialize with your API key
client = AlphaVantageClient(
api_key="YOUR_API_KEY",
default_symbol="AAPL",
default_datatype="json"
)
# Get stock data
data = client.query("time_series_daily", symbol="AAPL")
# Get technical indicators
sma_data = client.query("sma", symbol="AAPL", interval="daily", series_type="close", time_period=20)
# Get economic data
gdp_data = client.query("real_gdp", interval="quarterly")
# Get news sentiment
news_data = client.query("news_sentiment", tickers="AAPL,TSLA", topics="technology")
client = AlphaVantageClient(
api_key="YOUR_API_KEY",
default_symbol="AAPL",
default_datatype="json",
default_interval="daily",
default_series_type="close",
default_time_period=20
)
# Now you can call methods without specifying common parameters
sma_data = client.query("sma") # Uses defaults
rsi_data = client.query("rsi") # Uses defaults
# Get all available endpoints
all_endpoints = client.get_available_endpoints()
# Get endpoints by category
economic_endpoints = client.get_available_endpoints(category="economic")
tech_indicators = client.get_available_endpoints(category="technical_indicators")
# Search for specific endpoints
gdp_endpoints = client.get_available_endpoints(filter_by="gdp")
# Get detailed information
detailed_info = client.get_available_endpoints(detailed=True, category="economic")
# Fixed window analytics
analytics = client.query("analytics_fixed_window",
SYMBOLS="AAPL,MSFT,IBM",
RANGE="2023-07-01",
INTERVAL="DAILY",
CALCULATIONS="MEAN,STDDEV,CORRELATION")
# Sliding window analytics
sliding_analytics = client.query("analytics_sliding_window",
SYMBOLS="AAPL,IBM",
RANGE="2month",
INTERVAL="DAILY",
WINDOW_SIZE=20,
CALCULATIONS="MEAN,STDDEV(annualized=True)")
The client supports extensive configuration options with intelligent defaults:
client = AlphaVantageClient(
api_key="YOUR_API_KEY",
# Time series defaults
default_symbol="AAPL",
default_interval="daily",
default_outputsize="compact",
default_datatype="json",
# Technical indicator defaults
default_series_type="close",
default_time_period=20,
# Other defaults
default_adjusted=True,
default_extended_hours=False
)
The client applies defaults intelligently based on each endpoint's validation rules:
interval="daily"
appliedinterval="daily"
and series_type="close"
appliedThis prevents validation errors when defaults don't match endpoint requirements.
The client provides clear error messages and validation:
try:
data = client.query("sma", symbol="INVALID", interval="invalid")
except ValueError as e:
print(f"Validation error: {e}")
except RuntimeError as e:
print(f"API error: {e}")
git clone https://github.com/yourusername/alpha-vantage-client.git
cd alpha-vantage-client
pip install -e ".[dev]"
pytest
pytest --cov=alpha_vantage_client
black alpha_vantage_client/
flake8 alpha_vantage_client/
mypy alpha_vantage_client/
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
A comprehensive Python client for Alpha Vantage API with configuration-driven endpoints
We found that alpha-vantage-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.