Uploaded image for project: 'ListenBrainz'
  1. ListenBrainz
  2. LB-1217

Extend /(user_name)/listen-count endpoint with range parameter

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • API
    • None

      As an API consumer currently it is only possible to get the overall listen count for a user. It would also be useful to get the listen count for one of the specified statistic periods.

      E.g. the ListenBrainz website already lists the total listen count for a time range, e.g. on https://listenbrainz.org/user/outsidecontext/reports/?range=week . But this data is not directly available via API.

      The data could partially be rertieved from the GET /1/stats/user/(user_name)/listening-activity endpoint. But this lists the listens per time segment of the selected range. And as this list of times also includes the previous period, without a clear distinction where that starts or ends, it is not trivial to get the same listen count for that period as it is displayed on LB.org.

       

      Proposed solutions:

      1. Extend GET /1/user/(user_name)/listen-count endpoint to provide a "range" parameter, that allows any of the ALLOWED_STATISTICS_RANGE ranges
      2. Alternatively extend the response of the GET /1/stats/user/(user_name)/listening-activity to include this total count of listens for the current period (not the previous one)

            Unassigned Unassigned
            outsidecontext Philipp Wolfer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                Version Package