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

You can use the Emotion 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.

Recognize emotions in video by extracting frames of a video and then sending those frames to the API. 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

Automated image, text and video moderation


Personalise user experiences with emotion recognition


Intelligent video processing

Custom Vision Service PREVIEW

Easily customize your own state-of-the-art computer vision models for your unique use case

Video Indexer PREVIEW

Unlock video insights

Language Understanding Intelligent Service PREVIEW

Teach your apps to understand commands from your users

Text Analytics API

Easily evaluate sentiment and topics to understand what users want

Bing Spell Check API

Detect and correct spelling mistakes in your app

Translator Text API

Easily conduct machine 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

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

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

Overcome 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 the wealth of 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?