0

I'm trying to get all instances of a certain song using the last.fm web api, but I seem to be getting the exact same results, regardless of the page number.

This is the URL I'm using:
requests.get("http://ws.audioscrobbler.com/2.0/?method=track.search&track=" + song + "&api_key=" + API_KEY + "&startPage=" + str(page_number) + "&format=json")

Is there something I'm missing, or is the pagination on the search portion of the api just...broken?

ehcall
  • 25
  • 1
  • 6
  • If you pull out the URL into a separate variable, can you verify that it looks like you expect? Specifically, the `str(page_number)` part – BJ Homer Dec 20 '18 at 03:24
  • Yep. Everything looks like it should look. `http://ws.audioscrobbler.com/2.0/?method=track.search&track=jingle+bells&api_key=myapikey&startPage=0&format=json` – ehcall Dec 20 '18 at 03:27

1 Answers1

0

I can’t find official documentation for their pagination, but based on last.fm API pagination, it looks like you might want page= instead of startPage=.

BJ Homer
  • 48,806
  • 11
  • 116
  • 129
  • You're right! That actually worked. I do get some weird repeats of pages, but at least pages are changing now. Thanks! – ehcall Dec 20 '18 at 03:39