python-tradingview-ta icon indicating copy to clipboard operation
python-tradingview-ta copied to clipboard

Rate limits question

Open Alexandar83 opened this issue 4 years ago • 2 comments

Hello,

First let me congratulate you on the good job - the project is awesome! Do you happen to know of any limitations of the TradingView API? How many requests per sec./min./hr..? And is there a limitation of the size of the requested data? Do I risk something, if I poll huge chunks of data (e.g. more than 1000 EXCHANGE:SYMBOLs) each minute?

Best Regards

Alexandar83 avatar Dec 24 '21 18:12 Alexandar83

Hi @Alexandar83,

the project is awesome

Thank you!!!

Do you happen to know of any limitations of the TradingView API? And is there a limitation of the size of the requested data?

I'm pretty sure that there is a limit, probably to prevent DoS. As I've never reached the limit, I don't know the specific rate limits. Avoid unnecessary requests or use a proxy to avoid hitting the limit.

Do I risk something, if I poll huge chunks of data (e.g. more than 1000 EXCHANGE:SYMBOLs) each minute?

I maintain tradingview-list, a database of 50,000+ symbols, exchanges, screener, and descriptions retrieved from TradingView. The update.py script retrieves megabytes of data from TradingView in a span of a few minutes, so I'd say it's safe for your case (as long as you use the get_multiple_analysis function). The worst thing that (probably) can happen is you get your IP address banned.

Edit (from your email):

Are we actually using a loophole in TVs API, or is this API officially provided for public use?

Someone who works for TradingView is aware of the existence of this library. They allow the use of the API as long as python-tradingview-ta provides a user agent. It's not clear whether the API is intended for public use or not, but it is accessible by anyone and is undocumented.

I hope this answers your questions. If you have other questions, feel free to reply to my comment. Have a nice day.

folfcoder avatar Dec 25 '21 15:12 folfcoder

You actually answered to me on the Christmas Day - you are amazing! You covered all my questions - thank you, wishing you a Happy New Year!

Alexandar83 avatar Dec 25 '21 23:12 Alexandar83