Subaru API built with subarulink package. Current version built in Flask and can lock and unlock your Subaru that is subscribed to the Starlink services.
Used code from aws-subaru-api repository to convert chrisroedig's repository into a Flask app.
-Create integration to start engine with climate custom presets.
-Apply a API key to secure the Flask server and use environment variables instead of hard-coding the credentials
Clone the project
git clone https://github.com/krushil1/subaruAPI-V1.git
Go to the project directory
cd subaruAPI-V1
Setup virtual environment
python3 -m venv env
source env/bin/activate
Enter your credentials inside the subaru_link_service.py file
SUBARU_USERNAME=""
SUBARU_PASSWORD=""
SUBARU_DEVICE_ID="" # For device_id, use any 10 digit number. Ex: timestamp
SUBARU_DEVICE_NAME="subarulink"
SUBARU_VIN=""
SUBARU_PIN=""
Install the dependencies
pip install -r requirements.txt
Testing the server locally
python3 flaskapp.py
POST Request
Host: serverURL
Content-Type: application/json
{
"pin": "XXXX",
"command": "unlock",
}
POST Request
Host: serverURL
Content-Type: application/json
{
"pin": "XXXX",
"command": "lock",
}
Create an account on Vercel for deploying it to a live server!