Oculus API - ComputerElite/wiki GitHub Wiki

Oculus API Documentation (Unofficial)

Kinda a documentation for the Oculus GraphQL API This documentation recieves updates really slowly. For a better documentation check my Project OculusGraphQLApiLib out

Table of contents

Basics

The location of Oculus GraphQL api is at https://graph.oculus.com/graphql. A post request with the parameters as xhr form or queryString (basically the same) will execute the request.

How do I request something

Every request has 3 primary fields:

  • access_token for your access token (OC|752908224809889| is the one for oculus store. For requests with e. g. personal info you'll need your own access token)
  • variables for all the request variables which can be stuff like query parameter, app id, ... it's in the Json format for Oculus
  • doc_id which tells oculus which data you want. More on that later Then simply create a post request to https://graph.oculus.com/graphql. Additionally you must have one header: TE: Trailers Examples:

a) Request POST with empty body to

https://graph.oculus.com/graphql?access_token=OC|1317831034909742|&variables={"query":"YourQuery","hmdType":"MONTEREY","firstSearchResultItems":100}&doc_id=4446310405385365

b) or POST Request with body to

https://graph.oculus.com/graphql

body:

access_token=OC|1317831034909742|&variables={"query":"YourQuery","hmdType":"MONTEREY","firstSearchResultItems":100}&doc_id=2983924295012880

How can I find doc_id's

The easiest way to do it is to use developer tools in your browser on the oculus site or in the oculus client (ctrl + shift + i). Simply go to the network tab and check there. I'll talk about some doc_id's here as well.

Requests

Labeled by purpose

General

I did my own little tool to request with the oculus store access_token which contains a few presets: https://computerelite.github.io/tools/Oculus/GraphQLRequester.html It should be noted that every request listed here will still need an access_token. I will not include example responses but most of the fields are self-explanatory. I may also skip some fields if they are unimportant or I don't know what they do. So far Oculus does not seem to rate limit anyone. However there are maximal amount of items that can be returned at once.

Headset types

Atm there are 3 headset types (often as hmdType in variables of request). I will not write them down below in the list of the requests:

  • RIFT for Rift
  • LAGUNA for Rift S
  • MONTEREY for Quest
  • HOLLYWOOD for Quest 2
  • PACIFIC for Go
  • GEARVR for Gear VR

see https://github.com/ComputerElite/OculusGraphQLApiLib/blob/64300156df2ca07e4c3e5f2ac78ab6b04f702335/OculusGraphQLApiLib/GraphQL/Headset.cs#L9

Ranges

On many things oculus returns a cursor which is a id for the current entry. You may be able to get every entry after this cursor by adding sectionCursor to the variables of your request with the value of the cursor. Then specify how many items you want via the appropriate parameter.

Store search

  • doc_id: 2983924295012880
  • variables: {"query":"YourQuery","hmdType":"MONTEREY","firstSearchResultItems":100}

query: well your query in the store

firstSearchResultItems: how many results to return

This will execute a store search

Versions of App

  • doc_id: 1586217024733717
  • variables: {"id":"appId"}

appId: Id of the app you want the versions from

Latest version of an App

  • doc_id: 5373392672732392
  • variables: {"itemId":"appId","first":5,"last":null,"after":null,"before":null,"forward":true,"ordering":null,"ratingScores":null,"hmdType":"MONTEREY" }

appId: Id of the app you want the versions from

first: Amount of dlcs to show (iirc)

Gives you the latest version of an app in all release channels

Get DLCs of App

  • doc_id: 3998937106836519
  • variables: {"id":"appid","first": 10}

id: Id of the app you want the versions from

first: how many DLCs to get

Get Release channels of App

  • doc_id: 3828663700542720
  • variables: {"applicationID":"appId"}

applicationID: Id of the app you want the release channels from

Get releases of release channel

You have to be able to see them in dev dashboard to access

  • doc_id: 3973666182694273
  • variables: {"releaseChannelID":"releaseChannelId"}

releaseChannelID: Id of the Releasechannel you want the releases from

Get All available apps of a section

  • doc_id: 3821696797949516
  • variables: {"sectionId":"1888816384764129","sortOrder":null,"sectionItemCount":24,"sectionCursor":null,"hmdType":"MONTEREY"}

sectionId: Id of the section (1888816384764129 is for all apps)

sectionItemCount: How many items to return

Search persons by name

  • doc_id: 2986806564694319
  • variables: {"query_data":{"query_string":"username","search_mode":"ID"}}

query_string: Username of the person you want to search.

Returns an Array of results with username and oculus id.

Get Oculus User info

  • doc_id: 2698974433493157

  • variables: {"userId":"103242324731393"}

  • userId: OculusID of the user

Returns things as user alias, profile picture and presence

Object types

Ids

Ids are unique across everything and used to identify everything.

Release channels

Release channels contain releases of an apps binaries. Every app has an LIVE release channel and can create custom ones as well.

Binaries

Binaries contain version, version_code, create_data, binary id and aditionally may contain a changelog

Downloading apps

Quest apps via link

For quest apps it's as simple as getting the binaries id and opening https://securecdn.oculus.com/binaries/download/?id=appId additionally you may add &access_token=yourAccessToken to authenticate downloads without cookies.

You can also use this site to browse and download apps

Quest apps via command line

Use Oculus downgrader.

Rift app download function

Written in C#: https://github.com/ComputerElite/OculusGraphQLApiLib/blob/64300156df2ca07e4c3e5f2ac78ab6b04f702335/OculusGraphQLApiLib/Game/GameDownloader.cs#L30

Rift Apps

Use Oculus downgrader.

Credit

  • API Endpoints found: Lillie, ComputerElite
  • API found: nyamimi

Writers