Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making JSON calls to Unoffical Pandora API

So I was listening to Pandora at work, and was like, Man, it would be really cool to get the station list of Pandora, or interact with it remotely in some capacity..

So I found this unofficial Pandora API which just returns a bunch of JSON objects which look pretty helpful and neat! Here is the link to the API: http://pan-do-ra-api.wikia.com/wiki/Json/5

The problem is I have never really used JSON and definitely never used this API so I am not sure how to go about doing things. I think that if someone gave me an example of how to say get the station list from my windows 7 desktop computer that would be really helpful and I could probably get the rest from there.

Thanks!

like image 714
Shaun314 Avatar asked Jun 11 '13 16:06

Shaun314


1 Answers

Again, with the comments from Marc B, I somewhat agree. However, to more generically answer your question- it's probably not worth your time.

Pandora request / response bodies are all sent over HTTP/HTTPS. However, they are all encrypted. There is a "public" list of keys you can use to encrypt and decrypt the responses. Once you have sorted all of that out, you'll have to use the APIs.

First you have to authenticate the user to get an Auth token. From there, you can access the APIs which require the auth tokens.

To your final point, JSON interfaces work in lots of different ways. Sometimes the API is specified through the URL itself like http://example.com/json/foo

Other times, it's specified in the request body through a POST.

If you really want to figure this out, I would play with it. I doubt anybody will post code on how to manipulate an API that isn't really "public". Pandora changes it somewhat frequently to purposefully break third party applications.

A simple JSON example:

POST to http://example.com/json/foo

{ param: "val",
  anotherParam: "val",
  responseType: "XML" }

Response might look like

{ status: 200,
  result: "you called the foo API" }
like image 62
Mothbawls Avatar answered Nov 09 '22 23:11

Mothbawls