An API wrapper for Max.
Project description
Max API Interface
The Max API Interface allows you to interact with the Max Messenger WebSocket API for sending messages, retrieving histories, and subscribing to real-time events.
Getting Started
Prerequisites
- Python 3.x
Installing
To install this library, run the following command in your terminal:
pip install MaxBridge
Obtaining the Authentication Token
To interact with the Max API, you'll need to authenticate and obtain a long-lived authentication token (from a legitimate web session). Follow these steps:
-
Open your web browser and navigate to Max Messenger Web Version.
-
Log in to your Max account if you haven't done so already.
-
After logging in, open the Developer Tools in your web browser (right-click anywhere on the page and select "Inspect" or press
F12). -
Go to the "Application" tab in Developer Tools.
-
Find and click on "Local storage" in the left sidebar under the "Storage" section. Look for the cookies belonging to the
https://web.max.rudomain. -
Find the authentication token. This token is a value of
__oneme_auth. -
Copy the value of the authentication token. You'll use this value to authenticate your requests in the MaxAPI class.
Using the Max API Interface
Initializing the MaxAPI class
To create an instance of the MaxAPI, pass the authentication token obtained from the previous step:
from MaxBridge import MaxAPI
auth_token = 'YOUR_AUTH_TOKEN_HERE'
api = MaxAPI(auth_token)
Available Methods
-
Sending a Message:
To send a message, use:
api.send_message(chat_id=12345678, text="Hello, World!")
-
Retrieving Message History:
To retrieve message history, use:
response = api.get_history(chat_id=12345678, count=20)
-
Subscribing to a Chat:
To subscribe to real-time events from a chat, use:
api.subscribe_to_chat(chat_id=12345678, subscribe=True)
-
Marking Messages as Read:
To mark a specific message as read, use:
api.mark_as_read(chat_id=12345678, message_id="12345678")
-
Getting video or file
To get video, use:
api.get_video(id=12345678)
To get file, use:
api.get_file(id=12345678, chat_id=12345678, msg_id="12345678")
-
Finding Contact by Phone Number:
To find a contact by their phone number, use:
api.get_contact_by_phone(phone_number="+12345678901")
-
Getting Chats:
To retrieve a specific chat by its ID, use:
api.get_chat_by_id(chat_id="12345678")
To retrieve all available chats, use:
api.get_all_chats()
-
Logging in:
To send vertify code, use:
api.send_vertify_code(phone_number="+12345678901")
to log in wth vertify code, use:
api.check_vertify_code(code=12345678)
The chat ID is required for most operations. You can obtain it from the chat URL or through other means specific to your application.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file maxbridge-1.5.2.tar.gz.
File metadata
- Download URL: maxbridge-1.5.2.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c38c91a0194651dc6a195436dd720532ece6aa7fc811e6787d0142be30926d5e
|
|
| MD5 |
551e5a5658d026d6c89d88a5cd6e5e1f
|
|
| BLAKE2b-256 |
2c8ab272759f74a613c86aa2dc415c7894cb2f431e326f44ef331345b4ee21b9
|
Provenance
The following attestation bundles were made for maxbridge-1.5.2.tar.gz:
Publisher:
python-publish.yml on Sharkow1743/MaxAPI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
maxbridge-1.5.2.tar.gz -
Subject digest:
c38c91a0194651dc6a195436dd720532ece6aa7fc811e6787d0142be30926d5e - Sigstore transparency entry: 552314616
- Sigstore integration time:
-
Permalink:
Sharkow1743/MaxAPI@7fe329e4507fea4fe5314594398f3c7a6219b14f -
Branch / Tag:
refs/tags/v1.5.2 - Owner: https://github.com/Sharkow1743
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@7fe329e4507fea4fe5314594398f3c7a6219b14f -
Trigger Event:
release
-
Statement type: