Attempts to use the X API (formerly Twitter) for projects with Max/MSP have been disappointing at best. Most of the API is behind a paywall now. The cost is $5000 per month. to implement streaming API used in projects like this: https://reactivemusic.net/?p=5786
The free tier only allows basic tweeting and user lookup. Search is not available.
I was able to find only one node example that actually worked in the free tier. By “Coding with Ado”. The code requests a token from X, and then you enter a timestamped pin number to continue. Making it worthless for programs and bots. https://youtu.be/G5ZW5j5cwHk?si=vbAtGa0bQ3T_tga9
A local copy of the source code for this is in tkzic/nodetweet3/index.js
Other options
Another option with X, is to use a service like Socialdata. https://socialdata.tools/
There service sits in the middle to handle X API calls. You are charged by the number of calls. It doesn’t offer streaming either, but you can simulate it by calling a search every few seconds.
Other social media options
There are API’s for other social sites like facebook, instagram, tiktok, etc.,