Emotion API

Analyse faces to detect a range of feelings and personalise your app's responses.

Recognise emotions in images

The Emotion API takes a facial expression in an image as an input and returns the confidence across a set of emotions for each face in the image, as well as bounding box for the face, using the Face API. If a user has already called the Face API, they can submit the face rectangle as an optional input.

The emotions detected are anger, contempt, disgust, fear, happiness, neutral, sadness and surprise. These emotions are understood to be cross-culturally and universally communicated with particular facial expressions.

See it in action

Anger 0.00000
Contempt 0.00000
Disgust 0.00000
Fear 0.00000
Happiness 1.00000
Neutral 0.00000
Sadness 0.00000
Surprise 0.00000
Anger 0.00245
Contempt 0.00055
Disgust 0.00633
Fear 0.00012
Happiness 0.95892
Neutral 0.02225
Sadness 0.00898
Surprise 0.00039
Anger 0.00001
Contempt 0.00000
Disgust 0.00000
Fear 0.00000
Happiness 0.99999
Neutral 0.00000
Sadness 0.00000
Surprise 0.00000
Anger 0.00000
Contempt 0.00000
Disgust 0.00000
Fear 0.00000
Happiness 0.99999
Neutral 0.00000
Sadness 0.00000
Surprise 0.00000
Detection result:
4 faces detected

[ { "faceRectangle": { "top": 114, "left": 212, "width": 65, "height": 65 }, "scores": { "anger": 1.0570484E-08, "contempt": 1.52679547E-09, "disgust": 1.60232943E-07, "fear": 6.00660363E-12, "happiness": 0.9999998, "neutral": 9.449728E-09, "sadness": 1.23025981E-08, "surprise": 9.91396E-10 } }, { "faceRectangle": { "top": 141, "left": 331, "width": 52, "height": 52 }, "scores": { "anger": 0.002451766, "contempt": 0.0005512201, "disgust": 0.0063303886, "fear": 0.000122375583, "happiness": 0.9589189, "neutral": 0.0222537462, "sadness": 0.008983561, "surprise": 0.000388026354 } }, { "faceRectangle": { "top": 110, "left": 70, "width": 51, "height": 51 }, "scores": { "anger": 5.382089E-06, "contempt": 3.84402554E-08, "disgust": 8.22284051E-07, "fear": 1.46369352E-08, "happiness": 0.999993265, "neutral": 9.765083E-08, "sadness": 9.01927848E-08, "surprise": 2.7211172E-07 } }, { "faceRectangle": { "top": 116, "left": 459, "width": 45, "height": 45 }, "scores": { "anger": 3.95796542E-06, "contempt": 2.44360656E-08, "disgust": 3.291685E-07, "fear": 1.935065E-09, "happiness": 0.9999912, "neutral": 2.461666E-06, "sadness": 1.96641076E-06, "surprise": 8.561949E-08 } } ]

By uploading data for this demo, you agree that Microsoft may store it and use it to improve Microsoft services, including this API. To help protect your privacy, we take steps to de-identify your data and keep it secure. We shall not publish your data or let other people use it.

Want to build this?

Recognise emotions in video

The Emotion API for Video recognises the facial expressions of people in a video and returns a summary of their emotions. You can use this API to track how a person or a crowd responds to your content over time. The emotions detected are anger, contempt, disgust, fear, happiness, neutral, sadness and surprise.

Recognise emotions in near real-time by extracting frames of a video and then sending those frames to the API calls of your choice. Get results faster and quickly start coding using our sample on GitHub.

Learn More

See it in action

Want to build this?

Explore the Cognitive Services APIs

Computer Vision API

Distill actionable information from images

Face API

Detect, identify, analyze, organise, and tag faces in photos

Content Moderator

Cost-effective moderation of text, image and video content


Personalise experiences with emotion recognition


Intelligent video processing produces stable video output, detects motion, creates intelligent thumbnails and detects and tracks faces

Custom Vision Service PREVIEW

A customisable web service that learns to recognise specific content in imagery

Video Indexer PREVIEW

Search, edit, analyse and learn from your videos

Language Understanding Intelligent Service PREVIEW

Teach your apps to understand commands from your users

Text Analytics API PREVIEW

Easily evaluate sentiment and topics to understand what users want

Bing Spell Check API

Help users correct spelling errors, recognise the difference among names, brand names and slang, as well as understand homophones as they are typing

Translator Text API

Easily conduct real-time text translation with a simple REST API call

Web Language Model API PREVIEW

Use the power of predictive language models trained on web-scale data

Linguistic Analysis API PREVIEW

Simplify complex language concepts and parse text with the Linguistic Analysis API

Translator Speech API

Conduct real-time speech translations

Speaker Recognition API PREVIEW

Use speech to identify and authenticate individual speakers

Bing Speech API

Convert speech to text and back again to understand user intent

Custom Speech Service PREVIEW

Eliminate speech recognition barriers like speaking style, background noise and vocabulary

Recommendations API PREVIEW

Predict and recommend items your customers want

Academic Knowledge API PREVIEW

Tap into academic content in the Microsoft Academic Graph

Knowledge Exploration Service PREVIEW

Enable interactive search experiences over structured data via natural language inputs.


Distill information into conversational, easy-to-navigate answers.

Entity Linking Intelligence Service API PREVIEW

Power your app's data links with named entity recognition and disambiguation

Custom Decision Service PREVIEW

A cloud-based, contextual decision-making API that sharpens with experience

Project Prague

Gesture based controls

Project Cuzco

Event associated with Wikipedia entries

Project Nanjing

Isochrones calculations

Project Abu Dhabi

Distance Matrix

Project Johannesburg

Route logistics

Project Wollongong

Location insights

Ready to supercharge your app?