While it is possible to connect an API application to a free trial account, neither real-time market data nor historical candlesticks are provided for any product that requires a paid subscription. Note that only TWS offers the ability to use the API without an active account, IB Gateway does not provide this possibility.
Also see: Does MEXEM provide free real time quotes via the API?