Exporting Custom Emoji From Slack

Published on November 29, 2021

Exporting custom emoji from Slack should be a feature, but it isn't. Here's how to do it anyway.

The first thing you'll need is a list of URLs and names for all your custom emoji. Slack gives this to us as a handy JSON file, it just doesn't expose it in the UI. We can extract it using our browser's developer tools.

  1. Go to Slack's Customization page for your workspace
  2. Open your browser's developer tools, go to the Network tab (or equivalent), and reload the page
  3. Look for a POST request that includes the string emoji.adminList

A screenshot of the browser's developer tools on Slack's Customization page. The request for the emoji.adminList is highlighted.

Now, copy the request's contents to a file. In Firefox, you can copy the request contents by right-clicking on the request and choosing Copy > Copy Request. Then, you can paste the request contents into a file using a code editor. Name this file emoji.json.

The structure of the JSON is pretty straightforward. It looks something like this:

{
    "ok": true,
    "emoji": [
        {
            "name": "100000",
            "is_alias": 0,
            "alias_for": "",
            "url": "https://emoji.slack-edge.com/gibberish/100000/more_gibberish.png",
            "created": 1600970377,
            "team_id": "some_id",
            "user_id": "another_id",
            "user_display_name": "George Washington",
            "avatar_hash": "some_hash",
            "can_delete": true,
            "is_bad": false,
            "synonyms": []
        },
        // ...more emoji
    ]
}

Exporting your emoji is now just a matter of iterating over the list of emoji and requesting the file from each url. Here's an extremely basic Python script that uses the requests library to do this:

#!/usr/bin/python

# download.py

import json
import os
import requests
import sys


def download_slackmoji_list(filename: str) -> None:
    f = open(filename)
    raw_list = json.load(f)

    for emoji in raw_list["emoji"]:
        name = emoji["name"]
        url = emoji["url"]
        _, extension = os.path.splitext(url)
        filename = f"{name}{extension}"

        print(f"Downloading {filename}...")

        r = requests.get(url)

        with open(filename, 'wb') as fd:
            for chunk in r.iter_content(chunk_size=128):
                fd.write(chunk)

    print(f"Downloaded {len(raw_list["emoji"])} emoji")


if __name__ == '__main__':
    try:
        filename = sys.argv[1]
        download_slackmoji_list(filename)
    except (ValueError, IndexError) as e:
        print("Error: Must provide filename as argument")

You can run the script with:

$  python3 download.py emoji.json

And it'll dump all your custom emoji into the current working directory, where each emoji will be named after whatever its name on slack was. This makes it easy to import the emoji into other platforms like Discord which will suggest an alias based on the filename.

Of course, none of this is supported by Slack and they are free to change the format or availability of the emoji list JSON whenever they want.