Skip to content

artists

artist profile API endpoints.

create_artist(request: CreateArtistRequest, db: Annotated[AsyncSession, Depends(get_db)], auth_session: Session = Depends(require_auth)) -> ArtistResponse

create or update artist profile for authenticated user.

if a minimal Artist record was created during OAuth login, this updates it with the user’s profile setup choices. otherwise creates a new record.

get_my_artist_profile(db: Annotated[AsyncSession, Depends(get_db)], auth_session: Session = Depends(require_auth)) -> ArtistResponse

get authenticated user’s artist profile.

update_my_artist_profile(request: UpdateArtistRequest, db: Annotated[AsyncSession, Depends(get_db)], auth_session: Session = Depends(require_auth)) -> ArtistResponse

update authenticated user’s artist profile.

get_artists_batch(dids: list[str], db: Annotated[AsyncSession, Depends(get_db)]) -> dict[str, ArtistResponse]

get artist profiles for multiple DIDs (public endpoint).

returns a dict mapping DID -> artist data for any DIDs that exist in our database. DIDs not found are simply omitted from the response.

get_artist_profile_by_handle(handle: str, db: Annotated[AsyncSession, Depends(get_db)]) -> ArtistResponse

get artist profile by handle (public endpoint).

get_artist_profile_by_did(did: str, db: Annotated[AsyncSession, Depends(get_db)]) -> ArtistResponse

get artist profile by DID (public endpoint).

get_artist_analytics(artist_did: str, db: Annotated[AsyncSession, Depends(get_db)]) -> AnalyticsResponse

get public analytics for any artist by DID.

returns zeros if artist has no tracks.

get_my_analytics(db: Annotated[AsyncSession, Depends(get_db)], auth_session: Session = Depends(require_auth)) -> AnalyticsResponse

get analytics for authenticated artist.

returns zeros if artist has no tracks - no need to verify artist exists.

refresh_artist_avatar(did: str, db: Annotated[AsyncSession, Depends(get_db)]) -> RefreshAvatarResponse

refresh an artist’s avatar from Bluesky (public endpoint).

called when the frontend detects a stale/broken avatar URL (404). fetches the current avatar from Bluesky and updates the database.

request to create artist profile.

request to update artist profile.

artist profile response.

Methods:

normalize_avatar(cls, v: str | None) -> str | None

normalize avatar URL to use Bluesky CDN.

top item in analytics.

analytics data for artist.

response from avatar refresh.