Skip to content

Commit 0691f53

Browse files
committed
Add README.md
1 parent 5711f18 commit 0691f53

4 files changed

Lines changed: 201 additions & 3 deletions

File tree

‎README.md‎

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,62 @@
1-
# vrchatapi-python
1+
![](https://github.com/vrchatapi/vrchatapi.github.io/blob/master/assets/img/lang/lang_python_banner_1500x300.png?raw=true)
2+
3+
# VRChat API Library for Python
4+
5+
A Python client to interact with the unofficial VRChat API. Supports all REST calls specified in the [API specification](https://github.com/vrchatapi/specification).
6+
7+
## Disclaimer
8+
9+
This is the official response of the VRChat Team (from Tupper more specifically) on the usage of the VRChat API.
10+
11+
> 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:
12+
> * We do not provide documentation or support for the API.
13+
> * Do not make queries to the API more than once per 60 seconds.
14+
> * Abuse of the API may result in account termination.
15+
> * Access to API endpoints may break at any given time, with no warning.
16+
17+
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.
18+
19+
## Getting Started
20+
21+
First add the package to to your project:
22+
```bash
23+
pip install vrchatapi
24+
```
25+
26+
Below is an example on how to login to the API and fetch your own user information.
27+
28+
```python
29+
# Step 1. We begin with creating a Configuration, which contains the username and password for authentication.
30+
import vrchatapi
31+
from vrchatapi.api import authentication_api, users_api
32+
from pprint import pprint
33+
34+
configuration = vrchatapi.Configuration(
35+
username = 'username',
36+
password = 'password',
37+
)
38+
39+
# Step 2. VRChat consists of several API's (WorldsApi, UsersApi, FilesApi, NotificationsApi, FriendsApi, etc...)
40+
# Here we enter a context of the API Client and instantiate the Authentication API which is required for logging in.
41+
42+
# Enter a context with an instance of the API client
43+
with vrchatapi.ApiClient(configuration) as api_client:
44+
45+
# Instantiate instances of API classes
46+
auth_api = authentication_api.AuthenticationApi(api_client)
47+
48+
try:
49+
# Step 3. Calling getCurrentUser on Authentication API logs you in if the user isn't already logged in.
50+
current_user = auth_api.get_current_user()
51+
pprint("Logged in as:", current_user.display_name)
52+
except vrchatapi.ApiException as e:
53+
print("Exception when calling API: %s\n" % e)
54+
```
55+
56+
See [example.py](https://github.com/vrchatapi/vrchatapi-python/blob/main/example.py) for more example usage on getting started.
57+
58+
## Contributing
59+
60+
Contributions are welcome, but do not add features that should be handled by the OpenAPI specification.
61+
62+
Join the [Discord server](https://discord.gg/Ge2APMhPfD) to get in touch with us.

‎generate.sh‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,9 @@ sed -i '/headers = headers or {}/r patches/cookiejar_add.py' ./vrchatapi/rest.py
1717
sed -i 's/if _preload_content/abcdefvrc\n\n if _preload_content/g' ./vrchatapi/rest.py
1818
sed -i '/abcdefvrc/r patches/cookiejar_extract.py' ./vrchatapi/rest.py
1919
sed -i 's/ abcdefvrc//g' ./vrchatapi/rest.py
20+
21+
# Fix long_description error during pypi upload
22+
sed -i 's/.*VRChat API Banner.*/abcdefvrc/g' ./setup.py
23+
sed -i '/abcdefvrc/r README.md' ./setup.py
24+
sed -i 's/abcdefvrc//g' ./setup.py
25+
sed -i '/license/a long_description_content_type="text/markdown",' ./setup.py

‎pyproject.toml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=42",
4+
"wheel"
5+
]
6+
build-backend = "setuptools.build_meta"

0 commit comments

Comments
 (0)