Rishikant181 / Rettiwt-API

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

Feature request: Get notifications #581

Closed MercurialPony closed 2 months ago

MercurialPony commented 3 months 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 3 months 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 3 months 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 3 months 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