Explore the catalog with the Apple Music API

RSS for tag

Discuss the WWDC21 session Explore the catalog with the Apple Music API.

Posts under wwdc21-10291 tag

5 Posts

Post

Replies

Boosts

Views

Activity

Getting user library data after Xcode authorization
So I am trying to access my Heavy Rotation content using this command from the Apple Music API website: wget https://api.music.apple.com/v1/me/history/heavy-rotation I made sure to change "me" to my username on Apple Music and I ran this command from my Terminal. It is connecting to the Apple Music API but it is saying that the request is unauthorized. I was surprised by this because I have already granted access on my device after requestAuthorization ran once (after authorization it does not ask again). So why is it saying that the request is unauthorized? Do I need to use my developer token somewhere? Thanks. (base) MacBook-Pro-210:soundtrack nalinkrishnan$ wget https://api.music.apple.com/v1/theonlynalin/history/heavy-rotation --2022-05-02 12:04:18--  https://api.music.apple.com/v1/theonlynalin/history/heavy-rotation Resolving api.music.apple.com (api.music.apple.com)... 2001:559:19:608b::2a1, 2001:559:19:6099::2a1, 2001:559:19:6080::2a1, ... Connecting to api.music.apple.com (api.music.apple.com)|2001:559:19:608b::2a1|:443... connected. HTTP request sent, awaiting response... 401 Unauthorized Username/Password Authentication Failed.
0
0
1.2k
May ’22
How to make a playlist public/create a public playlist?
Hey everyone, I am creating playlist via the MusicKit API and by default it creates the playlist in the users library and the isPublic attribute is set to false. Is there a way to make the playlist public at the time of creation? (Only way to change isPublic = true at this time seems to be through the Music app right now)
1
0
2.6k
Apr ’22
How to get recommendations based on multiple tracks?
Hello, I am trying to get recommendations based on the identifier of multiple tracks. But I am unable to get any results Here is the code I have used to try to get recommendations based on one album let dataRequest = MusicDataRequest(urlRequest: URLRequest(url: URL(string: "https://api.music.apple.com/v1/me/recommendations/1571344275")!)) let dataResponse = try await dataRequest.response() For this I am getting the response: Failed to perform MusicDataRequest.Context(   url: https://api.music.apple.com/v1/me/recommendations/1571344275,   currentRetryCounts: [.other: 1] ) with MusicDataRequest.Error(   status: 404,   code: 40400,   title: "Resource Not Found",   detailText: "Resource with requested id was not found", I have tried used the identifier of songs/albums, to no success. What am I doing wrong?
1
0
2.1k
Dec ’21
Getting user library data after Xcode authorization
So I am trying to access my Heavy Rotation content using this command from the Apple Music API website: wget https://api.music.apple.com/v1/me/history/heavy-rotation I made sure to change "me" to my username on Apple Music and I ran this command from my Terminal. It is connecting to the Apple Music API but it is saying that the request is unauthorized. I was surprised by this because I have already granted access on my device after requestAuthorization ran once (after authorization it does not ask again). So why is it saying that the request is unauthorized? Do I need to use my developer token somewhere? Thanks. (base) MacBook-Pro-210:soundtrack nalinkrishnan$ wget https://api.music.apple.com/v1/theonlynalin/history/heavy-rotation --2022-05-02 12:04:18--  https://api.music.apple.com/v1/theonlynalin/history/heavy-rotation Resolving api.music.apple.com (api.music.apple.com)... 2001:559:19:608b::2a1, 2001:559:19:6099::2a1, 2001:559:19:6080::2a1, ... Connecting to api.music.apple.com (api.music.apple.com)|2001:559:19:608b::2a1|:443... connected. HTTP request sent, awaiting response... 401 Unauthorized Username/Password Authentication Failed.
Replies
0
Boosts
0
Views
1.2k
Activity
May ’22
How to make a playlist public/create a public playlist?
Hey everyone, I am creating playlist via the MusicKit API and by default it creates the playlist in the users library and the isPublic attribute is set to false. Is there a way to make the playlist public at the time of creation? (Only way to change isPublic = true at this time seems to be through the Music app right now)
Replies
1
Boosts
0
Views
2.6k
Activity
Apr ’22
How to get recommendations based on multiple tracks?
Hello, I am trying to get recommendations based on the identifier of multiple tracks. But I am unable to get any results Here is the code I have used to try to get recommendations based on one album let dataRequest = MusicDataRequest(urlRequest: URLRequest(url: URL(string: "https://api.music.apple.com/v1/me/recommendations/1571344275")!)) let dataResponse = try await dataRequest.response() For this I am getting the response: Failed to perform MusicDataRequest.Context(   url: https://api.music.apple.com/v1/me/recommendations/1571344275,   currentRetryCounts: [.other: 1] ) with MusicDataRequest.Error(   status: 404,   code: 40400,   title: "Resource Not Found",   detailText: "Resource with requested id was not found", I have tried used the identifier of songs/albums, to no success. What am I doing wrong?
Replies
1
Boosts
0
Views
2.1k
Activity
Dec ’21