Google

Google Play Games Services API

The Google Play Games Service allows developers to enhance games with social leaderboards, achievements, game state, sign-in with Google, and more.

Media & content#openapi#analytics#media

Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.

Overview

The Google Play Games Service allows developers to enhance games with social leaderboards, achievements, game state, sign-in with Google, and more.

Endpoints 40

accesstokens

  • POSTGenerates a Play Grouping API token for the PGS user identified by the attached credential./games/v1/accesstokens/generatePlayGroupingApiToken?packageName=string&persona=stringGenerates a Play Grouping API token for the PGS user identified by the attached credential.
  • POSTGenerates a Play Grouping API token for the PGS user identified by the Recall session ID provided in the request./games/v1/accesstokens/generateRecallPlayGroupingApiToken?packageName=string&persona=string&recallSessionId=stringGenerates a Play Grouping API token for the PGS user identified by the Recall session ID provided in the request.

achievementDefinitions

  • GETLists all the achievement definitions for your application./games/v1/achievements?language=string&maxResults=0&pageToken=stringLists all the achievement definitions for your application.

achievements

  • POSTIncrements the steps of the achievement with the given ID for the currently authenticated player./games/v1/achievements/:achievementId/increment?requestId=string&stepsToIncrement=0Increments the steps of the achievement with the given ID for the currently authenticated player.
  • GETLists the progress for all your application's achievements for the currently authenticated player./games/v1/players/:playerId/achievements?language=string&maxResults=0&pageToken=string&state=ALLLists the progress for all your application's achievements for the currently authenticated player.
  • POSTSets the state of the achievement with the given ID to `REVEALED` for the currently authenticated player./games/v1/achievements/:achievementId/revealSets the state of the achievement with the given ID to REVEALED for the currently authenticated player.
  • POSTSets the steps for the currently authenticated player towards unlocking an achievement/games/v1/achievements/:achievementId/setStepsAtLeast?steps=0Sets the steps for the currently authenticated player towards unlocking an achievement. If the steps parameter is less than the current number of steps that…
  • POSTUnlocks this achievement for the currently authenticated player./games/v1/achievements/:achievementId/unlockUnlocks this achievement for the currently authenticated player.
  • POSTUpdates multiple achievements for the currently authenticated player./games/v1/achievements/updateMultipleUpdates multiple achievements for the currently authenticated player.

applications

  • GETRetrieves the metadata of the application with the given ID/games/v1/applications/:applicationId?language=string&platformType=ANDROIDRetrieves the metadata of the application with the given ID. If the requested application is not available for the specified platformType, the returned…
  • POSTReturns a URL for the requested end point type./games/v1/applications/getEndPoint?applicationId=string&endPointType=PROFILE_CREATIONReturns a URL for the requested end point type.
  • POSTIndicate that the currently authenticated user is playing your application./games/v1/applications/playedIndicate that the currently authenticated user is playing your application.
  • GETVerifies the auth token provided with this request is for the application with the specified ID, and returns the ID of…/games/v1/applications/:applicationId/verifyVerifies the auth token provided with this request is for the application with the specified ID, and returns the ID of the player it was granted for.

events

  • GETReturns a list showing the current progress on events in this application for the currently authenticated user./games/v1/events?language=string&maxResults=0&pageToken=stringReturns a list showing the current progress on events in this application for the currently authenticated user.
  • POSTRecords a batch of changes to the number of times events have occurred for the currently authenticated user of this…/games/v1/events?language=stringRecords a batch of changes to the number of times events have occurred for the currently authenticated user of this application.
  • GETReturns a list of the event definitions in this application./games/v1/eventDefinitions?language=string&maxResults=0&pageToken=stringReturns a list of the event definitions in this application.

gameStats

  • POSTRecords a batch of player game events for a specific player/games/v1/players/:playerId/gameStats:batchRecordEventsRecords a batch of player game events for a specific player. This method allows sending multiple events in a single request.

leaderboards

  • GETRetrieves the metadata of the leaderboard with the given ID./games/v1/leaderboards/:leaderboardId?language=stringRetrieves the metadata of the leaderboard with the given ID.
  • GETLists all the leaderboard metadata for your application./games/v1/leaderboards?language=string&maxResults=0&pageToken=stringLists all the leaderboard metadata for your application.

metagame

  • GETReturn the metagame configuration data for the calling application./games/v1/metagameConfigReturn the metagame configuration data for the calling application.
  • GETList play data aggregated per category for the player corresponding to `playerId`./games/v1/players/:playerId/categories/:collection?language=string&maxResults=0&pageToken=stringList play data aggregated per category for the player corresponding to playerId.

players

  • GETRetrieves the Player resource with the given ID/games/v1/players/:playerId?language=string&playerIdConsistencyToken=stringRetrieves the Player resource with the given ID. To retrieve the player for the currently authenticated user, set playerId to me.
  • GETGet the application player ids for the currently authenticated player across all requested games by the same developer…/games/v1/players/me/multipleApplicationPlayerIds?applicationIds=stringGet the application player ids for the currently authenticated player across all requested games by the same developer as the calling application. This will…
  • GETRetrieves scoped player identifiers for currently authenticated user./games/v1/players/me/scopedIdsRetrieves scoped player identifiers for currently authenticated user.
  • GETGet the collection of players for the currently authenticated user./games/v1/players/me/players/:collection?language=string&maxResults=0&pageToken=stringGet the collection of players for the currently authenticated user.

