Get Xbox Live achievements data

Use this method in the Microsoft Store analytics API to get the number of customers who have unlocked each achievement for your Xbox Live-enabled game during the most recent day for which achievements data is available, the previous 30 days leading up to that day, and the total lifetime of your game up to that day. This information is also available in the Xbox analytics report in Partner Center.

Important

This method only supports games for Xbox or games that use Xbox Live services. These games must go through the concept approval process, which includes games published by Microsoft partners and games submitted via the ID@Xbox program. This method does not currently support games published via the Xbox Live Creators Program.

Prerequisites

To use this method, you need to first do the following:

  • If you have not done so already, complete all the prerequisites for the Microsoft Store analytics API.
  • Obtain an Azure AD access token to use in the request header for this method. After you obtain an access token, you have 60 minutes to use it before it expires. After the token expires, you can obtain a new one.

Request

Request syntax

Method Request URI
GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/gameanalytics

Request header

Header Type Description
Authorization string Required. The Azure AD access token in the form Bearer <token>.

Request parameters

Parameter Type Description Required
applicationId string The Store ID of the game for which you want to retrieve Xbox Live achievements data. Yes
metricType string A string that specifies the type of Xbox Live analytics data to retrieve. For this method, specify the value achievements. Yes
top int The number of rows of data to return in the request. The maximum value and the default value if not specified is 10000. If there are more rows in the query, the response body includes a next link that you can use to request the next page of data. No
skip int The number of rows to skip in the query. Use this parameter to page through large data sets. For example, top=10000 and skip=0 retrieves the first 10000 rows of data, top=10000 and skip=10000 retrieves the next 10000 rows of data, and so on. No

Request example

The following example demonstrates a request for getting achievements data for customers who have unlocked the first 10 achievements for your Xbox Live-enabled game. Replace the applicationId value with the Store ID for your game.

GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/gameanalytics?applicationId=9NBLGGGZ5QDR&metrictype=achievements&top=10&skip=0 HTTP/1.1
Authorization: Bearer <your access token>

Response

Value Type Description
Value array An array of objects that contain data for each achievement in your game. For more information about the data in each object, see the following table.
@nextLink string If there are additional pages of data, this string contains a URI that you can use to request the next page of data. For example, this value is returned if the top parameter of the request is set to 100 but there are more than 100 rows of data for the query.
TotalCount int The total number of rows in the data result for the query.

Elements in the Value array contain the following values.

Value Type Description
applicationId string The Store ID of the game for which you are retrieving achievements data.
reportDateTime string The date for the achievements data.
achievementId number The ID of the achievement.
achievementName string The name of the achievement.
gamerscore number The gamerscore reward for the achievement.
dailyUnlocks number The number of customers who unlocked the achievement on the day specified by reportDateTime.
monthlyUnlocks number The number of customers who unlocked the achievement in the 30 days prior to the day specified by reportDateTime.
totalUnlocks number The number of customers who have unlocked the achievement during the lifetime of your game, up to the day specified by reportDateTime.

Response example

The following example demonstrates an example JSON response body for this request.

{
  "Value": [
    {
      "applicationId": "9NBLGGGZ5QDR",
      "reportDateTime": "2018-01-30T00:00:00",
      "achievementId": 6,
      "achievementName": "Yoink!",
      "gamerscore": 10,
      "dailyUnlocks": 0,
      "monthlyUnlocks": 10310,
      "totalUnlocks": 1215360
    },
    {
      "applicationId": "9NBLGGGZ5QDR",
      "reportDateTime": "2018-01-30T00:00:00",
      "achievementId": 7,
      "achievementName": "Ding!",
      "gamerscore": 10,
      "dailyUnlocks": 0,
      "monthlyUnlocks": 10897,
      "totalUnlocks": 1282524
    },
    {
      "applicationId": "9NBLGGGZ5QDR",
      "reportDateTime": "2018-01-30T00:00:00",
      "achievementId": 8,
      "achievementName": "End of the Beginning",
      "gamerscore": 30,
      "dailyUnlocks": 0,
      "monthlyUnlocks": 9848,
      "totalUnlocks": 1105074
    }
  ],
  "@nextLink": null,
  "TotalCount": 3
}