We have known for more than a decade now that training machine learning models on huge user data sets allows to predict a lot of things with decent accuracy.
Twitter has been gathering a lot of data on all of its user, it is expected them to be able to predict interests like (and much more) this if you use their service.
No need to spy on your smartphone beside what you submit willingly https://hbr.org/2012/09/use-big-data-to-predict-your-c
You have to remember that APIs were used massively by third party apps users.
I don’t see a reason to attribute the API related drop more to automation than users stopping browsing reddit because third party app ban.