Contract buys and sells

React NextJS

So lets say I wanted to listen when a token is sold or bought similar to poocoin or dextools, how would i get the data?

My first thoughts where to listen to the pancakeswap router (if that is even correct) using the useApiContract() method with the address provided by the user from an input field and i guess the pancakeswap router or factory address as well.

curious if this is even possible and if what im thinking is nonsense…

It may be possible somehow, you will have to listen to the events specific to those operations.