Tick-by-tick data is available via the TWS API, and corresponds to the data received in the Time & Sales window of TWS. It is possible to request both real-time and historical tick-by-tick data. Please see the relevant section of the TWS API documentation here for further detail on the appropriate use and limitations of this functionality.
Please Note
The maximum number of simultaneous tick-by-tick subscriptions is equal to 5% of a username's total market data lines. Please see the documentation on Specialized Market Data Lines for more detail.