vrchatapi


Namevrchatapi JSON
Version 1.17.3 PyPI version JSON
download
home_pageNone
SummaryVRChat API Library for Python
upload_time2024-04-29 22:00:51
maintainerNone
docs_urlNone
authorUnofficial VRChat API Documentation Project
requires_pythonNone
licenseMIT
keywords vrchat vrchatapi vrc
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
![](https://github.com/vrchatapi/vrchatapi.github.io/blob/main/static/assets/img/lang/lang_python_banner_1500x300.png?raw=true)

# VRChat API Library for Python

A Python client to interact with the unofficial VRChat API. Supports all REST calls specified in the [API specification](https://github.com/vrchatapi/specification).

## Disclaimer

This is the official response of the VRChat Team (from Tupper more specifically) on the usage of the VRChat API.

> Use of the API using applications other than the approved methods (website, VRChat application) are not officially supported. You may use the API for your own application, but keep these guidelines in mind:
> * We do not provide documentation or support for the API.
> * Do not make queries to the API more than once per 60 seconds.
> * Abuse of the API may result in account termination.
> * Access to API endpoints may break at any given time, with no warning.

As stated, this documentation was not created with the help of the official VRChat team. Therefore this documentation is not an official documentation of the VRChat API and may not be always up to date with the latest versions. If you find that a page or endpoint is not longer valid please create an issue and tell us so we can fix it.

## Getting Started

First add the package to to your project:
```bash
pip install vrchatapi
```

Below is an example on how to login to the API and fetch your own user information.

```python
# Step 1. We begin with creating a Configuration, which contains the username and password for authentication.
import vrchatapi
from vrchatapi.api import authentication_api
from vrchatapi.exceptions import UnauthorizedException
from vrchatapi.models.two_factor_auth_code import TwoFactorAuthCode
from vrchatapi.models.two_factor_email_code import TwoFactorEmailCode

configuration = vrchatapi.Configuration(
    username = 'username',
    password = 'password',
)

# Step 2. VRChat consists of several API's (WorldsApi, UsersApi, FilesApi, NotificationsApi, FriendsApi, etc...)
# Here we enter a context of the API Client and instantiate the Authentication API which is required for logging in.

# Enter a context with an instance of the API client
with vrchatapi.ApiClient(configuration) as api_client:
    # Set our User-Agent as per VRChat Usage Policy
    api_client.user_agent = "MyProject/1.0 my@email.com"

    # Instantiate instances of API classes
    auth_api = authentication_api.AuthenticationApi(api_client)

    try:
        # Step 3. Calling getCurrentUser on Authentication API logs you in if the user isn't already logged in.
        current_user = auth_api.get_current_user()
    except UnauthorizedException as e:
        if e.status == 200:
            if "Email 2 Factor Authentication" in e.reason:
                # Step 3.5. Calling email verify2fa if the account has 2FA disabled
                auth_api.verify2_fa_email_code(two_factor_email_code=TwoFactorEmailCode(input("Email 2FA Code: ")))
            elif "2 Factor Authentication" in e.reason:
                # Step 3.5. Calling verify2fa if the account has 2FA enabled
                auth_api.verify2_fa(two_factor_auth_code=TwoFactorAuthCode(input("2FA Code: ")))
            current_user = auth_api.get_current_user()
        else:
            print("Exception when calling API: %s
", e)
    except vrchatapi.ApiException as e:
        print("Exception when calling API: %s
", e)

    print("Logged in as:", current_user.display_name)
```

See [Examples](https://github.com/vrchatapi/vrchatapi-python/blob/main/examples/README.md) for more example usage on getting started.

## Contributing

Contributions are welcome, but do not add features that should be handled by the OpenAPI specification.

Join the [Discord server](https://discord.gg/Ge2APMhPfD) to get in touch with us.
    

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "vrchatapi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "vrchat, vrchatapi, vrc",
    "author": "Unofficial VRChat API Documentation Project",
    "author_email": "vrchatapi.lpv0t@aries.fyi",
    "download_url": "https://files.pythonhosted.org/packages/ca/29/3c9b8b9a8afe9a99668cac1cb40450a6eca7b050002f2ea17bf2c973d730/vrchatapi-1.17.3.tar.gz",
    "platform": null,
    "description": "\n![](https://github.com/vrchatapi/vrchatapi.github.io/blob/main/static/assets/img/lang/lang_python_banner_1500x300.png?raw=true)\n\n# VRChat API Library for Python\n\nA Python client to interact with the unofficial VRChat API. Supports all REST calls specified in the [API specification](https://github.com/vrchatapi/specification).\n\n## Disclaimer\n\nThis is the official response of the VRChat Team (from Tupper more specifically) on the usage of the VRChat API.\n\n> Use of the API using applications other than the approved methods (website, VRChat application) are not officially supported. You may use the API for your own application, but keep these guidelines in mind:\n> * We do not provide documentation or support for the API.\n> * Do not make queries to the API more than once per 60 seconds.\n> * Abuse of the API may result in account termination.\n> * Access to API endpoints may break at any given time, with no warning.\n\nAs stated, this documentation was not created with the help of the official VRChat team. Therefore this documentation is not an official documentation of the VRChat API and may not be always up to date with the latest versions. If you find that a page or endpoint is not longer valid please create an issue and tell us so we can fix it.\n\n## Getting Started\n\nFirst add the package to to your project:\n```bash\npip install vrchatapi\n```\n\nBelow is an example on how to login to the API and fetch your own user information.\n\n```python\n# Step 1. We begin with creating a Configuration, which contains the username and password for authentication.\nimport vrchatapi\nfrom vrchatapi.api import authentication_api\nfrom vrchatapi.exceptions import UnauthorizedException\nfrom vrchatapi.models.two_factor_auth_code import TwoFactorAuthCode\nfrom vrchatapi.models.two_factor_email_code import TwoFactorEmailCode\n\nconfiguration = vrchatapi.Configuration(\n    username = 'username',\n    password = 'password',\n)\n\n# Step 2. VRChat consists of several API's (WorldsApi, UsersApi, FilesApi, NotificationsApi, FriendsApi, etc...)\n# Here we enter a context of the API Client and instantiate the Authentication API which is required for logging in.\n\n# Enter a context with an instance of the API client\nwith vrchatapi.ApiClient(configuration) as api_client:\n    # Set our User-Agent as per VRChat Usage Policy\n    api_client.user_agent = \"MyProject/1.0 my@email.com\"\n\n    # Instantiate instances of API classes\n    auth_api = authentication_api.AuthenticationApi(api_client)\n\n    try:\n        # Step 3. Calling getCurrentUser on Authentication API logs you in if the user isn't already logged in.\n        current_user = auth_api.get_current_user()\n    except UnauthorizedException as e:\n        if e.status == 200:\n            if \"Email 2 Factor Authentication\" in e.reason:\n                # Step 3.5. Calling email verify2fa if the account has 2FA disabled\n                auth_api.verify2_fa_email_code(two_factor_email_code=TwoFactorEmailCode(input(\"Email 2FA Code: \")))\n            elif \"2 Factor Authentication\" in e.reason:\n                # Step 3.5. Calling verify2fa if the account has 2FA enabled\n                auth_api.verify2_fa(two_factor_auth_code=TwoFactorAuthCode(input(\"2FA Code: \")))\n            current_user = auth_api.get_current_user()\n        else:\n            print(\"Exception when calling API: %s\n\", e)\n    except vrchatapi.ApiException as e:\n        print(\"Exception when calling API: %s\n\", e)\n\n    print(\"Logged in as:\", current_user.display_name)\n```\n\nSee [Examples](https://github.com/vrchatapi/vrchatapi-python/blob/main/examples/README.md) for more example usage on getting started.\n\n## Contributing\n\nContributions are welcome, but do not add features that should be handled by the OpenAPI specification.\n\nJoin the [Discord server](https://discord.gg/Ge2APMhPfD) to get in touch with us.\n    \n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "VRChat API Library for Python",
    "version": "1.17.3",
    "project_urls": null,
    "split_keywords": [
        "vrchat",
        " vrchatapi",
        " vrc"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d221ade14ad21332e33abf8cf6e194c44169e1b4c04b7febef4f36935da53e02",
                "md5": "185d70159d1892af885cd02bd4710895",
                "sha256": "1a23ec49823e0832ad49104d583fbf8acb127c7a4d4a4adb476c2a81148e0f0b"
            },
            "downloads": -1,
            "filename": "vrchatapi-1.17.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "185d70159d1892af885cd02bd4710895",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 364787,
            "upload_time": "2024-04-29T22:00:49",
            "upload_time_iso_8601": "2024-04-29T22:00:49.055599Z",
            "url": "https://files.pythonhosted.org/packages/d2/21/ade14ad21332e33abf8cf6e194c44169e1b4c04b7febef4f36935da53e02/vrchatapi-1.17.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ca293c9b8b9a8afe9a99668cac1cb40450a6eca7b050002f2ea17bf2c973d730",
                "md5": "5663a1c3d91be2cc9d767d1f38d1534f",
                "sha256": "3ebe0cea662dc8ecfbfd0cfbe0fd30fb3aa955a5e76ed5b2d2d1ae3cded1e0be"
            },
            "downloads": -1,
            "filename": "vrchatapi-1.17.3.tar.gz",
            "has_sig": false,
            "md5_digest": "5663a1c3d91be2cc9d767d1f38d1534f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 173429,
            "upload_time": "2024-04-29T22:00:51",
            "upload_time_iso_8601": "2024-04-29T22:00:51.428930Z",
            "url": "https://files.pythonhosted.org/packages/ca/29/3c9b8b9a8afe9a99668cac1cb40450a6eca7b050002f2ea17bf2c973d730/vrchatapi-1.17.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-29 22:00:51",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "vrchatapi"
}
        
Elapsed time: 0.24723s