diff --git a/examples/py/basic-rate-limiting.py b/examples/py/basic-rate-limiting.py new file mode 100644 index 000000000000..e15a5a254ac4 --- /dev/null +++ b/examples/py/basic-rate-limiting.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +from pprint import pprint + +import os +import sys + +root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +sys.path.append(root + '/python') + +import ccxt # noqa: E402 + + +symbol = 'ETH/BTC' + +exchange = ccxt.poloniex({ + 'enableRateLimit': True, # or .enableRateLimit = True later +}) + +# print 10 times with appropriate delay +for i in range(0, 10): + print('--------------------------------------------------------------------') + ticker = exchange.fetch_ticker(symbol) + ticker = exchange.omit(ticker, 'info') + pprint(ticker)