Is there a way to check this via API?
It’s the bool that’s set via “Allow message requests from everyone” in Profile Settings → Privacy and safety → Direct messages.

"allow_dms_from": "all" in GET account/settings | Docs | Twitter Developer Platform

1 Like

Is there a way to get this for other usernames, not myself?

It seems that Twitter provides this value per user only. My understanding is that’s because even if someone has DMs open, you can’t message them if they block you.

But aside from being blocked, this endpoint from the 1.1 API works to find out if DMs are open. Requires OAuth 1.

GET https://api.twitter.com/1.1/friendships/show.json?
source_id=YOUR_ID
&target_id=THEIR_ID

The result’s relationship.source.can_dm will tell you whether DMs are open.

2 Likes