Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Play Music API for Android

Tags:

I'm working on a music application for Android. I need two things:

  • Get album cover for artist, album name, track name, etc;
  • Open Google Play page for buying this album.

For the first thing I'm currently using iTunes API -- but this is not patriotic for true Android developer. If Google Play Music has similar service, I would preferred to use it. Does it exist?

What about second? I can use this code to show all search results according with my query:

Intent intent = new Intent(Intent.ACTION_VIEW)
                             .setData(Uri.parse("market://search?q=<My Query>"));
startActivity(intent);

But I want to show album or track buying page exactly. Is is possible for Google Play?

like image 823
bvitaliyg Avatar asked Nov 03 '13 16:11

bvitaliyg


People also ask

Does Google Play store have an API?

The Google Play Games Services Publishing API allows you to automate frequent tasks having to do with game services production and distribution. The Reporting API lets you retrieve information about your app's quality from Android vitals.

Is Google Play Music still available on Android?

Google Play Music is no longer available.


1 Answers

There's no official API for this from Google.

However, you can use an unofficial API that is being developed by Simon Weber. It's called Unofficial-Google-Music-API, and it seems to be actively maintained(as of this writing).

The documentation and examples are pretty straightforward, and you can find details about the song's metadata as listed here. Specifically, it gives an url to download cover art and the id for matching in the Play Store.

You may have to play around with the URL a bit for your search, though. For instance, you can use the returned albumMatchedId field to search by album like:

https://play.google.com/store/music/album?id=Bdkf6ywxmrhflvtasnayxlkgpcm

This should bring you to the album's page, where you can purchase each song or the entire album.

I haven't found a way to jump straight to a specific track, but I'm not sure if that's possible anyway, judging from the layout of the app.

like image 79
Geobits Avatar answered Sep 18 '22 08:09

Geobits