UbisoftAPI

A basic Ubisoft API wrapper created in python. I will be updating this with more endpoints as time goes on.
Please note that this is my first time creating something like this, so any feedback is appreciated.

Current Endpoints:

  • by_username Returns account info from username
  • by_id Returns account info from user id
  • change_username Attempts to change the username on the account you are logged in as
  • register Attempts to create an account with your specified info

Example Usage:

from UbisoftApi import ubisoft

#can create this without a login but only register will work, the rest will throw exceptions
api = ubisoft.api("[email protected]:vooskdll")

#gets account info by id
r = api.by_id("2cb29542-bec3-4d57-99d0-217f3a40c2a2") #exception will be thrown if invalid user id is provided
print("Username: " + r.username) #returns username of provided uid
print("Text: " + r.text) #returns raw text from ubisoft
print(r.json) #returns raw json from ubisoft

#gets account info by username, all of this behaves basically identical to the "by_id" function
r = api.by_username("krul") #r.username / r.user_id will return "None" if username doesnt exist
print("Username: " + r.username)
print("ID: " + r.user_id)

#will throw exception if it fails to change username
r = api.change_username("testusername69")

#will throw an exception if it fails to create account
r = api.register(
    username = "example",
    email = "[email protected]",
    password = "Ex1234!!"
)

GitHub

View Github