0

This is what I have:

$.ajax({
  type:'get',
  url: 'https://services.rdio.com/api/1/',
  dataType: "JSONP",
  method: 'getTopCharts'
  success: function(data) {
    console.log(data);
  }
})

I'm not very good with using APIs. I would like to get the top charts in json format. Right now this is what I see in the console with an x beside it:

https://services.rdio.com/api/1/?method=getTopCharts&callback=jQuery21406818272015079856_1447092130458&_=1447092130459

Do I need to use an API key? In the docs it says does not require user authentication. So how do I get my list?

M K
  • 11
  • 2

1 Answers1

0

All Rdio API requests must use the POST method and contain an access token. Checkout the Rdio API Overview. Rdio doesn't support JSONP, but CORS is supported. Using jQuery, the request would look like:

$.ajax({
  method: "POST",
  url: "https://services.rdio.com/api/1/get",
  data: {
    method: "get",
    keys: "r139688",
    access_token: "ACCESS_TOKEN"
  }
})

You'll need to fill-in your own access token. Checkout the OAuth 2.0 documentation for how to generate an access token.

devin_s
  • 3,345
  • 1
  • 27
  • 32