diff --git a/alpaca_trade_api/__init__.py b/alpaca_trade_api/__init__.py index a88b5089..4a14db66 100644 --- a/alpaca_trade_api/__init__.py +++ b/alpaca_trade_api/__init__.py @@ -1,6 +1,6 @@ +__version__ = '1.4.2' + from .rest import REST, TimeFrame, TimeFrameUnit # noqa from .rest_async import AsyncRest # noqa from .stream import Stream # noqa -from .stream2 import StreamConn # noqa - -__version__ = '1.4.2' +from .stream2 import StreamConn # noqa \ No newline at end of file diff --git a/alpaca_trade_api/rest.py b/alpaca_trade_api/rest.py index 9ded3e38..91cf9f96 100644 --- a/alpaca_trade_api/rest.py +++ b/alpaca_trade_api/rest.py @@ -5,6 +5,7 @@ from requests.exceptions import HTTPError import time from enum import Enum +from alpaca_trade_api import __version__ from .common import ( get_base_url, get_data_url, @@ -166,6 +167,7 @@ def _request(self, else: headers['APCA-API-KEY-ID'] = self._key_id headers['APCA-API-SECRET-KEY'] = self._secret_key + headers['User-Agent'] = 'APCA-TRADE-SDK-PY/' + __version__ opts = { 'headers': headers, # Since we allow users to set endpoint URL via env var,