Alpha Vantage

The alpha_vantage sensor platform uses Alpha Vantage to monitor the stock market. This platform also provides detail about exchange rates.

To enable the alpha_vantage platform, add the following lines to your configuration.yamlThe configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] file. After changing the configuration.yamlThe configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] file, restart Home Assistant to apply the changes. The integration is now shown on the integrations page under Settings > Devices & services. Its entities are listed on the integration card itself and on the Entities tab.

# Example configuration.yaml entry
sensor:
  - platform: alpha_vantage
    api_key: YOUR_API_KEY
    symbols:
      - symbol: GOOGL
        name: Google
    foreign_exchange:
      - name: USD_EUR
        from: USD
        to: EUR

Either a symbol or a foreign exchange must be configured, otherwise you will not get any data.

Configuration Variables

api_key string Required

The API Key from Alpha Vantage.

symbols map (Optional)

List of stock market symbols for given companies.

name string (Optional)

The name of the sensor to use for the frontend.

currency string (Optional, default: USD)

The name of the sensor to use for the frontend.

symbol string Required

The stock market symbol for the given company.

foreign_exchange map (Optional)

List of currencies.

name string (Optional)

The name of the sensor to use for the frontend.

from string Required

The source currency.

to string Required

The target currency.

API information

Alpha Vantage offers two tiers of the API key, one free and one paid for. If you are using the free version, you will be limited to twenty-five queries per day. The sensor polls every 5 minutes, so you will only get data for the first two hours per day. This can be configured using the scan_interval variable.

The paid version starts at 75 queries per minute, increasing ticker quantity quite a bit.

Examples

In this section you find some real-life examples of how to use this sensor.

Google and the exchange rate for Bitcoin

sensor:
  - platform: alpha_vantage
    api_key: YOUR_API_KEY
    symbols:
      - name: Google
        currency: USD
        symbol: GOOGL
    foreign_exchange:
      - from: BTC
        to: USD
        name: Bitcoin