http://localhost:8000/api/v1
Actuellement aucune authentification n'est requise. À implémenter pour la production.
GET /services/config/image-sourceResponse:
{"image_album_source": "spotify"}Valeurs possibles : spotify, lastfm
PATCH /services/config/image-sourceBody:
{"image_album_source": "lastfm"}Response:
{"image_album_source": "lastfm"}Valeurs acceptées : spotify, lastfm. Persisté dans config/app.json.
GET /collection/albumsQuery Parameters:
page(int, default: 1): Numéro de pagepage_size(int, default: 30): Nombre d'éléments par pagesearch(string, optional): Recherche dans titre ou artistesupport(string, optional): Filtrer par support (Vinyle, CD, Digital)year(int, optional): Filtrer par annéeis_soundtrack(boolean, optional): Filtrer les BOFsort_by(string, default: 'title'): Champ de tri- Valeurs acceptées:
title,artists,year,support,created_at
- Valeurs acceptées:
sort_order(string, default: 'asc'): Ordre de tri- Valeurs acceptées:
asc(croissant),desc(décroissant)
- Valeurs acceptées:
Exemples:
GET /collection/albums?sort_by=artists&sort_order=asc # Trier par artiste (A→Z)
GET /collection/albums?sort_by=year&sort_order=desc # Trier par année (plus récent)
GET /collection/albums?search=Pink%20Floyd&sort_by=title # Recherche + tri par titre
GET /collection/albums?support=CD&sort_by=created_at # Filtrer CDs, tri par date
Response:
{
"items": [
{
"id": 1,
"title": "Pastel Blues",
"year": 1965,
"support": "Vinyle",
"artists": ["Nina Simone"],
"images": ["https://..."],
"ai_info": "Description...",
"created_at": "2026-01-30T10:00:00Z",
"updated_at": "2026-01-30T10:00:00Z"
}
],
"total": 142,
"page": 1,
"page_size": 30,
"pages": 5
}GET /collection/albums/{album_id}Response:
{
"id": 1,
"title": "Pastel Blues",
"year": 1965,
"support": "Vinyle",
"artists": ["Nina Simone"],
"images": ["https://..."],
"ai_info": "Description...",
"resume": "Résumé long...",
"labels": ["Philips Records"],
"film_title": null,
"film_year": null,
"film_director": null,
"created_at": "2026-01-30T10:00:00Z",
"updated_at": "2026-01-30T10:00:00Z"
}GET /history/tracksQuery Parameters:
page(int): Numéro de pagepage_size(int): Nombre d'élémentssource(string): Filtrer par source (lastfm)loved(boolean): Filtrer favorisartist(string): Filtrer par artistealbum(string): Filtrer par albumstart_date(string): Date de début (YYYY-MM-DD)end_date(string): Date de fin (YYYY-MM-DD)
Response:
{
"items": [
{
"id": 1,
"timestamp": 1706612400,
"date": "2026-01-30 14:00",
"artist": "Nina Simone",
"title": "I Put a Spell on You",
"album": "Pastel Blues",
"loved": false,
"source": "lastfm",
"artist_image": "https://...",
"album_image": "https://...",
"album_lastfm_image": "https://...",
"ai_info": "Description..."
}
],
"total": 1250,
"page": 1,
"page_size": 50,
"pages": 25
}GET /history/timeline?date=2026-01-30Response:
{
"date": "2026-01-30",
"hours": {
"14": [
{
"id": 1,
"time": "14:00",
"artist": "Nina Simone",
"title": "I Put a Spell on You",
"album": "Pastel Blues",
"loved": false
}
]
},
"stats": {
"total_tracks": 45,
"unique_artists": 12,
"unique_albums": 8,
"peak_hour": 18
}
}GET /history/statsQuery Parameters:
start_date(string, optional)end_date(string, optional)
Response:
{
"total_tracks": 1250,
"unique_artists": 150,
"unique_albums": 200,
"peak_hour": 18,
"total_duration_seconds": 245000
}
⚠️ Note: Les endpoints de playlists sont temporairement désactivés durant la migration.
POST /playlists/generateRequest Body:
{
"algorithm": "top_sessions",
"max_tracks": 25,
"ai_prompt": null,
"name": "My Playlist"
}Algorithmes disponibles:
top_sessions: Pistes des sessions les plus longuesartist_correlations: Artistes souvent écoutés ensembleartist_flow: Transitions naturelles entre artistestime_based: Basé sur peak hourscomplete_albums: Albums écoutés en entierrediscovery: Pistes aimées mais pas écoutées récemmentai_generated: Génération par IA (nécessiteai_prompt)
Response:
{
"id": 1,
"name": "My Playlist",
"algorithm": "top_sessions",
"ai_prompt": null,
"track_count": 25,
"created_at": "2026-01-30T14:00:00Z"
}GET /playlists/{playlist_id}Response:
{
"id": 1,
"name": "My Playlist",
"algorithm": "top_sessions",
"track_count": 25,
"tracks": [
{
"track_id": 1,
"position": 1,
"title": "I Put a Spell on You",
"artist": "Nina Simone",
"album": "Pastel Blues",
"duration_seconds": 180
}
],
"total_duration_seconds": 4500,
"unique_artists": 10,
"unique_albums": 8,
"created_at": "2026-01-30T14:00:00Z"
}GET /playlists/{playlist_id}/export?format=m3uFormats disponibles: m3u, json, csv, txt
GET /services/tracker/statusResponse:
{
"running": true,
"last_track": "Nina Simone|I Put a Spell on You|Pastel Blues",
"interval_seconds": 120
}POST /services/tracker/startPOST /services/tracker/stopPOST /services/discogs/syncResponse:
{
"status": "success",
"synced_albums": 25,
"total_albums": 142
}POST /services/ai/generate-info?album_id=1Response:
{
"album_id": 1,
"ai_info": "Pastel Blues est un album de Nina Simone..."
}GET /search?q=nina&type=album&limit=20Query Parameters:
q(string, required): Requête de recherchetype(string, optional): Type (album, artist, track)limit(int, default: 20): Nombre de résultats
Response:
{
"query": "nina",
"albums": [...],
"artists": [...],
"tracks": [...]
}200: Success201: Created204: No Content400: Bad Request404: Not Found500: Internal Server Error