Last.fm · Arazzo Workflow

Last.fm User Taste Profile

Version 1.0.0

Read a user's profile, find their top artist for a period, and surface that artist's top tracks.

1 workflow 1 source API 1 provider
View Spec View on GitHub MusicAudioScrobblingRecommendationsChartsPublic APIsAudioScrobblerArazzoWorkflows

Provider

lastfm

Workflows

user-taste-profile
Profile a user, find their top artist for a period, and pull that artist's top tracks.
Resolves a user's profile, ranks their top artists over a time window, and chains the leading artist into a top tracks lookup.
3 steps inputs: apiKey, limit, period, user outputs: playcount, topArtistName, topArtistTopTracks, topArtists, userName
1
userInfo
userGetInfo
Load the user's public profile, including play count and country.
2
userTopArtists
userGetTopArtists
Rank the user's most-played artists over the requested time period.
3
artistTopTracks
artistGetTopTracks
Fetch the most popular tracks for the user's top artist.

Source API Descriptions

Arazzo Workflow Specification

lastfm-user-taste-profile-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Last.fm User Taste Profile
  summary: Read a user's profile, find their top artist for a period, and surface that artist's top tracks.
  description: >-
    Builds a snapshot of a listener's taste. It loads the user profile, pulls
    their top artists for a chosen time period, selects the most-played artist,
    and then fetches that artist's most popular tracks so a recommendation
    surface can lead with a familiar name. Each step writes its request inline,
    including the required api_key and the format=json selector, so the flow is
    self-describing without the OpenAPI source.
  version: 1.0.0
sourceDescriptions:
- name: lastfmApi
  url: ../openapi/lastfm-openapi-original.yml
  type: openapi
workflows:
- workflowId: user-taste-profile
  summary: Profile a user, find their top artist for a period, and pull that artist's top tracks.
  description: >-
    Resolves a user's profile, ranks their top artists over a time window, and
    chains the leading artist into a top tracks lookup.
  inputs:
    type: object
    required:
    - apiKey
    - user
    properties:
      apiKey:
        type: string
        description: Your Last.fm API key.
      user:
        type: string
        description: The Last.fm username to profile.
      period:
        type: string
        description: Aggregation window for the user's top artists.
        default: 6month
      limit:
        type: integer
        description: Max items per page for the top artists and top tracks lists.
        default: 10
  steps:
  - stepId: userInfo
    description: >-
      Load the user's public profile, including play count and country.
    operationId: userGetInfo
    parameters:
    - name: api_key
      in: query
      value: $inputs.apiKey
    - name: format
      in: query
      value: json
    - name: user
      in: query
      value: $inputs.user
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      userName: $response.body#/user/name
      playcount: $response.body#/user/playcount
      country: $response.body#/user/country
  - stepId: userTopArtists
    description: >-
      Rank the user's most-played artists over the requested time period.
    operationId: userGetTopArtists
    parameters:
    - name: api_key
      in: query
      value: $inputs.apiKey
    - name: format
      in: query
      value: json
    - name: user
      in: query
      value: $steps.userInfo.outputs.userName
    - name: period
      in: query
      value: $inputs.period
    - name: limit
      in: query
      value: $inputs.limit
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      topArtistName: $response.body#/topartists/artist/0/name
      topArtists: $response.body#/topartists/artist
  - stepId: artistTopTracks
    description: >-
      Fetch the most popular tracks for the user's top artist.
    operationId: artistGetTopTracks
    parameters:
    - name: api_key
      in: query
      value: $inputs.apiKey
    - name: format
      in: query
      value: json
    - name: artist
      in: query
      value: $steps.userTopArtists.outputs.topArtistName
    - name: limit
      in: query
      value: $inputs.limit
    - name: autocorrect
      in: query
      value: 1
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      topTracks: $response.body#/toptracks/track
  outputs:
    userName: $steps.userInfo.outputs.userName
    playcount: $steps.userInfo.outputs.playcount
    topArtistName: $steps.userTopArtists.outputs.topArtistName
    topArtists: $steps.userTopArtists.outputs.topArtists
    topArtistTopTracks: $steps.artistTopTracks.outputs.topTracks