Itunes api for music store list - ios

I am learning angular, for that i was use itunes api for my references. I want to list music albums and click that album i want to show details. I have found one url but in that there is no unique id. I want to unique id from each one from the list of albums. I have include that url below,
enter link description here
In this json, I did't get unique id from each item of the list. please provide correct url for get information and detail view of each items. If i get correct url i will practices small application in angular.

The first result from the URL you linked is:
{"wrapperType":"collection", "collectionType":"Album",
{""artistId":211192870, "collectionId":211192863,
{""artistName":"Louis Prima & Gia Maione", "collectionName":"Let's
{"Fly With Mary Poppins", "collectionCensoredName":"Let's Fly With
{"Mary Poppins",
{""artistViewUrl":"https://itunes.apple.com/us/artist/gia-
{"maione/id211192870?uo=4",
{""collectionViewUrl":"https://itunes.apple.com/us/album/lets-fly-
{"with-mary-poppins/id211192863?uo=4", "artworkUrl60":"http://is2.
{"mzstatic.com/image/thumb/Music/v4/5e/4c/b0/5e4cb014-26cd-
{"7b64-6dd6-b845750f88ce/source/60x60bb.jpg", "artworkUrl100":"htt
{"p://is2.mzstatic.com/image/thumb/Music/v4/5e/4c/b0/5e4cb014
{"-26cd-7b64-6dd6-b845750f88ce/source/100x100bb.jpg",
{""collectionPrice":9.99, "collectionExplicitness":"notExplicit",
{""trackCount":12, "copyright":"℗ 1965 Buena Vista Records",
{""country":"USA", "currency":"USD",
{""releaseDate":"2007-01-16T08:00:00Z", "primaryGenreName":"Jazz"}
Here's the URL to get those album details from the collection ID in that result:
https://itunes.apple.com/lookup?id=211192863&entity=album

I solved this using,
https://itunes.apple.com/search?term=jack+johnson&media=music
From this i get track id, and passed in to
https://itunes.apple.com/lookup?id=trackId&media=music
i passed this url and get detail page. Thanks

Related

Apple Music Kit - Play song with ID from user in storefront A for user with storefront B

If I am based in the US and I want to play the song "Sun" by Two Door Cinema Club I would use the ID 544390857.
I can do this in (for example) the systemMusicPlayer and the song begins to play in Apple Music.
If my friend is based in the UK and wants to play the same song, sending 544390857to the systemMusicPlayer results in the song not being recognised (and nothing played).
The GB storefront equivalent ID for that song is 674900368.
I have two questions:
Is there an easy way of me being able to play the ID from another storefront in Apple Music (using systemMusicPlayer) or would I have to repeat the search under the new, second storefront ID?
or, is there a way of taking one song ID (i.e. the US one) and exchanging it for the alternative (i.e. GB) one?
Thanks for any help you can give!
You could try to use Apple Music API to get the right info:
(Step 1 is only needed if you don't know the song name in advance, you only know the songIds)
Based on the storeFrontCountryCode ('US') and songId (matched to that 'US' store) you can get the songName ("Sun"), using 'Get song' API call.
You need to retrieve the user current storeFront. You can do it with requestStorefrontCountryCodeWithCompletionHandler)
You would get something like "GB".
With the songName ('Sun') and the user storeFrontCountryCode ('GB') we do a 'Search for catalog resources' to get the right song id.
Eventually to prevent issues with duplicated song names, you could add the artist name to the 'Search for catalog resources' api call.
You can use isrc property of the song to filter a search for song id in another region. From the returned list you can then compare which one is the most match.(ie. a song may appears in multiple albums and has different edits).
The first step would be query the isrc property of the song in the original region. For example:
GET https://api.music.apple.com/v1/catalog/us/songs/544390857
Then you will have the isrc string in the attributes dictionary, then query it in GB storefront:
GET https://api.music.apple.com/v1/catalog/gb/songs?filter[isrc]=XXXXXX
This method is much more accurate than search by song name + artist name.
The Doc link is here: Apple Music API
I think this is the API you're looking for:
Get Equivalent Catalog Songs by ID

Get all videos for a given user

I'm trying to find a way to retrieve all videos posted by a given user (eg: https://www.youtube.com/user/laliga/videos).
All the examples I've found online or the doc (https://developers.google.com/youtube/v3/docs/) seems to require either a playlist ID, channel ID or video ID.
Is there any way I can directly query the author's videos or am I forced to retrieve all playlists and then iterate over?
Thanks
You just need to map the user name to its channelID first via the YouTube API like so:
https://www.googleapis.com/youtube/v3/channels?forUsername=USER_NAME&part=id&key=API_KEY
Full docs: https://developers.google.com/youtube/v3/docs/channels/list
Then you can make a Videos:List call with that channelID to get the videos.
1)take your google key id and channel id and put inside below url
https://www.googleapis.com/youtube/v3/search?key=APIKEY&channelId=CHANNELID&part=snippet,id&order=date&maxResults=20
ex
https://www.googleapis.com/youtube/v3/search?key=adsjsdakhkjshd&channelId=sdahghsadhgj&part=snippet,id&order=date&maxResults=20

Specific category url in osclass

I am using osclass3.1 in my site www.carsangrah.com. I have deleted all the categories except one (buy used car). I am able to get non user friendly url for this category i.e. http://www.carsangrah.com/index.php?page=search&sCategory=2. Please suggest me how to get used friendly url for this category.
Thanks.
This is the solution
View::newInstance()->_exportVariableToView('category', osc_get_category('id', $id)); //Optional if the category is already exported
echo osc_search_category_url() ;

How can I return all songs by Album (collectionID) from Apple itunes search API

I want to do something like this:
https://itunes.apple.com/lookup?collectionid=211192863&entity=song
But it doesn't return the songs
I'm pretty sure they have such parameter since it is a pretty basic one
any tips are appreciated
Edit:
it seems I can pass ID also, but I don't know if I can trust it once I usd id input for artist search as well
You are very close - the proper API request should be:
https://itunes.apple.com/lookup?id=211192863&entity=song
Note, the first result returned is the Collection meta data, each of the following 12 results are the track meta data.
Your url is wrong, for search API url you should see below:
https://itunes.apple.com/search?id=211192863&entity=song&media=music
enjoy!!!

What does the number refer to in link

I am looking at old posts to try and figure out what's wrong with the hackbook example at https://github.com/facebook/facebook-ios-sdk/tree/master/sample/Hackbook .
In this post, Post image to facebook using graph api , it seems that his problem was 117795728310/photos" instead of me/photos
What does 117795728310 refer to? I'm assuming it's not his app id. If it's his user id, where can I find out what mine is?
Thanks,
Mich
The paths of the open graph usually start with the id of the object and then it's connections.
For example: 6708787004/feed will return the feed for the South Park page.
The id can be replaced with a "username", so the above example is the same as "southpark/feed".
And "me/feed" is the same as "YOUR_USER_ID/feed"
You can get your id in all kind of ways, it will be easier to just check "/me" in the graph explorer.
The id you posted is not of a user but a page (graph explorer)
It does look like a User ID.
Go to http://www.facebook.com/note.php?note_id=91532827198 to see how you get yours

Resources