A little Python API wrapper to retrieve data and photos from the social netwotk BeReal.
Report a bug or request a feature
For users, you can just download the latest release and run it! Following information are mainly for developers.
This repository is tested with Python 3.7+.
You should install PyReal in a virtual environment. If you're unfamiliar with Python virtual environments, check out the user guide. First, create a virtual environment with the version of Python you're going to use and activate it.
Then, you will need to install the dependencies of the project:
pip install -r requirements.txt
Follow the instructions above then clone the repo (git clone https:://github.com/torresflo/PyReal.git
). You can now run main.py
to test the API or just write your own application.
The API is currently in development.
The goal of the API is to be able to retrieve data from BeReal (read-only), it is not planned to add write features like posting a photo or creating a comment.
Here are the current implemented and planned features:
- Past posted photos (Memories)
- Profile and User info
- Current Feed (Friends and Discovery)
- Reactions (RealMojis)
- Memories Video
Here is a small example of how to use the API:
from API.BeRealAPI import PyReal
pyReal = PyReal()
pyReal.connect(<phoneNumber>) # Process the connection
if pyReal.isConnected():
# Retrieve connected user info in form of a ConfidentialUser object
pyReal.getUserInfo()
# Retrieve friends list in form of an array of User object
pyReal.getFriends()
# Retrieve friend suggestion list in form of an array of FriendSuggestion object
pyReal.getFriendSuggestions()
# Retrieve sent friend requests list in form of an array of FriendRequest object
pyReal.getSentFriendRequests()
# Retrieve received friend requests list in form of an array of FriendRequest object
pyReal.getReceivedFriendRequests()
# Retrieve memory list in form of an array of Memory object
pyReal.getMemories()
# Retrieve friends feed in form of an array of Post object
pyReal.getFriendsFeed()
# Retrieve discovery feed in form of an array of Post object
pyReal.getDiscoveryFeed()
A small application (main.py
) can be used to access the features.
On the first launch, it will ask for your phone number in the E614 format: +[country code][number]
.
Then it will ask you to enter the OTP (one time password) that you will receive on this phone number. This will allow the program to retreive your token and establish the connection with BeReal under your account.
⚠️ Your token will be stored insaved\token.txt
, do not share it!
With the current version, the program will automatically download all your posted photos (Memories). Images are stored in saved\photos
and are composed of both the front and back photos of each post.
A common issue is to fail to send the phone number at the first step. This is usually due because quota was exceeded in the BeReal API. In this case, just retry until it works (it could take a couple of retry).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the GNU General Public License v3.0. See LICENSE
for more information.