Datasets
Emoji's are generated into JSON files called datasets, with each dataset being grouped into one of
the following: localized data, versioned data, and metadata. These datasets can be found within the
emojibase-data
package, or loaded from a CDN.
- Yarn
- NPM
yarn add emojibase-data
npm install emojibase-data
JSON files will need to be parsed manually unless handled by a build/bundle process.
Usage
As stated, there are 3 groups of datasets, each serving a specific purpose. The first group, localized data, is exactly that, datasets with localization provided by CLDR (view supported locales). These datasets return an array of emoji objects that adhere to the defined data structure.
import emojis from 'emojibase-data/<locale>/data.json';
import compactEmojis from 'emojibase-data/<locale>/compact.json';
import groupsSubgroups from 'emojibase-data/<locale>/messages.json';
The second group, versioned data, provides datasets for emoji and Unicode release versions. These datasets return a map, with the key being the version, and the value being an array of emoji hexcodes included in the associated release version.
emojibase-data/versions/emoji.json
- Emoji characters grouped by emoji version.emojibase-data/versions/unicode.json
- Emoji characters grouped by Unicode version.
import unicodeVersions from 'emojibase-data/versions/unicode.json';
The third and last group, metadata, provides specialized datasets for unique use cases.
emojibase-data/meta/groups.json
- A map of non-localized emoji groups (Smileys & People), subgroups (Sky & Weather), and hierarchy, according to the official Unicode data files.emojibase-data/meta/hexcodes.json
- A map of emoji hexcodes (hexadecimal codepoints) to an object of hexcodes with different qualified status: fully qualified, minimally qualified, and unqualified.emojibase-data/meta/unicode.json
- An array of all emoji unicode characters, including text and emoji presentation characters.emojibase-data/meta/unicode-names.json
- A map of hexcodes to official Unicode names for each emoji.
import { groups, subgroups, hierarchy } from 'emojibase-data/meta/groups.json';
Data structure
Each emoji character found within the pre-generated datasets are represented by an object composed
of the properties listed below. In an effort to reduce the overall dataset filesize, most property
values have been implemented using integers,
with associated constants.
View the Emoji
object for a list of all available fields.
Not all properties will be found in the emoji object, as properties without an applicable value are omitted from the emoji object. This helps to reduce the filesize!
{
annotation: 'man lifting weights',
emoji: '🏋️♂️',
gender: 1,
group: 0,
hexcode: '1F3CB-FE0F-200D-2642-FE0F',
order: 1518,
shortcodes: [
'man_lifting_weights',
],
subgroup: 0,
tags: [
'weight lifter',
'man',
],
type: 1,
version: 4,
skins: [
{
annotation: 'man lifting weights: light skin tone',
emoji: '🏋🏻♂️',
gender: 1,
group: 0,
hexcode: '1F3CB-1F3FB-200D-2642-FE0F',
order: 1522,
shortcodes: [
'man_lifting_weights_tone1',
],
subgroup: 0,
type: 1,
tone: 1,
version: 4,
},
// ...
],
},
Compact format
While the emoji data is pretty thorough, not all of it may be required, and as such, a compact
dataset is supported. View the CompactEmoji
object for a
list of all available fields.
To use a compact dataset, replace data.json
with compact.json
.
import data from 'emojibase-data/en/compact.json';
{
annotation: 'man lifting weights',
group: 0,
hexcode: '1F3CB-FE0F-200D-2642-FE0F',
order: 1518,
shortcodes: [
'man_lifting_weights',
],
tags: [
'weight lifter',
'man',
],
unicode: '🏋️♂️',
skins: [
{
annotation: 'man lifting weights: light skin tone',
group: 0,
hexcode: '1F3CB-1F3FB-200D-2642-FE0F',
order: 1522,
shortcodes: [
'man_lifting_weights_tone1',
],
unicode: '🏋🏻♂️',
},
// ...
],
},
Messages format
The messages format is a special dataset that provides translations for groups, sub-groups, and any
other related emoji metadata. The key
in each message lines up with a defined TypeScript type
alias.
import data from 'emojibase-data/en/messages.json';
{
groups: [
{
key: 'smileys-emotion',
message: 'smileys & emotion',
order: 0,
},
// ...
],
subgroups: [
{
key: 'face-smiling',
message: 'smiling',
order: 0,
},
// ...
],
skinTones: [
{
key: 'light',
message: 'light skin tone',
},
// ...
],
};
Fetching from a CDN
If you prefer to not inflate your bundle size with these large JSON datasets, you can fetch them
from our CDN (provided by jsdelivr.com) using
fetchFromCDN()
,
fetchEmojis()
, or
fetchShortcodes()
.
import { fetchFromCDN, fetchEmojis, fetchMessages, fetchShortcodes } from 'emojibase';
const englishEmojis = await fetchFromCDN('en/data.json', { shortcodes: ['github'] });
const japaneseCompactEmojis = await fetchEmojis('ja', { compact: true });
const germanCldrShortcodes = await fetchShortcodes('de', 'cldr');
const chineseTranslations = await fetchMessages('zh');
Fetching from your own CDN
If you want to load the JSON datasets from your own CDN, you can customize the cdnUrl
using the
options object.
When cdnUrl
is a string, fetchFromCDN
will append '/${path}'
to the url. Make sure to include
the version
within the cdnUrl
yourself, it's not added automatically to give you control over
its placement.
import { fetchFromCDN, fetchEmojis, fetchMessages, fetchShortcodes } from 'emojibase';
const cdnUrl = 'https://example.com/cdn/emojidata/latest';
const englishEmojis = await fetchFromCDN('en/data.json', { shortcodes: ['github'], cdnUrl });
const japaneseCompactEmojis = await fetchEmojis('ja', { compact: true, cdnUrl });
const germanCldrShortcodes = await fetchShortcodes('de', 'cldr', { cdnUrl });
const chineseTranslations = await fetchMessages('zh', { cdnUrl });
cdnUrl
can also be a function, so you have complete control over the format of the url. This
function receives path
and version
as parameters. Version will be what you pass in within the
options object, or it will default to latest
. Note that version
is also used for the cache key,
so it's advised to set the option and not hard-code it in the cdnUrl
function.
import { fetchFromCDN, fetchEmojis, fetchMessages, fetchShortcodes } from 'emojibase';
function cdnUrl(path: string, version: string): string {
return `https://example.com/cdn/emojidata/${version}/${path}`;
}
const englishEmojis = await fetchFromCDN('en/data.json', { shortcodes: ['github'], cdnUrl });
const japaneseCompactEmojis = await fetchEmojis('ja', { compact: true, cdnUrl });
const germanCldrShortcodes = await fetchShortcodes('de', 'cldr', { cdnUrl });
const chineseTranslations = await fetchMessages('zh', { cdnUrl });
Supported locales
Follow locales are supported for both full and compact datasets.
- Bengali (
bu
) - Chinese (
zh
) - Chinese, Traditional (
zh-hant
) - Danish (
da
) - Dutch (
nl
) - English (
en
) - English, Great Britain (
en-gb
) - Estonian (
et
) - Finnish (
fi
) - French (
fr
) - German (
de
) - Hindu (
hi
) - Hungarian (
hu
) - Italian (
it
) - Japanese (
ja
) - Korean (
ko
) - Lithuanian (
lt
) - Malay (
ms
) - Norwegian (
nb
) - Polish (
pl
) - Portuguese (
pt
) - Russian (
ru
) - Spanish (
es
) - Spanish, Mexico (
es-mx
) - Swedish (
sv
) - Thai (
th
) - Ukrainian (
uk
)
Filesizes
Sorted by original size in ascending order.
- Emojis
- Emojis (compact)
- Shortcodes
- Messages
- Other
File | Size | Gzipped |
---|---|---|
zh-hant/data.json | 650.85 kB | 74.35 kB |
zh/data.json | 675.24 kB | 80.97 kB |
da/data.json | 690.91 kB | 79.87 kB |
sv/data.json | 692.51 kB | 80.97 kB |
nb/data.json | 693.98 kB | 81.22 kB |
en/data.json | 700.12 kB | 79.65 kB |
en-gb/data.json | 700.17 kB | 79.65 kB |
et/data.json | 705.97 kB | 80.32 kB |
ko/data.json | 709.94 kB | 83.38 kB |
fi/data.json | 710.5 kB | 84.29 kB |
nl/data.json | 714.47 kB | 81.33 kB |
ja/data.json | 714.67 kB | 84.08 kB |
fr/data.json | 715.5 kB | 80.71 kB |
lt/data.json | 718.09 kB | 84.13 kB |
pt/data.json | 718.47 kB | 83.68 kB |
ms/data.json | 726.38 kB | 81.26 kB |
hu/data.json | 728.01 kB | 84.13 kB |
es/data.json | 734.74 kB | 83.93 kB |
es-mx/data.json | 735.55 kB | 84.14 kB |
pl/data.json | 736.06 kB | 87.59 kB |
it/data.json | 738.69 kB | 85.69 kB |
de/data.json | 742.68 kB | 89.15 kB |
ru/data.json | 862.11 kB | 94.85 kB |
th/data.json | 870.25 kB | 84.56 kB |
uk/data.json | 886.93 kB | 94.77 kB |
hi/data.json | 916.45 kB | 91.43 kB |
bn/data.json | 938.92 kB | 89.18 kB |
File | Size | Gzipped |
---|---|---|
zh-hant/compact.json | 456.74 kB | 65.17 kB |
zh/compact.json | 481.14 kB | 71.31 kB |
da/compact.json | 496.81 kB | 70.3 kB |
sv/compact.json | 498.41 kB | 71.51 kB |
nb/compact.json | 499.88 kB | 72.97 kB |
en/compact.json | 506.02 kB | 70.45 kB |
en-gb/compact.json | 506.07 kB | 70.44 kB |
et/compact.json | 511.87 kB | 70.96 kB |
ko/compact.json | 515.84 kB | 73.2 kB |
fi/compact.json | 516.39 kB | 74.35 kB |
nl/compact.json | 520.36 kB | 71.78 kB |
ja/compact.json | 520.57 kB | 73.85 kB |
fr/compact.json | 521.4 kB | 71.21 kB |
lt/compact.json | 523.98 kB | 74.22 kB |
pt/compact.json | 524.37 kB | 74.2 kB |
ms/compact.json | 532.28 kB | 71.92 kB |
hu/compact.json | 533.91 kB | 74.06 kB |
es/compact.json | 540.64 kB | 74.47 kB |
es-mx/compact.json | 541.45 kB | 74.63 kB |
pl/compact.json | 541.96 kB | 77.97 kB |
it/compact.json | 544.59 kB | 76.05 kB |
de/compact.json | 548.58 kB | 79.13 kB |
ru/compact.json | 668 kB | 84.66 kB |
th/compact.json | 676.15 kB | 74.81 kB |
uk/compact.json | 692.83 kB | 84.35 kB |
hi/compact.json | 722.35 kB | 81.07 kB |
bn/compact.json | 744.82 kB | 79.02 kB |
File | Size | Gzipped |
---|---|---|
fr/shortcodes/emojibase.json | 42 B | 62 B |
en/shortcodes/cldr-native.json | 258 B | 184 B |
en-gb/shortcodes/cldr-native.json | 258 B | 184 B |
zh/shortcodes/emojibase-native.json | 298 B | 202 B |
zh/shortcodes/emojibase.json | 347 B | 186 B |
ja/shortcodes/emojibase.json | 1.02 kB | 472 B |
ja/shortcodes/emojibase-native.json | 1.09 kB | 571 B |
it/shortcodes/cldr-native.json | 1.18 kB | 496 B |
nl/shortcodes/cldr-native.json | 2.39 kB | 725 B |
ru/shortcodes/emojibase.json | 19.23 kB | 5.9 kB |
ru/shortcodes/emojibase-native.json | 25.23 kB | 6.59 kB |
da/shortcodes/emojibase-native.json | 36.68 kB | 6.7 kB |
es/shortcodes/cldr-native.json | 42.67 kB | 8.35 kB |
es-mx/shortcodes/cldr-native.json | 42.71 kB | 8.44 kB |
de/shortcodes/cldr-native.json | 43.31 kB | 6.83 kB |
nb/shortcodes/cldr-native.json | 44.25 kB | 7.37 kB |
en/shortcodes/github.json | 45.31 kB | 15.6 kB |
en/shortcodes/iamcal.json | 47.83 kB | 15.11 kB |
pt/shortcodes/cldr-native.json | 53.12 kB | 10.48 kB |
sv/shortcodes/emojibase-native.json | 54.62 kB | 10.14 kB |
fr/shortcodes/cldr-native.json | 55.84 kB | 10.38 kB |
da/shortcodes/cldr-native.json | 56.7 kB | 9.08 kB |
fi/shortcodes/cldr-native.json | 69.93 kB | 10.62 kB |
et/shortcodes/cldr-native.json | 70.97 kB | 12.03 kB |
sv/shortcodes/cldr-native.json | 72.3 kB | 11.93 kB |
lt/shortcodes/cldr-native.json | 120.26 kB | 20.53 kB |
pl/shortcodes/cldr-native.json | 124.57 kB | 18.88 kB |
en/shortcodes/emojibase-legacy.json | 129.02 kB | 24.32 kB |
sv/shortcodes/emojibase.json | 137.61 kB | 27.25 kB |
zh-hant/shortcodes/cldr-native.json | 139.67 kB | 27.09 kB |
zh/shortcodes/cldr-native.json | 143.91 kB | 27.44 kB |
hu/shortcodes/cldr.json | 147.05 kB | 27.09 kB |
ja/shortcodes/cldr.json | 147.46 kB | 26.18 kB |
hu/shortcodes/cldr-native.json | 147.71 kB | 25.6 kB |
en/shortcodes/cldr.json | 148.59 kB | 26.77 kB |
en-gb/shortcodes/cldr.json | 148.59 kB | 26.77 kB |
en-gb/shortcodes/emojibase.json | 148.6 kB | 29.07 kB |
zh-hant/shortcodes/cldr.json | 149.1 kB | 25.15 kB |
da/shortcodes/cldr.json | 150.09 kB | 26.7 kB |
da/shortcodes/emojibase.json | 150.69 kB | 29.99 kB |
sv/shortcodes/cldr.json | 150.76 kB | 26.99 kB |
th/shortcodes/cldr.json | 150.83 kB | 27.05 kB |
nb/shortcodes/cldr.json | 151.32 kB | 26.72 kB |
et/shortcodes/cldr.json | 152.19 kB | 26.95 kB |
fi/shortcodes/cldr.json | 153.84 kB | 27.36 kB |
nl/shortcodes/cldr.json | 156.69 kB | 27.42 kB |
ja/shortcodes/cldr-native.json | 156.8 kB | 28.76 kB |
de/shortcodes/cldr.json | 157.25 kB | 27.57 kB |
zh/shortcodes/cldr.json | 157.43 kB | 25.65 kB |
en/shortcodes/emojibase.json | 157.64 kB | 29.96 kB |
ru/shortcodes/cldr.json | 158.31 kB | 27.93 kB |
pt/shortcodes/cldr.json | 158.5 kB | 27.64 kB |
bn/shortcodes/cldr.json | 161.44 kB | 28.32 kB |
ms/shortcodes/cldr.json | 164.41 kB | 27.74 kB |
hi/shortcodes/cldr.json | 164.64 kB | 29.03 kB |
pl/shortcodes/cldr.json | 164.69 kB | 28.49 kB |
lt/shortcodes/cldr.json | 164.91 kB | 28.47 kB |
it/shortcodes/cldr.json | 165.26 kB | 28.21 kB |
ko/shortcodes/cldr-native.json | 165.27 kB | 29.15 kB |
es-mx/shortcodes/cldr.json | 165.38 kB | 27.96 kB |
fr/shortcodes/cldr.json | 165.65 kB | 27.97 kB |
es/shortcodes/cldr.json | 165.71 kB | 27.93 kB |
ko/shortcodes/cldr.json | 165.82 kB | 27.37 kB |
uk/shortcodes/cldr.json | 172.68 kB | 29.23 kB |
en/shortcodes/joypixels.json | 209.17 kB | 33.55 kB |
ru/shortcodes/cldr-native.json | 212.34 kB | 31.05 kB |
th/shortcodes/cldr-native.json | 234.76 kB | 31.25 kB |
uk/shortcodes/cldr-native.json | 238.16 kB | 32.88 kB |
hi/shortcodes/cldr-native.json | 269.37 kB | 33.3 kB |
bn/shortcodes/cldr-native.json | 279.02 kB | 32.5 kB |
File | Size | Gzipped |
---|---|---|
zh/messages.json | 6.2 kB | 1.94 kB |
zh-hant/messages.json | 6.2 kB | 1.93 kB |
en/messages.json | 6.5 kB | 1.59 kB |
en-gb/messages.json | 6.51 kB | 1.6 kB |
da/messages.json | 6.51 kB | 1.79 kB |
sv/messages.json | 6.51 kB | 1.8 kB |
ms/messages.json | 6.54 kB | 1.81 kB |
nb/messages.json | 6.56 kB | 1.8 kB |
ko/messages.json | 6.57 kB | 2.1 kB |
et/messages.json | 6.61 kB | 1.85 kB |
nl/messages.json | 6.64 kB | 1.82 kB |
de/messages.json | 6.65 kB | 1.91 kB |
it/messages.json | 6.65 kB | 1.83 kB |
fi/messages.json | 6.66 kB | 1.88 kB |
pl/messages.json | 6.66 kB | 2 kB |
pt/messages.json | 6.74 kB | 1.9 kB |
es-mx/messages.json | 6.77 kB | 1.9 kB |
es/messages.json | 6.77 kB | 1.9 kB |
ja/messages.json | 6.78 kB | 2.25 kB |
fr/messages.json | 6.78 kB | 1.91 kB |
hu/messages.json | 6.81 kB | 2 kB |
lt/messages.json | 6.85 kB | 1.96 kB |
ru/messages.json | 7.84 kB | 2.33 kB |
uk/messages.json | 7.91 kB | 2.38 kB |
hi/messages.json | 8.51 kB | 2.32 kB |
bn/messages.json | 8.66 kB | 2.33 kB |
th/messages.json | 9.1 kB | 2.42 kB |
File | Size | Gzipped |
---|---|---|
meta/groups.json | 3.9 kB | 1.25 kB |
meta/unicode.json | 72.47 kB | 12.61 kB |
versions/unicode.json | 94.96 kB | 11.95 kB |
versions/emoji.json | 95 kB | 12.05 kB |
meta/unicode-names.json | 237.12 kB | 28.41 kB |
meta/hexcodes.json | 258.42 kB | 28.47 kB |