mattfor / emoji-mixer
Get the URL of a Google Emoji Kitchen image for two emojis.
Requires
- php: >=8.2
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-30 07:13:09 UTC
README
Get the URL of a Google Emoji Kitchen image for two emojis.
Install
npm install emoji-mixer # JavaScript / TypeScript, Node.js 20.19+ pip install emoji-mixer # Python 3.10+ cargo add emoji-mixer # Rust go get github.com/MattFor/emoji-mixer/v2 # Go 1.21+ deno add jsr:@mattfor/emoji-mixer # Deno, or npx jsr add @mattfor/emoji-mixer composer require mattfor/emoji-mixer # PHP 8.2+ gem install emoji_mixer # Ruby 3.3+ dotnet add package EmojiMixer # .NET 10+
Usage
import getEmojiMixUrl from 'emoji-mixer'; // or: const { default: getEmojiMixUrl } = require("emoji-mixer"); getEmojiMixUrl('🔥', '😃'); // https://www.gstatic.com/android/keyboard/emojikitchen/20201001/u1f603/u1f603_u1f525.png
from emoji_mixer import get_emoji_mix_url get_emoji_mix_url("🔥", "😃")
emoji_mixer::get_emoji_mix_url("🔥", "😃"); // Some(url)
import emojimixer "github.com/MattFor/emoji-mixer/v2" url, err := emojimixer.EmojiMixURL("🔥", "😃")
use MattFor\EmojiMixer\EmojiMixer; EmojiMixer::getEmojiMixUrl('🔥', '😃');
require "emoji_mixer" EmojiMixer.emoji_mix_url("🔥", "😃")
using EmojiMixer; EmojiKitchen.GetEmojiMixUrl("🔥", "😃");
Emojis can be passed as characters ("☕") or codepoint strings ("2615", "1F600", "2764-fe0f"). The FE0F variation selector is optional.
Functions
-
getEmojiMixUrl(leftEmoji, rightEmoji, detailedErrors = false)(default export)
Returns the image URL, orundefinedif an emoji is unsupported or the pair has no mix. WithdetailedErrors, throws an error explaining why instead. -
toUnicode(input)
Returns the codepoint key of one supported emoji, e.g."☕"→"2615", orundefined. -
getEmojiCombo(leftEmoji, rightEmoji)
Takes two codepoint keys and returns the newest{ leftEmoji, rightEmoji, date }combination, orundefined.leftEmojiandrightEmojiare in the order Google hosts the image under, which may differ from the argument order. -
checkSupported(emoji)
Returns every combination containing the emoji (on either side), ornullif it is unsupported. -
googleRequestUrl(combo)/googleRequestUrlEmojiPart(emoji)
Build the image URL from a combination / format one emoji for the URL. -
getExpandedEmojiCompatibilityData(useCache = false)
Returns{ [emoji]: combination[] }for every supported emoji. -
supportedEmojis,emojiCompatibilityData,baseUrl
The supported codepoint keys, the compressed database and the image base URL.
Python has the same API in snake_case (get_emoji_mix_url, to_unicode, …, BASE_URL). It returns None instead of undefined/null, detailed_errors raises ValueError, and combinations are EmojiCombo(left_emoji, right_emoji, date) named tuples.
Rust has get_emoji_mix_url, to_unicode, get_emoji_combo, check_supported, google_request_url, google_request_url_emoji_part, supported_emojis() and BASE_URL, returning Options.
Go has EmojiMixURL (an error says why there is no URL), ToUnicode, EmojiCombo, CheckSupported,
ExpandedEmojiCompatibilityData, GoogleRequestURL, GoogleRequestURLEmojiPart, SupportedEmojis() and BaseURL;
lookups return (value, ok) and combinations are Combo{LeftEmoji, RightEmoji, Date}.
JSR is the same TypeScript as the npm package.
PHP has the same API as static methods of MattFor\EmojiMixer\EmojiMixer (getEmojiMixUrl, toUnicode, …,
BASE_URL), returning null; $detailedErrors throws InvalidArgumentException, and combinations are EmojiCombo
objects with leftEmoji, rightEmoji and date.
Ruby has EmojiMixer.emoji_mix_url(left, right, detailed_errors: false), to_unicode, emoji_combo,
check_supported, expanded_emoji_compatibility_data, google_request_url, google_request_url_emoji_part,
supported_emojis and BASE_URL, returning nil; detailed_errors raises ArgumentError, and combinations are
EmojiMixer::EmojiCombo values.
C# has the same API as static members of EmojiMixer.EmojiKitchen (GetEmojiMixUrl, ToUnicode, …,
SupportedEmojis, BaseUrl), returning null; detailedErrors throws ArgumentException, and combinations are
EmojiCombo(LeftEmoji, RightEmoji, Date) records.
Data format
emojiCompatibilityData is generated from emojikitchen.dev by converter.ts:
{ "$d": [20201001, 20260128], // unique dates "$e": [9749, 9800], // unique emojis: codepoints as integers, sequences as strings "2615": [[0, 0], [1, 1]], // [emojiIndex, dateIndex] "2648": [[-1, 1]] }
A negative emojiIndex (~i) means the key emoji is the right-hand emoji in Google's URL. Above, both entries [1, 1] and [-1, 1] describe ☕ (left) + ♈ (right).
Attributions
- Created by MattFor | Discord tag: mattfor | Github
- Inspired by emoji-kitchen [made by Xavier Salazar a.k.a xsalazar]