recall

  • GETRetrieve the Recall tokens from all requested games that is associated with the PGS Player encoded in the provided…/games/v1/recall/gamesPlayerTokens/:sessionId?applicationIds=stringRetrieve the Recall tokens from all requested games that is associated with the PGS Player encoded in the provided recall session id. The API is only…
  • GETRetrieve the last Recall token from all developer games that is associated with the PGS Player encoded in the provided…/games/v1/recall/developerGamesLastPlayerToken/:sessionIdRetrieve the last Recall token from all developer games that is associated with the PGS Player encoded in the provided recall session id. The API is only…
  • POSTAssociate the PGS Player principal encoded in the provided recall session id with an in-game account/games/v1/recall:linkPersonaAssociate the PGS Player principal encoded in the provided recall session id with an in-game account
  • POSTDelete all Recall tokens linking the given persona to any player (with or without a profile)./games/v1/recall:resetPersonaDelete all Recall tokens linking the given persona to any player (with or without a profile).
  • GETRetrieve all Recall tokens associated with the PGS Player encoded in the provided recall session id/games/v1/recall/tokens/:sessionIdRetrieve all Recall tokens associated with the PGS Player encoded in the provided recall session id. The API is only available for users that have active PGS…
  • POSTDelete a Recall token linking the PGS Player principal identified by the Recall session and an in-game account…/games/v1/recall:unlinkPersonaDelete a Recall token linking the PGS Player principal identified by the Recall session and an in-game account identified either by the 'persona' or by the…

revisions

  • GETChecks whether the games client is out of date./games/v1/revisions/check?clientRevision=stringChecks whether the games client is out of date.

scores

  • GETGet high scores, and optionally ranks, in leaderboards for the currently authenticated player/games/v1/players/:playerId/leaderboards/:leaderboardId/scores/:timeSpan?includeRankType=ALL&language=string&maxResults=0&pageToken=stringGet high scores, and optionally ranks, in leaderboards for the currently authenticated player. For a specific time span, leaderboardId can be set to ALL to…
  • GETLists the scores in a leaderboard, starting from the top./games/v1/leaderboards/:leaderboardId/scores/:collection?language=string&maxResults=0&pageToken=string&timeSpan=ALL_TIMELists the scores in a leaderboard, starting from the top.
  • GETLists the scores in a leaderboard around (and including) a player's score./games/v1/leaderboards/:leaderboardId/window/:collection?language=string&maxResults=0&pageToken=string&resultsAbove=0&returnTopIfAbsent=true&timeSpan=ALL_TIMELists the scores in a leaderboard around (and including) a player's score.
  • POSTSubmits a score to the specified leaderboard./games/v1/leaderboards/:leaderboardId/scores?language=string&score=string&scoreTag=stringSubmits a score to the specified leaderboard.
  • POSTSubmits multiple scores to leaderboards./games/v1/leaderboards/scores?language=stringSubmits multiple scores to leaderboards.

snapshots

  • GETRetrieves the metadata for a given snapshot ID./games/v1/snapshots/:snapshotId?language=stringRetrieves the metadata for a given snapshot ID.
  • GETRetrieves a list of snapshots created by your application for the player corresponding to the player ID./games/v1/players/:playerId/snapshots?language=string&maxResults=0&pageToken=stringRetrieves a list of snapshots created by your application for the player corresponding to the player ID.

stats

  • GETReturns engagement and spend statistics in this application for the currently authenticated user./games/v1/statsReturns engagement and spend statistics in this application for the currently authenticated user.

API details

Base URL
https://games.googleapis.com
Authentication
OAuth 2.0 (authorization code flow) with 3 scopes
An API key in the key query parameter
Operations
40 operations on 39 pathsGET 24POST 16
Main resources
achievements 6recall 6scores 5applications 4players 4events 3accesstokens 2leaderboards 2metagame 2snapshots 2
Response formats
application/json
Description format
Google API Discovery, API version v1

How to test the Google Play Games Services API in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the Google Play Games Services API collection, without the publisher's secrets.
  3. Add your credentialsThis API uses OAuth 2.0 (authorization code flow) with 3 scopes. Add yours in the collection's variables or an environment; the requests already reference it.
  4. Send a requestPick an endpoint, for example “Generates a Play Grouping API token for the PGS user identified by the attached credential.” (POST /games/v1/accesstokens/generatePlayGroupingApiToken?packageName=string&persona=string), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the Google Play Games Services API?

The Google Play Games Service allows developers to enhance games with social leaderboards, achievements, game state, sign-in with Google, and more. It is listed under Media & content and has 40 endpoints.

Who publishes the Google Play Games Services API?

It is listed from Google's public API description (an OpenAPI document), not published by Google on Swastik Codes. Anyone who controls googleapis.com can claim the profile by adding a DNS TXT record.

What is the base URL of the Google Play Games Services API?

Requests go to https://games.googleapis.com. Endpoint paths are added to this base URL.

How do I authenticate with the Google Play Games Services API?

It accepts 2 methods: OAuth 2.0 (authorization code flow) with 3 scopes; an API key in the key query parameter.

How many endpoints does the Google Play Games Services API have?

40 operations on 39 paths (24 GET, 16 POST). The largest groups are achievements, recall, scores, applications.

Is forking the Google Play Games Services API free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.