Hello All,
Actually I am looking for how to get top emojis or how to get/identify emojis from tweet text from sampled stream using Twitter API V2 or V1. I am able to get top Hashtags/Trends using V1 but did not find any mechanism for emoji.
Kindly provide any lead to achieve this.

Thanks in advance.

-Rahul

What do you mean by top emojis? How are you getting to hashtags / trends in v2?

@IgorBrigadir I have updated my question

1 Like

emojis will work as keywords Filtered stream - How to build a rule | Docs | Twitter Developer Platform in both stream and search, so you can treat them as another “word” in the rule, you just need to make sure whatever interface / library you’re using supports utf8. This is what comes up when i add a rule for :fire: ( 🔥 Fire Emoji )

{"data":[{"id":"1420067994814779397","value":"\uD83D\uDD25"}],"meta":{"sent":"2021-07-27T17:06:54.174Z"}}

There is no v2 API to get Tends yet, and there is no way to get top / trending emoji either, you have to specify them individually and do your own counts in the stream or use Tweet counts introduction | Docs | Twitter Developer Platform

2 Likes

@IgorBrigadir Thank you for your reply. Actually I am new for Twitter API, It will be great if you provide example of how to set rule for emoji.

I used twarc, if you have python installed,

pip install --upgrade twarc
twarc2 configure

Add a rule for emoji:

twarc2 stream-rules add "🔥"

(this may not work copy pasting directly from the forum, depending on your OS, you may have to copy paste the emoji and edit it in the terminal youself)

Open the stream (--limit 100 stops the stream after 100 results, remove this to keep going forever)

twarc2 stream --limit 100 fire_emoji.jsonl

You can add and remove other rules in a different terminal window while the stream is running, see twarc2 stream-rules --help for more commands.

1 Like

@IgorBrigadir Thank you for your lead and I am able to get top emoji.

1 Like