Rishikant181 / Rettiwt-API

A CLI tool and an API for fetching data from Twitter for free!
https://rishikant181.github.io/Rettiwt-API/
MIT License
356 stars 33 forks source link

Feature request: Get notifications #581

Closed MercurialPony closed 1 week ago

MercurialPony commented 1 month ago

It would be great if we had a method to get the list of new notifications.

Now I'm not 100% sure, but from what I can tell, the way twitter does this is by querying this endpoint every few seconds https://x.com/i/api/2/notifications/all.json

Rishikant181 commented 1 month ago

Yes, it can be done. I'll check the endpoint from Postman to test it. If it works, I'll get back to you

Rishikant181 commented 1 month ago

So I checked the endpoint in Postman, and it seems to working as intended but wow that endpoint is so bloated. It not only returns the notifications, but also recommended tweets and users.

MercurialPony commented 1 month ago

It's hard for me to say since the response that I'm seeing in the chrome network inspector is confusing to me. Though I think recommended tweets and users is an account setting - you can disable that yourself (I did so in the web UI)

Btw, there seems to be another endpoint that I think returns the number of notifications? I'm not sure about this one https://x.com/i/api/2/badge_count/badge_count.json