How can I get the FULL list of slack emoji through API?

15,132

Solution 1

Not entirely sure if this is what you are looking for, but if it's just about mapping images to slack-style names, this is a pretty good library:

https://github.com/iamcal/emoji-data

So, building on the example in their README:

The emoji with the Slack style short name point_uphas the hex value 261d, and can thus be found here: https://github.com/iamcal/emoji-data/blob/master/img-apple-160/261d.png

(Apple, because the default slack emoji are the apple emoji)

Solution 2

I finally managed to get all the icons and to use them and I post here the solution for anyone that would like to use do similar:

  1. First of all, I got the Slack Custom Emoji through this slack URL

  2. Since at step 1 we get only Custom Emojis, it is useful to know that slack uses standard emoji defined in unicode characters, mapped through custom handles like :smiley: or :horse:. The good thing is that we can find, linked through slack page a link to a JSON object with all the emoji mappings. This file is HUGE, but has everything we need.

  3. In the file you'll find an array of javascript object like the one below:

{
 "name":"SMILING FACE WITH OPEN MOUTH",
 "unified":"1F603",
 "variations":[],
 "docomo":"E6F0", 
 "au":"E471",
 "softbank":"E057",
 "google":"FE330",
 "image":"1f603.png",
 "sheet_x":26,
 "sheet_y":18,"
 short_name":"smiley",
 "short_names":["smiley"],
 "text":":)",
 "texts":["=)","=-)"],
 "category":"People",
 "sort_order":5,
 "has_img_apple":true,
 "has_img_google":true,
 "has_img_twitter":true,
 "has_img_emojione":true
}

I used the following information:

  • shortnames are the names that are used in slack (you'll need to turn smiley into :smiley: )
  • unified is the unicode character to use (to use it directly in an HTML page you'll need to add &#x so in this case you'll have to use 😃 which is rendered 😃

Using this information you will be able to create a slack-to-html function to decode emojis and display them wherever you want

Solution 3

Just extending on @Luca's awesome solution, I've created a shortnames => html unicode javascript dictionary...

Download: Slack emoticons to unicode html mapping.

Generated - 17th August 2018 from the source https://raw.githubusercontent.com/iamcal/emoji-data/master/emoji.json

Example:

{
  "+1": "👍",
  "-1": "👎",
  "100": "💯",
  "1234": "🔢",
  "8ball": "🎱",
  "ab": "🆎",
  "abc": "🔤",
  "abcd": "🔡",
  "accept": "🉑",
  ...
  "zebra_face": "🦓",
  "zipper_mouth_face": "🤐",
  "zombie": "🧟",
  "zzz": "💤"
}

Which becomes...

{ "+1": "👍", "-1": "👎", "100": "💯",
"1234": "🔢", "8ball": "🎱", "ab": "🆎",
"abc": "🔤", "abcd": "🔡", "accept": "🉑",
... "zebra_face": "🦓", "zipper_mouth_face": "🤐",
"zombie": "🧟", "zzz": "💤" }

Solution 4

As far as I know, there is no API endpoint or comprehensive list of supported emoji/keywords available. I was able to grab the full set (including custom emoji for the workspace) by inspecting the Slack emoji picker using React Developer Tools (Chrome extension).

Here's an example (JSON):

...
  {
    "name": "beers",
    "unicode": "1f37b",
    "id": "E1f37b",
    "keywords": ["bar", "beer", "clink", "drink", "mug", "ale", "food"]
  },
  {
    "name": "baby_bottle",
    "unicode": "1f37c",
    "id": "E1f37c",
    "keywords": ["baby", "bottle", "drink", "milk", "infant"]
  },
  {
    "name": "knife_fork_plate",
    "unicode": "1f37d-fe0f",
    "id": "E1f37d-fe0f",
    "keywords": ["cooking", "fork", "knife", "plate"]
  },
  {
    "name": "champagne",
    "unicode": "1f37e",
    "id": "E1f37e",
    "keywords": ["bar", "bottle", "cork", "drink", "popping"]
  },
  { "name": "popcorn", "unicode": "1f37f", "id": "E1f37f", "keywords": [] },
...

Full dump (as of 12/20/2020, excluding custom emoji): https://gist.github.com/impressiver/87b5b9682d935efba8936898fbfe1919

Share:
15,132

Related videos on Youtube

Ing. Luca Stucchi
Author by

Ing. Luca Stucchi

Software Architect, Software Developer, Technology Enthusiast Specialties: Software design, implementation, optimization, evolution, security. System Integration, API development. Database design, performance, scalability. Web Applications design, usability, analytics, security. Server administration, tuning, security. Native Android applications development.

Updated on September 16, 2022

Comments

  • Ing. Luca Stucchi
    Ing. Luca Stucchi over 1 year

    I am using the slack API to get the full list of emoji, so that when I get a message, I will just replace :squirrel: with the icon.

    The method https://slack.com/api/emoji.list works like a charm, but returns 30 icons only. I think this is correct since in the documentation page (https://api.slack.com/methods/emoji.list) they say:

    This method lists the custom emoji for a team.

    Fair enough, but how can I get the full list of the associations icon-name / icon URL ?

    • qzb
      qzb over 7 years
      I'm afraid it's impossible :/
    • Ing. Luca Stucchi
      Ing. Luca Stucchi over 7 years
      Thanks @qzb, do you have any link supporting your answer ?
    • qzb
      qzb over 7 years
      Nope, I've just assumed that if it would be possible, such endpoints would be described in documentation. Also, https://slack.com/api/emoji.list endpoint doesn't support any pagination. If you want to be sure, you should contact with slack team directly, but I guess you already knew that.
    • Ing. Luca Stucchi
      Ing. Luca Stucchi over 7 years
      Just got a response from their twitter: @stukki For now, that is the only public method we have. We're looking into some better methods for emoji in the future!
  • Wilhelm Klopp
    Wilhelm Klopp over 7 years
    additionally: not extremely useful, but this is the actual sprite Slack uses to display emoji.
  • Ing. Luca Stucchi
    Ing. Luca Stucchi over 7 years
    Hey @wilhelm-klopp, thanks for the hint ! Yes this is very useful ! I found a JSON with all the possible matches and I am using it to get the unicode value and render the icon as HTML. I'll post the solution if it works out !
  • Wilhelm Klopp
    Wilhelm Klopp about 7 years
    Also worth noting that this library is maintained by the Slack CTO
  • Haje
    Haje about 5 years
    Great work! But I've update the list, since I was missing a lot of them. gist.github.com/harmjanluth/ba3a38491dbbb11828f4b023becd1d64 There are no variations in here, don't know how to map/deal with them converting to html unicode.