### Get Tilia Status using API Key Authentication Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/EconomyApi.md This example shows how to fetch the current status of the Tilia integration using API key authentication. Proper API key setup is required. ```python from __future__ import print_function import time import vrchatapi from vrchatapi.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.vrchat.cloud/api/1 # See configuration.py for a list of all supported configuration parameters. configuration = vrchatapi.Configuration( host = "https://api.vrchat.cloud/api/1" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: authCookie configuration.api_key['authCookie'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['authCookie'] = 'Bearer' # Enter a context with an instance of the API client with vrchatapi.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = vrchatapi.EconomyApi(api_client) try: # Get Tilia Status api_response = api_instance.get_tilia_status() pprint(api_response) except ApiException as e: print("Exception when calling EconomyApi->get_tilia_status: %s\n" % e) ``` -------------------------------- ### List Recent Worlds Example Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/WorldsApi.md This example shows how to list recent worlds using the WorldsApi. It includes setup for the API client configuration and demonstrates a basic call to the get_recent_worlds endpoint. ```python from __future__ import print_function import time import vrchatapi from vrchatapi.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.vrchat.cloud/api/1 # See configuration.py for a list of all supported configuration parameters. configuration = vrchatapi.Configuration( host = "https://api.vrchat.cloud/api/1" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Api Key Authentication (authCookie): configuration.api_key['authCookie'] = 'YOUR_API_KEY' # Uncomment below to setup prefix filter # configuration.api_key_prefix['authCookie'] = 'Bearer' # Enter a context with an instance of the API client with vrchatapi.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = vrchatapi.WorldsApi(api_client) featured = True # bool | Filters on featured results. (optional) sort = vrchatapi.SortOption() # SortOption | The sort order of the results. (optional) n = 60 # int | The number of objects to return. (optional) (default to 60) order = vrchatapi.OrderOption() # OrderOption | Result ordering (optional) offset = 56 # int | A zero-based offset from the default object sorting from where search results start. (optional) search = 'search_example' # str | Filters by world name. (optional) tag = 'tag_example' # str | Tags to include (comma-separated). Any of the tags needs to be present. (optional) notag = 'notag_example' # str | Tags to exclude (comma-separated). (optional) release_status = vrchatapi.ReleaseStatus() # ReleaseStatus | Filter by ReleaseStatus. (optional) max_unity_version = 'max_unity_version_example' # str | The maximum Unity version supported by the asset. (optional) min_unity_version = 'min_unity_version_example' # str | The minimum Unity version supported by the asset. (optional) platform = 'platform_example' # str | The platform the asset supports. (optional) user_id = 'user_id_example' # str | Target user to see information on, admin-only. (optional) try: # List Recent Worlds api_response = api_instance.get_recent_worlds(featured=featured, sort=sort, n=n, order=order, offset=offset, search=search, tag=tag, notag=notag, release_status=release_status, max_unity_version=max_unity_version, min_unity_version=min_unity_version, platform=platform, user_id=user_id) pprint(api_response) except ApiException as e: print("Exception when calling WorldsApi->get_recent_worlds: %s\n" % e) ``` -------------------------------- ### Get Product Purchase Example Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/EconomyApi.md Demonstrates how to retrieve a single product purchase using its ID. Requires API key authentication. ```python from __future__ import print_function import time import vrchatapi from vrchatapi.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.vrchat.cloud/api/1 # See configuration.py for a list of all supported configuration parameters. configuration = vrchatapi.Configuration( host = "https://api.vrchat.cloud/api/1" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: authCookie configuration.api_key['authCookie'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['authCookie'] = 'Bearer' # Enter a context with an instance of the API client with vrchatapi.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = vrchatapi.EconomyApi(api_client) product_purchase_id = 'product_purchase_id_example' # str | Must be a valid purchase ID. try: # Get Product Purchase api_response = api_instance.get_product_purchase(product_purchase_id) pprint(api_response) except ApiException as e: print("Exception when calling EconomyApi->get_product_purchase: %s\n" % e) ``` -------------------------------- ### Login and Get Current User Info with Basic Auth Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/AuthenticationApi.md This example shows how to authenticate using basic HTTP authentication (username and password) and retrieve the current user's information. It configures both API key and basic auth, highlighting the need to manage sessions carefully. ```python from __future__ import print_function import time import vrchatapi from vrchatapi.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.vrchat.cloud/api/1 # See configuration.py for a list of all supported configuration parameters. configuration = vrchatapi.Configuration( host = "https://api.vrchat.cloud/api/1" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: authCookie configuration.api_key['authCookie'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['authCookie'] = 'Bearer' # Configure HTTP basic authorization: authHeader configuration = vrchatapi.Configuration( username = 'YOUR_USERNAME', password = 'YOUR_PASSWORD' ) # Configure API key authorization: twoFactorAuthCookie configuration.api_key['twoFactorAuthCookie'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed ``` -------------------------------- ### Login and Get Current User Info with Auth Cookie Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/AuthenticationApi.md This example demonstrates how to authenticate using an auth cookie and retrieve the current user's information. It shows configuration for API key authorization and basic HTTP authorization, with a warning about session limits. ```python from __future__ import print_function import time import vrchatapi from vrchatapi.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.vrchat.cloud/api/1 # See configuration.py for a list of all supported configuration parameters. configuration = vrchatapi.Configuration( host = "https://api.vrchat.cloud/api/1" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: authCookie configuration.api_key['authCookie'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['authCookie'] = 'Bearer' # Configure HTTP basic authorization: authHeader configuration = vrchatapi.Configuration( username = 'YOUR_USERNAME', password = 'YOUR_PASSWORD' ) # Configure API key authorization: twoFactorAuthCookie configuration.api_key['twoFactorAuthCookie'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['twoFactorAuthCookie'] = 'Bearer' # Enter a context with an instance of the API client with vrchatapi.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = vrchatapi.AuthenticationApi(api_client) try: # Login and/or Get Current User Info api_response = api_instance.get_current_user() pprint(api_response) except ApiException as e: print("Exception when calling AuthenticationApi->get_current_user: %s\n" % e) ``` -------------------------------- ### Get Inventory with API Key Authentication Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/InventoryApi.md Demonstrates how to authenticate using an API key and retrieve inventory items. Ensure your API key is correctly configured in `configuration.api_key['authCookie']`. This example shows how to set various optional parameters for filtering and sorting. ```python from __future__ import print_function import time import vrchatapi from vrchatapi.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.vrchat.cloud/api/1 # See configuration.py for a list of all supported configuration parameters. configuration = vrchatapi.Configuration( host = "https://api.vrchat.cloud/api/1" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: authCookie configuration.api_key['authCookie'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['authCookie'] = 'Bearer' # Enter a context with an instance of the API client with vrchatapi.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = vrchatapi.InventoryApi(api_client) n = 60 # int | The number of objects to return. (optional) (default to 60) offset = 56 # int | A zero-based offset from the default object sorting from where search results start. (optional) holder_id = 'holder_id_example' # str | The UserID of the owner of the inventory; defaults to the currently authenticated user. (optional) equip_slot = vrchatapi.InventoryEquipSlot() # InventoryEquipSlot | Filter for inventory retrieval. (optional) order = 'order_example' # str | Sort order for inventory retrieval. (optional) tags = 'tags_example' # str | Filter tags for inventory retrieval (comma-separated). (optional) types = vrchatapi.InventoryItemType() # InventoryItemType | Filter for inventory retrieval. (optional) flags = vrchatapi.InventoryFlag() # InventoryFlag | Filter flags for inventory retrieval (comma-separated). (optional) not_types = vrchatapi.InventoryItemType() # InventoryItemType | Filter out types for inventory retrieval (comma-separated). (optional) not_flags = vrchatapi.InventoryFlag() # InventoryFlag | Filter out flags for inventory retrieval (comma-separated). (optional) archived = True # bool | Filter archived status for inventory retrieval. (optional) try: # Get Inventory api_response = api_instance.get_inventory(n=n, offset=offset, holder_id=holder_id, equip_slot=equip_slot, order=order, tags=tags, types=types, flags=flags, not_types=not_types, not_flags=not_flags, archived=archived) pprint(api_response) except ApiException as e: print("Exception when calling InventoryApi->get_inventory: %s\n" % e) ``` -------------------------------- ### get_instance Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/InstancesApi.md Get a specific instance. ```APIDOC ## GET /instances/{worldId}:{instanceId} ### Description Get a specific instance. ### Method GET ### Endpoint /instances/{worldId}:{instanceId} ### Parameters #### Path Parameters - **world_id** (str) - Required - Must be a valid world ID. - **instance_id** (str) - Required - Must be a valid instance ID. ### Response #### Success Response (200) - **Instance** (object) - Returns a single Instance object. ### Authorization - authCookie ``` -------------------------------- ### Respond to NotificationV2 using API Key Authentication Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/NotificationsApi.md Use this method to respond to a specific notification. Ensure API key authentication is configured. This example shows the setup for authentication. ```python from __future__ import print_function import time import vrchatapi from vrchatapi.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.vrchat.cloud/api/1 # See configuration.py for a list of all supported configuration parameters. configuration = vrchatapi.Configuration( host = "https://api.vrchat.cloud/api/1" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: authCookie configuration.api_key['authCookie'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['authCookie'] = 'Bearer' ``` -------------------------------- ### create_instance Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/InstancesApi.md Create an instance. ```APIDOC ## POST /instances ### Description Create an instance. ### Method POST ### Endpoint /instances ### Parameters #### Request Body - **create_instance_request** (object) - Required - ### Response #### Success Response (200) - **Instance** (object) - Returns a single Instance object. ### Authorization - authCookie ``` -------------------------------- ### Get System Time with Python SDK Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/MiscellaneousApi.md Retrieves the current system time from the VRChat API. Ensure the vrchatapi library is installed and configured. This example demonstrates basic API client instantiation and error handling. ```python from __future__ import print_function import time import vrchatapi from vrchatapi.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.vrchat.cloud/api/1 # See configuration.py for a list of all supported configuration parameters. configuration = vrchatapi.Configuration( host = "https://api.vrchat.cloud/api/1" ) # Enter a context with an instance of the API client with vrchatapi.ApiClient() as api_client: # Create an instance of the API class api_instance = vrchatapi.MiscellaneousApi(api_client) try: # Current System Time api_response = api_instance.get_system_time() pprint(api_response) except ApiException as e: print("Exception when calling MiscellaneousApi->get_system_time: %s\n" % e) ``` -------------------------------- ### Create File using FilesApi Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/FilesApi.md Demonstrates how to create a new file using the `create_file` method of the FilesApi. Requires API key authentication. Ensure the `vrchatapi` library is installed and configured. ```python from __future__ import print_function import time import vrchatapi from vrchatapi.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.vrchat.cloud/api/1 # See configuration.py for a list of all supported configuration parameters. configuration = vrchatapi.Configuration( host = "https://api.vrchat.cloud/api/1" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: authCookie configuration.api_key['authCookie'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['authCookie'] = 'Bearer' # Enter a context with an instance of the API client with vrchatapi.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = vrchatapi.FilesApi(api_client) create_file_request = vrchatapi.CreateFileRequest() # CreateFileRequest | (optional) try: # Create File api_response = api_instance.create_file(create_file_request=create_file_request) pprint(api_response) except ApiException as e: print("Exception when calling FilesApi->create_file: %s\n" % e) ``` -------------------------------- ### Create Product Listing Direct Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/EconomyApi.md Creates a product listing and returns the new ProductListing object. Requires API Key authentication. ```APIDOC ## POST /listings/direct ### Description Creates a listing and returns the new ProductListing object. The request body is based on observed fields and may be incomplete. ### Method POST ### Endpoint /listings/direct ### Parameters #### Request Body - **create_listing_request** (CreateListingRequest) - Required - ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) - **ProductListing** (ProductListing) - Description of the returned ProductListing object. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### List Props using API Key Authentication Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/PropsApi.md Demonstrates how to list props using API key authentication. Ensure your API key is correctly configured. ```python from __future__ import print_function import time import vrchatapi from vrchatapi.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.vrchat.cloud/api/1 # See configuration.py for a list of all supported configuration parameters. configuration = vrchatapi.Configuration( host = "https://api.vrchat.cloud/api/1" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: authCookie configuration.api_key['authCookie'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['authCookie'] = 'Bearer' # Enter a context with an instance of the API client with vrchatapi.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = vrchatapi.PropsApi(api_client) author_id = 'author_id_example' # str | Must be a valid user ID. n = 60 # int | The number of objects to return. (optional) (default to 60) offset = 56 # int | A zero-based offset from the default object sorting from where search results start. (optional) (optional) try: # List Props api_response = api_instance.list_props(author_id, n=n, offset=offset) pprint(api_response) except ApiException as e: print("Exception when calling PropsApi->list_props: %s\n" % e) ``` -------------------------------- ### Get Avatar Information with API Key Auth Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/AvatarsApi.md Retrieve details for a specific avatar using its ID. This example demonstrates API key authentication. ```python from __future__ import print_function import time import vrchatapi from vrchatapi.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.vrchat.cloud/api/1 # See configuration.py for a list of all supported configuration parameters. configuration = vrchatapi.Configuration( host = "https://api.vrchat.cloud/api/1" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: authCookie configuration.api_key['authCookie'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['authCookie'] = 'Bearer' # Enter a context with an instance of the API client with vrchatapi.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = vrchatapi.AvatarsApi(api_client) avatar_id = 'avatar_id_example' # str | Must be a valid avatar ID. try: # Get Avatar api_response = api_instance.get_avatar(avatar_id) pprint(api_response) except ApiException as e: print("Exception when calling AvatarsApi->get_avatar: %s\n" % e) ``` -------------------------------- ### Create Product Listing with API Key Authentication Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/EconomyApi.md Use this snippet to create a new product listing. API key authentication is required. ```python from __future__ import print_function import time import vrchatapi from vrchatapi.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.vrchat.cloud/api/1 # See configuration.py for a list of all supported configuration parameters. configuration = vrchatapi.Configuration( host = "https://api.vrchat.cloud/api/1" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: authCookie configuration.api_key['authCookie'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['authCookie'] = 'Bearer' # Enter a context with an instance of the API client with vrchatapi.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = vrchatapi.EconomyApi(api_client) create_listing_request = vrchatapi.CreateListingRequest() # CreateListingRequest | try: # Create Product Listing api_response = api_instance.create_product_listing_direct(create_listing_request) pprint(api_response) except ApiException as e: print("Exception when calling EconomyApi->create_product_listing_direct: %s\n" % e) ``` -------------------------------- ### Get User Notes Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/UsersApi.md Retrieves a list of recently updated user notes. Supports pagination with 'n' for the number of results and 'offset' for starting position. ```APIDOC ## GET /users/me/notes ### Description Get recently updated user notes. ### Method GET ### Endpoint /users/me/notes ### Parameters #### Query Parameters - **n** (int) - Optional - The number of objects to return. (default to 60) - **offset** (int) - Optional - A zero-based offset from the default object sorting from where search results start. ### Response #### Success Response (200) - **list[UserNote]** - Returns a list of UserNote objects. #### Error Response - **401** - Error response due to missing auth cookie. ``` -------------------------------- ### Create Product Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/EconomyApi.md Creates a new product and returns the newly created Product object. Requires API Key authentication. ```APIDOC ## POST /products ### Description Creates a product and returns the new Product object. ### Method POST ### Endpoint /products ### Parameters #### Request Body - **create_product_request** (CreateProductRequest) - Required - ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) - **Product** (Product) - Description of the returned Product object. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Start FileData Upload Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/FilesApi.md Initiates the process of uploading file data. This method is used to get a pre-signed URL for uploading parts of a file. It requires file ID, version ID, and file type. ```APIDOC ## start_file_data_upload ### Description Starts the process of uploading file data. This method is used to get a pre-signed URL for uploading parts of a file. It requires file ID, version ID, and file type. ### Method POST ### Endpoint /file/{fileId}/{versionId}/{fileType} ### Parameters #### Path Parameters - **file_id** (str) - Required - Must be a valid file ID. - **version_id** (int) - Required - Version ID of the asset. - **file_type** (str) - Required - Type of file. #### Query Parameters - **part_number** (int) - Optional - The part number to start uploading. If not provided, the first part will be started. ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) - **FileUploadURL** (FileUploadURL) - See [https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html](AWS REST docs - PUT Object) #### Response Example ```json { "example": "response body" } ``` ### Authorization [authCookie](../README.md#authCookie) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | |-------------|-------------| **200** | See [https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html](AWS REST docs - PUT Object) | **400** | Error response when trying to start an upload against a FileVersion that is already marked as `complete`. | ``` -------------------------------- ### Create Product with API Key Authentication Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/EconomyApi.md Use this snippet to create a new product. Ensure your API key is configured for authentication. ```python from __future__ import print_function import time import vrchatapi from vrchatapi.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.vrchat.cloud/api/1 # See configuration.py for a list of all supported configuration parameters. configuration = vrchatapi.Configuration( host = "https://api.vrchat.cloud/api/1" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: authCookie configuration.api_key['authCookie'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['authCookie'] = 'Bearer' # Enter a context with an instance of the API client with vrchatapi.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = vrchatapi.EconomyApi(api_client) create_product_request = vrchatapi.CreateProductRequest() # CreateProductRequest | try: # Create Product api_response = api_instance.create_product(create_product_request) pprint(api_response) except ApiException as e: print("Exception when calling EconomyApi->create_product: %s\n" % e) ``` -------------------------------- ### Get User Product Listings with API Key Authentication Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/EconomyApi.md Shows how to authenticate with an API key and retrieve a list of product listings for a specific user. Optional parameters allow filtering and hydration of results. ```python from __future__ import print_function import time import vrchatapi from vrchatapi.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.vrchat.cloud/api/1 # See configuration.py for a list of all supported configuration parameters. configuration = vrchatapi.Configuration( host = "https://api.vrchat.cloud/api/1" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: authCookie configuration.api_key['authCookie'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['authCookie'] = 'Bearer' # Enter a context with an instance of the API client with vrchatapi.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = vrchatapi.EconomyApi(api_client) user_id = 'user_id_example' # str | Must be a valid user ID. n = 60 # int | The number of objects to return. (optional) (default to 60) offset = 56 # int | A zero-based offset from the default object sorting from where search results start. (optional) hydrate = True # bool | Populates some fields and changes types of others for certain objects. (optional) listing_type = 'otp' # str | Filter user listings by category. Observed values include `otp` and `subscription`. (optional) group_id = 'group_id_example' # str | Must be a valid group ID. (optional) active = True # bool | Filter for users' listings and inventory bundles. (optional) try: # Get User Product Listings api_response = api_instance.get_product_listings(user_id, n=n, offset=offset, hydrate=hydrate, listing_type=listing_type, group_id=group_id, active=active) pprint(api_response) except ApiException as e: print("Exception when calling EconomyApi->get_product_listings: %s\n" % e) ``` -------------------------------- ### Get NotificationV2 Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/NotificationsApi.md Get a specific notification. ```APIDOC ## GET NOTIFICATION V2 ### Description Get a specific notification. ### Method GET ### Endpoint /notifications/{notificationId} ### Parameters #### Path Parameters - **notificationId** (str) - Required - The ID of the notification to retrieve. ### Response #### Success Response (200) - **NotificationV2** (object) - The requested notification. ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ``` -------------------------------- ### Publish Prop using API Key Authentication Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/PropsApi.md Demonstrates how to publish a prop using API key authentication. Ensure your API key is correctly configured. ```python from __future__ import print_function import time import vrchatapi from vrchatapi.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.vrchat.cloud/api/1 # See configuration.py for a list of all supported configuration parameters. configuration = vrchatapi.Configuration( host = "https://api.vrchat.cloud/api/1" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: authCookie configuration.api_key['authCookie'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['authCookie'] = 'Bearer' # Enter a context with an instance of the API client with vrchatapi.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = vrchatapi.PropsApi(api_client) prop_id = 'prop_id_example' # str | Prop ID. try: # Publish Prop api_response = api_instance.publish_prop(prop_id) pprint(api_response) except ApiException as e: print("Exception when calling PropsApi->publish_prop: %s\n" % e) ``` -------------------------------- ### get_short_name Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/InstancesApi.md Get the short name of an instance. ```APIDOC ## GET /instances/{worldId}:{instanceId}/shortName ### Description Get the short name of an instance. ### Method GET ### Endpoint /instances/{worldId}:{instanceId}/shortName ### Parameters #### Path Parameters - **world_id** (str) - Required - Must be a valid world ID. - **instance_id** (str) - Required - Must be a valid instance ID. ### Response #### Success Response (200) - **InlineResponse200** (object) - Returns the short name of the instance. ### Authorization - authCookie ``` -------------------------------- ### Get Product Listing using API Key Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/EconomyApi.md Shows how to fetch a product listing by its ID using API key authentication. The `hydrate` parameter can be set to `True` to include additional details in the response. ```python from __future__ import print_function import time import vrchatapi from vrchatapi.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.vrchat.cloud/api/1 # See configuration.py for a list of all supported configuration parameters. configuration = vrchatapi.Configuration( host = "https://api.vrchat.cloud/api/1" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: authCookie configuration.api_key['authCookie'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['authCookie'] = 'Bearer' # Enter a context with an instance of the API client with vrchatapi.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = vrchatapi.EconomyApi(api_client) product_id = 'product_id_example' # str | Must be a valid product ID. hydrate = True # bool | Populates some fields and changes types of others for certain objects. (optional) try: # Get Product Listing api_response = api_instance.get_product_listing(product_id, hydrate=hydrate) pprint(api_response) except ApiException as e: print("Exception when calling EconomyApi->get_product_listing: %s\n" % e) ``` -------------------------------- ### Get World Metadata Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/WorldsApi.md Retrieves metadata for a specific world. ```APIDOC ## GET /worlds/{worldId}/metadata ### Description Retrieves metadata for a specific world. ### Method GET ### Endpoint /worlds/{worldId}/metadata ### Parameters #### Path Parameters - **worldId** (str) - Required - The ID of the world. ### Response #### Success Response (200) - **WorldMetadata** (WorldMetadata) - The WorldMetadata object. ### Authorization [authCookie](../README.md#authCookie) ### HTTP request headers - **Accept**: application/json ``` -------------------------------- ### Install VRChat API Python Package Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/README.md Use pip to add the vrchatapi package to your project. ```bash pip install vrchatapi ``` -------------------------------- ### Get Store Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/EconomyApi.md Retrieves information about the VRChat economy store. ```APIDOC ## GET /economy/store ### Description Get Store ### Method GET ### Endpoint /economy/store ``` -------------------------------- ### Login with Username and Password (with 2FA Support) Source: https://context7.com/vrchatapi/vrchatapi-python/llms.txt Log in using HTTP Basic credentials. Handles TOTP and email 2FA by raising an exception that requires a subsequent verification call. Ensure to set a custom user agent. ```python 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="your_username", password="your_password", ) with vrchatapi.ApiClient(configuration) as api_client: api_client.user_agent = "MyApp/1.0 myemail@example.com" auth_api = authentication_api.AuthenticationApi(api_client) try: current_user = auth_api.get_current_user() except UnauthorizedException as e: if e.status == 200: if "Email 2 Factor Authentication" in e.reason: auth_api.verify2_fa_email_code( two_factor_email_code=TwoFactorEmailCode(input("Email 2FA Code: ")) ) elif "2 Factor Authentication" in e.reason: auth_api.verify2_fa( two_factor_auth_code=TwoFactorAuthCode(input("TOTP Code: ")) ) current_user = auth_api.get_current_user() else: raise except vrchatapi.ApiException as e: print(f"API error: {e}") else: print("Logged in as:", current_user.display_name) # Output: Logged in as: MyVRChatUsername ``` -------------------------------- ### Get Permission Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/MiscellaneousApi.md Retrieves details for a specific permission by its ID. ```APIDOC ## GET /permissions/{permissionId} ### Description Get Permission ### Method GET ### Endpoint /permissions/{permissionId} ### Parameters #### Path Parameters - **permissionId** (string) - Required - The ID of the permission to retrieve. ### Response #### Success Response (200) - **Permission** - The Permission object. ### Authorization [authCookie](../README.md#authCookie) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ``` -------------------------------- ### verify_pending2_fa Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/AuthenticationApi.md Verify a pending two-factor authentication (2FA) setup. ```APIDOC ## POST /auth/twofactorauth/totp/pending/verify ### Description Verify a pending two-factor authentication (2FA) setup. This endpoint is used after initiating the 2FA setup process to confirm the setup is complete and valid. ### Method POST ### Endpoint /auth/twofactorauth/totp/pending/verify ### Parameters #### Request Body - **code** (string) - Required - The verification code provided during the pending 2FA setup. ### Request Example ```json { "code": "123456" } ``` ### Response #### Success Response (200) Returns a JSON object indicating the success of the pending 2FA verification. ### Authorization Requires `authCookie` authentication. ``` -------------------------------- ### Invite User with Photo - Python Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/InviteApi.md Use this method to invite a user to your current instance, optionally including a photo. Ensure the user ID is valid and the image is a PNG file. ```python from __future__ import print_function import time import vrchatapi from vrchatapi.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.vrchat.cloud/api/1 # See configuration.py for a list of all supported configuration parameters. configuration = vrchatapi.Configuration( host = "https://api.vrchat.cloud/api/1" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: authCookie configuration.api_key['authCookie'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['authCookie'] = 'Bearer' # Enter a context with an instance of the API client with vrchatapi.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = vrchatapi.InviteApi(api_client) user_id = 'user_id_example' # str | Must be a valid user ID. data = vrchatapi.InviteRequest() # InviteRequest | image = '/path/to/file' # file | The binary blob of the png file. try: # Invite User with photo api_response = api_instance.invite_user_with_photo(user_id, data, image) pprint(api_response) except ApiException as e: print("Exception when calling InviteApi->invite_user_with_photo: %s\n" % e) ``` -------------------------------- ### Get Product Listing Alternate with API Key Authentication Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/EconomyApi.md Demonstrates how to authenticate using an API key ('authCookie') and retrieve a specific product listing by its ID. Ensure your API key is correctly configured. ```python from __future__ import print_function import time import vrchatapi from vrchatapi.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.vrchat.cloud/api/1 # See configuration.py for a list of all supported configuration parameters. configuration = vrchatapi.Configuration( host = "https://api.vrchat.cloud/api/1" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure API key authorization: authCookie configuration.api_key['authCookie'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['authCookie'] = 'Bearer' # Enter a context with an instance of the API client with vrchatapi.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = vrchatapi.EconomyApi(api_client) product_id = 'product_id_example' # str | Must be a valid product ID. try: # Get Product Listing (alternate) api_response = api_instance.get_product_listing_alternate(product_id) pprint(api_response) except ApiException as e: print("Exception when calling EconomyApi->get_product_listing_alternate: %s\n" % e) ``` -------------------------------- ### Get Group Transferability Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/GroupsApi.md Checks if a group can be transferred to a specified user. ```APIDOC ## GET /groups/{groupId}/transferability ### Description Returns the transferability of the group to a given user. ### Method GET ### Endpoint /groups/{groupId}/transferability ### Parameters #### Path Parameters - **groupId** (str) - Required - Must be a valid group ID. #### Query Parameters - **transferTargetId** (str) - Optional - The UserID of the prospective transferee. ### Response #### Success Response (200) - **GroupTransferable** - A single GroupTransferable object. ### Authorization [authCookie](../README.md#authCookie) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | |-------------|-------------| | **200** | Returns a single GroupTransferable object. | | **401** | Error response due to missing auth cookie. | | **403** | Error response when trying to perform operations on a group you are not member of. | | **404** | Error response when trying to perform operations on a non-existing group. | ``` -------------------------------- ### Get World Instance Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/WorldsApi.md Retrieves information about a specific instance of a world. ```APIDOC ## GET /worlds/{worldId}/{instanceId} ### Description Returns a worlds instance. ### Method GET ### Endpoint /worlds/{worldId}/{instanceId} ### Parameters #### Path Parameters - **worldId** (str) - Required - Must be a valid world ID. - **instanceId** (str) - Required - Must be a valid instance ID. ### Authorization [authCookie] ### Response #### Success Response (200) - **Instance** (object) - An Instance object containing details about the world instance. ### Response Example { "example": "{\"id\": \"ins_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\", \"worldId\": \"wrld_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\", ...}" } ``` -------------------------------- ### Get Recent Subscription Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/EconomyApi.md Retrieves the most recent user subscription information. ```APIDOC ## GET /get_recent_subscription ### Description Get the most recent user subscription. ### Method GET ### Endpoint /get_recent_subscription ### Parameters No parameters are required for this endpoint. ### Response #### Success Response (200) - **UserSubscription** - Returns the most recent user subscription. #### Response Example ```json { "example": "response body" } ``` ### Error Handling - **401** - Error response due to missing auth cookie. ``` -------------------------------- ### Create Product Listing Direct Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/EconomyApi.md Directly creates a product listing, likely for immediate availability or specific scenarios. ```APIDOC ## POST /listing ### Description Create Product Listing ### Method POST ### Endpoint /listing ``` -------------------------------- ### Get Current Subscriptions Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/EconomyApi.md Retrieves a list of all current subscriptions for the user. ```APIDOC ## GET /user/me/subscriptions ### Description Get a list of all current user subscriptions. ### Method GET ### Endpoint /user/me/subscriptions ### Response #### Success Response (200) - **list[UserSubscription]** - A list of UserSubscription objects. ### Response Example ```json [ { "id": "sub_def456", "plan": "premium", "status": "active", "expiresAt": "2024-10-27T10:00:00Z" } ] ``` ``` -------------------------------- ### get_user_tutorial_status Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/UsersApi.md Retrieves the tutorial status for a specific user. Requires user ID. ```APIDOC ## GET /users/{userId}/tutorial ### Description Retrieves the tutorial status for a specific user. ### Method GET ### Endpoint /users/{userId}/tutorial ### Parameters #### Path Parameters - **userId** (string) - Required - The ID of the user. ``` -------------------------------- ### Get Recent Subscription Source: https://github.com/vrchatapi/vrchatapi-python/blob/main/docs/EconomyApi.md Retrieves information about the most recent subscription for the user. ```APIDOC ## GET /user/subscription/recent ### Description Get Recent Subscription ### Method GET ### Endpoint /user/subscription/recent ```