New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@gviper/alphavantage-api

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gviper/alphavantage-api

TypeScript SDK for Alpha Vantage API with comprehensive type safety and all endpoint support

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

📊 Alpha Vantage API SDK

npm version TypeScript License: MIT

⚠️ IMPORTANT NOTICE: This SDK was generated using Claude Code AI. While most functionality has been verified, please thoroughly test all features in your specific use case before production deployment. Users should validate API responses and error handling according to their requirements.

A professional TypeScript SDK for the Alpha Vantage Financial API featuring complete endpoint coverage, full type safety, and enterprise-grade reliability.

🌟 Key Features

  • 🎯 Complete Coverage — All Alpha Vantage API endpoints with consistent interface
  • 🔒 Type Safety — Full TypeScript support with strict mode compliance
  • ⚡ Modern Architecture — Built with latest TypeScript best practices
  • 🔑 Secure Authentication — Built-in API key management and validation
  • 📊 Rich Data Types — Comprehensive type definitions for all response formats
  • 🚀 Developer Experience — IntelliSense support and detailed error handling

🚀 Quick Start

Installation

# npm
npm install @gviper/alphavantage-api

# pnpm
pnpm add @gviper/alphavantage-api

# yarn
yarn add @gviper/alphavantage-api

Quick Setup

import { AlphaVantage } from '@gviper/alphavantage-api';

// Initialize with your API key - all endpoints ready to use
const av = new AlphaVantage({ 
  apiKey: process.env.ALPHA_VANTAGE_API_KEY 
});

// Start using immediately
const stockData = await av.stocks.daily({ symbol: 'AAPL' });
const companyInfo = await av.fundamental.companyOverview({ symbol: 'AAPL' });
const exchangeRate = await av.forex.exchangeRate({ 
  from_currency: 'USD', 
  to_currency: 'EUR' 
});

📈 API Coverage

📊 Stock Market Data

// Real-time and historical stock prices
const intradayData = await stocks.intraday({ 
  symbol: 'AAPL', 
  interval: '5min' 
});

const dailyData = await stocks.daily({ symbol: 'AAPL' });
const weeklyData = await stocks.weekly({ symbol: 'AAPL' });
const monthlyData = await stocks.monthly({ symbol: 'AAPL' });

🏢 Fundamental Analysis

// Company financials and metrics
const overview = await fundamental.companyOverview({ symbol: 'AAPL' });
const income = await fundamental.incomeStatement({ symbol: 'AAPL' });
const balance = await fundamental.balanceSheet({ symbol: 'AAPL' });
const cashflow = await fundamental.cashFlow({ symbol: 'AAPL' });
const earnings = await fundamental.earnings({ symbol: 'AAPL' });

💱 Foreign Exchange

// Currency exchange rates and data
const rate = await forex.exchangeRate({ 
  from_currency: 'USD', 
  to_currency: 'EUR' 
});

const fxIntraday = await forex.intraday({ 
  from_symbol: 'EUR', 
  to_symbol: 'USD', 
  interval: '5min' 
});

₿ Cryptocurrency

// Digital currency market data
const btcDaily = await crypto.daily({ 
  symbol: 'BTC', 
  market: 'USD' 
});

const cryptoRate = await crypto.exchangeRate({ 
  from_currency: 'BTC', 
  to_currency: 'USD' 
});

📊 Technical Indicators

// 50+ technical analysis indicators
const sma = await technicals.sma({ 
  symbol: 'AAPL', 
  interval: 'daily', 
  time_period: 20, 
  series_type: 'close' 
});

const rsi = await technicals.rsi({ 
  symbol: 'AAPL', 
  interval: 'daily', 
  time_period: 14, 
  series_type: 'close' 
});

const macd = await technicals.macd({ 
  symbol: 'AAPL', 
  interval: 'daily', 
  series_type: 'close' 
});

🏛️ Economic Indicators

// Macroeconomic data
const gdp = await economic.realGDP();
const cpi = await economic.cpi();
const unemployment = await economic.unemployment();
const federalFunds = await economic.federalFundsRate();

🔍 Market Intelligence

// News sentiment and market insights
const sentiment = await intelligence.newsSentiment({ 
  tickers: 'AAPL,TSLA' 
});

const topGainers = await intelligence.topGainersLosers();

🛢️ Commodities & Options

// Commodity prices
const oil = await commodities.crudeOilWTI();
const gold = await commodities.copper();

// Options data
const optionsData = await options.realtime({ symbol: 'AAPL' });

🔧 Utilities

// Search and lookup tools
const search = await util.symbolSearch({ keywords: 'Microsoft' });
const listing = await util.listingStatus();

📚 API Reference

Available Endpoint Modules

ModuleDescriptionKey Methods
StocksReal-time & historical stock dataintraday(), daily(), weekly(), monthly()
FundamentalCompany financials & metricscompanyOverview(), incomeStatement(), balanceSheet()
ForexForeign exchange ratesexchangeRate(), intraday(), daily()
CryptoCryptocurrency market datadaily(), weekly(), monthly(), exchangeRate()
Technicals50+ technical indicatorssma(), rsi(), macd(), bbands(), adx()
EconomicMacroeconomic indicatorsrealGDP(), cpi(), unemployment(), inflation()
IntelligenceMarket news & sentimentnewsSentiment(), topGainersLosers()
OptionsOptions market datarealtime()
CommoditiesCommodity pricescrudeOilWTI(), naturalGas(), copper()
UtilSearch & utility functionssymbolSearch(), listingStatus()

Type Safety

All methods include comprehensive TypeScript definitions:

// Full IntelliSense support
const data = await stocks.intraday({
  symbol: 'AAPL',     // string (required)
  interval: '5min',   // '1min' | '5min' | '15min' | '30min' | '60min'
  adjusted: true,     // boolean (optional)
  extended_hours: true, // boolean (optional)
  month: '2024-01',   // string (optional)
  outputsize: 'full'  // 'compact' | 'full' (optional)
});

🛡️ Error Handling

The SDK provides structured error handling for common API scenarios:

try {
  const data = await stocks.daily({ symbol: 'INVALID' });
} catch (error) {
  if (error.message.includes('Invalid API call')) {
    console.log('Invalid symbol or API parameters');
  } else if (error.message.includes('API call frequency')) {
    console.log('Rate limit exceeded');
  }
}

🔑 Authentication

Get your free API key from Alpha Vantage:

// Environment variable (recommended)
const client = new AlphaVantageClient({ 
  apiKey: process.env.ALPHA_VANTAGE_API_KEY 
});

// Direct assignment (for testing only)
const client = new AlphaVantageClient({ 
  apiKey: 'YOUR_API_KEY_HERE' 
});

📦 Requirements

  • Node.js: 16.0+
  • TypeScript: 4.5+ (for TypeScript projects)
  • Alpha Vantage API Key: Get yours free

🤝 Contributing

This package is part of a monorepo. Please refer to the root README for development guidelines and contribution instructions.

📄 License

MIT License - see the LICENSE file for details.

Keywords

alphavantage

FAQs

Package last updated on 18 Jun 2025

Did you know?

Socket

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.

Install

Related posts