API Endpoint url is api.codcatdev.site/lastfmPlaying. Lets start
For getting a card, you need a GET request to api
curl https://api.codcatdev.site/lastfmPlaying/?user={USER}<img alt="card" src="https://api.codcatdev.site/lastfmPlaying/?user={USER}">
or
Return a svg card with content-type image/svg+xml; charset=utf-8
Parameters
| Arg | Value | Description |
|---|---|---|
user |
String (e.g: ?user=codcatdev) |
Last.fm username |
{
"code":404, // Code error [INT]
"error":true, // Error or api response [BOOL]
"msg":"Not found", // Message in error [STR]
"data":{} // JSON. Maybe.. with error data [JSON]
}- Python 3.13
- 200 Mb+ RAM
Go to SSH on your server and run
git clone https://github.com/CodCatDev/Lastfm-Playing.git
cd Lastfm-Playing
cd srcCreate a Venv
python3 -m venv venvIf you get an error, install Python-Venv module
For Ubuntu/Debian: sudo apt update && sudo apt install python3-venv python3-pip -y
For CentOS/RHEL/Rocky Linux/AlmaLinux: sudo dnf install python3 python3-pip -y
For Alpine Linux: apk add python3 py3-pip
For Arch Linux: sudo pacman -Syu python python-pip --noconfirm
open venv and install libs
source venv/bin/activateP.s if it not working, use a SH command:
. venv/bin/activateAnd install libs
pip install -r requirements.txtgunicorn --bind 0.0.0.0:80 app:appAnd done! Server running on http://YOUR_SERVER_IP/
For self-host, endpoint is different!
curl http://YOUR_SEVRER_IP/api/v1/?user={USER}<img alt="card" src="http://YOUR_SEVRER_IP/api/v1/?user={USER}">
or
Return a svg card with content-type image/svg+xml; charset=utf-8
Parameters
| Arg | Value | Description |
|---|---|---|
user |
String (e.g: ?user=codcatdev) |
Last.fm username |