Local HTTP Integration

Seemetrix supports integration with other programs via local HTTP API. Seemetrix client accepts requests on port 8081.

After the request is sent, you will receive one of the following codes:

  • “200 ОК” - request executed successfully;
  • “400 Bad Request” - error in request arguments;
  • “404 Not Found” - request not found;
  • “500 Server Error” - internal error.

Getting Information about People in front of the Camera

Seemetrix allows to get information about people standing in front of the camera in JSON and XML formats via an HTTP request on a device.

JSON

Seemetrix allows you to get information about people standing in front of the camera in JSON format via an HTTP request http://localhost:8081/getPersons?format=json on a device. The information about every current view is shown in real-time mode:

  • age - kids, young adult, adult, senior;
  • attentive - this parameter shows if the person is looking at the screen or camera (true/false);
  • duration - viewing time (in ms);
  • emotion - emotion prevailing throughout the viewing time (happy, angry, surprise, neutral);
  • gender - male, female;
  • id - view identificator;
  • face - face size and position in the frame in relative and absolute values.

The JSON contains an example result that contains 1 young male. So it means that one young male is looking at the screen right now.

{
    "persons": [
        {
            "age": "young",
            "attentive": true,
            "duration": 4545,
            "emotion": "neutral",
            "face": {
                "absolute": {
                    "size": 140,
                    "x": 275,
                    "y": 259
                },
                "relative": {
                    "size": 0.291666,
                    "x": 0.430352,
                    "y": 0.54112
                }
            },
            "gender": "male",
            "id": 37
        }
    ]
}

XML

You can get the information about the people standing in front of the camera in XML format using an HTTP GET-request http://localhost:8081/.

The XML consists of two parts: “presence” and “viewers”. “Presence” stands for all the people that are seen by a camera. “Viewers” are people who are looking directly into the camera. Currently, the “presence” module is not used, so all parameters are 0.

The XML contains an example result that contains 1 young male. So it means that one young male is looking at the screen right now.

<result>
    <presence>
        <audienceSize>0</audienceSize>
        <gender>
            <males>0</males>
            <females>0</females>
            <unknown>0</unknown>
        </gender>
        <ageGroup>
            <children>0</children>
            <adults>0</adults>
            <seniors>0</seniors>
        </ageGroup>
        <detailed>
            <males>
                <children>0</children>
                <adults>0</adults>
                <seniors>0</seniors>
            </males>
            <females>
                <children>0</children>
                <adults>0</adults>
                <seniors>0</seniors>
            </females>
        </detailed>
    </presence>

    <viewers>
        <audienceSize>1</audienceSize>
        <gender>
            <males>1</males>
            <females>0</females>
            <unknown>0</unknown>
        </gender>
        <ageGroup>
            <children>0</children>
            <youngs>1</youngs>
            <adults>0</adults>
            <seniors>0</seniors>
        </ageGroup>
        <detailed>
            <males>
                <children>0</children>
                <youngs>1</youngs>
                <adults>0</adults>
                <seniors>0</seniors>
            </males>
            <females>
                <children>0</children>
                <youngs>0</youngs>
                <adults>0</adults>
                <seniors>0</seniors>
            </females>
        </detailed>
    </viewers>
</result>

Binding Statistics to Media Content

Seemetrix allows you to associate statistics with the media content that is currently played on the screen. To do this, you have to send HTTP requests to the client application to start and end media. The views that will be collected at the time of playing the media will be displayed in the media tab in the Analytics section.

The media is identified by its name that is displayed in your account.

The following requests are available:

  • startMedia

Starts a media with a specified name. Parameters: name - name of a media (string in urlencoded). Example: http://localhost:8081/startMedia?name=media1.

You can also set the duration of the media using the duration parameter (optional) - specify the duration in seconds (an integer). Example: http://localhost:8081/startMedia?name=media1&duration=60

Several media can be played simultaneously.

  • stopMedia

Stops the media with a specified name. Parameters: name - name of a media (string in urlencoded). Example: http://localhost:8081/stopMedia?name=media1.

If the name of a media is not specified, all media content is stopped. Example: http://localhost:8081/stopMedia