An unofficial API for character.ai for Python
Project description
💬 CharacterAI
An unofficial API for Character AI for Python using Playwright
💻 Installation
pip install characterai
🔐 Get TOKEN
For using library, you should get token
- Log in on character.ai
- Go to
Network
tab in DevTools and refresh page - Search
/dj-rest-auth/auth0/
- Copy
key
value
🔐 Get CHAR
This is a character ID, it's very easy to get it
- Open any chat
- Copy
char=
value from URL
📙 Example
Chatting
Simple program for chatting with character
from characterai import pyCAI
token = 'TOKEN'
character = 'CHAR'
client = pyCAI(token)
while True:
send = input('You: ')
print(f'Character: {client.chat.send_message(character, send)}')
📚 Functions
user
For information about the user, namely about you via a token, the answer is json
user.info()
user.posts()
user.followers()
user.following()
character
For character information, the answer is json
character.trending()
character.recommended()
character.categories()
character.get_info('CHAR')
chat
To work with the chat, get_history
answer is json
chat.get_history('CHAR')
chat.send_message('CHAR', 'YOUR MESSAGE')
⭐️ Features
- The only library for character.ai
- Asynchronous
- So easy to use
⚠️ Disclaimer
This library is written by a beginner in python, if you have any problems, write to me in Telegram
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
characterai-0.2.6.tar.gz
(4.7 kB
view details)
File details
Details for the file characterai-0.2.6.tar.gz
.
File metadata
- Download URL: characterai-0.2.6.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 446c7be860cc84e50d1fa6cab88c8a13c58c990d5d1dde723174d3c9bcd73490 |
|
MD5 | 3ba39626673665da408847856ab8f1a2 |
|
BLAKE2b-256 | c29e111a9303a9839978055afae542f8e16702b6f2bccf65b3b4cc02fcaec0d8 |