# Improving Last.fm import time

**URL:** <https://community.metabrainz.org/t/improving-last-fm-import-time/555745>\
**Category:** ListenBrainz\
**Tags:** data-import\
**Created:** [October 18, 2021, 9:18pm UTC](https://community.metabrainz.org/t/improving-last-fm-import-time/555745 "2021-10-18T21:18:41Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Alioth](https://community.metabrainz.org/user_avatar/community.metabrainz.org/alioth/32/54922_2.png) [@Alioth](https://community.metabrainz.org/u/Alioth)\
**Post date:** [October 18, 2021, 9:18pm UTC](https://community.metabrainz.org/t/improving-last-fm-import-time/555745/1 "2021-10-18T21:18:41Z")

</div>

I only started using ListenBrainz recently, and the first thing I tried was to import my Last.fm history. For my account (about 422000 scrobbles) it takes several hours to process all pages of output (roughly 8500 pages).

I examined the code of the importer, and it looks like the importer is not specifying `limit` parameter to Last.fm API method `user.getRecentTracks` (as seen [here](https://github.com/metabrainz/listenbrainz-server/blob/3c255d084809e11c59295348ab5f290a953df112/listenbrainz/webserver/static/js/src/LastFMImporter.tsx#L167)), which means it defaults to a small value of 50 scrobbles returned per one API request.

The [API description](https://www.last.fm/api/show/user.getRecentTracks) states that the maximum value is 200, but this information is not accurate, as the API response for invalid `limit` value suggests even greater maximum value:

```auto
{
  "message": "limit param out of bounds (1-1000)",
  "error": 6
}

```

The value of 1000 works, I am aware of existing applications that use it (e.g. [https://lastfmstats.com](https://lastfmstats.com))

Is using the default value for `limit` parameter in the Last.fm importer deliberate? Has it ever been considered to increase this limit to 200, or maybe even 1000? That would considerably shorten import times.

---

_[View the full topic](https://community.metabrainz.org/t/improving-last-fm-import-time/555745)._
