Skip to content

tags

tag endpoints for track categorization.

get_tracks_by_tag(tag_name: str, db: Annotated[AsyncSession, Depends(get_db)], session: AuthSession | None = Depends(get_optional_session)) -> TagTracksResponse

get all tracks with a specific tag.

returns tag info and list of tracks tagged with that tag.

list_tags(db: Annotated[AsyncSession, Depends(get_db)], q: Annotated[str | None, Query(description='search query for tag names')] = None, limit: Annotated[int, Query(ge=1, le=100)] = 20) -> list[TagWithCount]

list tags with track counts, optionally filtered by query.

returns tags sorted by track count (most used first). use q parameter for prefix search (case-insensitive).

get_recommended_tags(track_id: int, db: Annotated[AsyncSession, Depends(get_db)], limit: Annotated[int, Query(ge=1, le=20)] = 5) -> RecommendedTagsResponse

recommend tags for a track based on ML genre classification.

uses effnet-discogs via Replicate to classify audio into genre labels. results are cached in track.extra[“genre_predictions”].

tag with track count for autocomplete.

tag detail with metadata.

response for getting tracks by tag.

a recommended tag with confidence score.

response for tag recommendations based on genre classification.