Post not yet marked as solved
Hi there,
I can see dateAdded when looking at the response of a get library playlist request via the Apple Music API, but this does not appear to exist on any tracks within a given library playlist.
I'm assuming that this just isn't there, but I'm asking here, in case I've missed it.
Thanks.
Hello everyone,
I am trying to understand how to decode the JSON response returned by the suggestions/top results endpoint in MusicKit
As you can see the response returns suggestions, which has two different types, Albums and Songs within the same 'suggestions' array. How can I decode the response even if there are different types using a single struct?
{
"results" : {
"suggestions" : [
{
"content" : {
"attributes" : {
"url" : "https:\/\/music.apple.com\/us\/artist\/megan-thee-stallion\/1258989914",
"name" : "Megan Thee Stallion",
"genreNames" : [
"Hip-Hop\/Rap"
]
},
"id" : "1258989914",
"relationships" : {
"albums" : {
"data" : [
{
"href" : "\/v1\/catalog\/us\/albums\/1537889223",
"type" : "albums",
"id" : "1537889223"
}
],
"next" : "\/v1\/catalog\/us\/artists\/1258989914\/albums?offset=25",
"href" : "\/v1\/catalog\/us\/artists\/1258989914\/albums"
}
},
"href" : "\/v1\/catalog\/us\/artists\/1258989914",
"type" : "artists"
},
"kind" : "topResults"
},
{
"content" : {
"href" : "\/v1\/catalog\/us\/artists\/991187319",
"attributes" : {
"genreNames" : [
"Hip-Hop\/Rap"
],
"url" : "https:\/\/music.apple.com\/us\/artist\/moneybagg-yo\/991187319",
"name" : "Moneybagg Yo"
},
"id" : "991187319",
"type" : "artists",
"relationships" : {
"albums" : {
"href" : "\/v1\/catalog\/us\/artists\/991187319\/albums",
"data" : [
{
"id" : "1550876571",
"href" : "\/v1\/catalog\/us\/albums\/1550876571",
"type" : "albums"
}
],
"next" : "\/v1\/catalog\/us\/artists\/991187319\/albums?offset=25"
}
}
},
"kind" : "topResults"
}
]
}
}
Post not yet marked as solved
Hello. I'm a beginner developer trying to release a music app.
My app is,
Use Shazamkit to provide information about music (such as album image of a song, music title and genre, etc.) that the user receives via audio.
Through Apple Music API, provide information about music searched by users (such as artist image, album image, playlist image, title and artist name, genre, etc.).
However, it was rejected by reviewers for the following reasons.
5.2.1(e) Legal: Intellectual Property - General
Of course, I am a member of the Apple Developer Program, and even though I only used APIs and Kits provided by Apple, I was rejected due to copyright issues.
For reference, my app does not have upload/download functions for audio and video, and does not include playback functions.
How do I resolve copyright issues?
Thank you.
Post not yet marked as solved
Hi,
I'm developing an app with ShazamKit and I'd like to check its license agreement in order to know what I can and what I can't do, but I can't find it anywhere.
Is there any link where I can find it?
Post not yet marked as solved
Hello, with the recent update of the Apple Music API allowing to retrieve artwork for artists, I wanted to know if it was possible to post an artwork when creating a playlist through the API? If so, what is the format and parameters to use and is it documented somewhere?
Thanks for your help
Post not yet marked as solved
Hello, I have a question regarding the update of playlists through the API. I haven't found this documented, but I prefer asking just in case I missed something.
Is there an endpoint/parameter to add tracks to a playlist by overriding the tracks that are in it?
I only found an endpoint to append tracks to a playlist, which is not enough for how my app works
Thanks!
Post not yet marked as solved
Hello, I'm using the Apple Music API to store tracks & albums links in my database and I need a way to determine if a track/album is available for purchase on iTunes or if it's a streaming one.
I'm currently using the "playParams" attribute to determine it. If it is present I consider the track to be streaming, if it's not, I consider it to be a purchasable track.
I'm not sure if this is the best way to do so, I'd gladly take your recommendations, maybe there's an attribute I missed on the API.
Post not yet marked as solved
Hello!
When creating a playlist we are getting an id which is the one in the user's library, it's not enough to create a link and share it with friends for example.
To do so, we need a global id. The only way I found to generate this global id is by clicking on the share button of the playlist on Apple Music. After doing this manual action, the global id is properly returned by the Playlist endpoint on the Apple Music API.
I wanted to know if there was a endpoint that could be called in order to generate this global id without having to go on the Apple Music app?
Thanks for your help
Post not yet marked as solved
How to get user's most play songs and albums on apple music by apple music api.
Post not yet marked as solved
Hi, I'm wondering if there's a way to use the iTunes store API to lookup a podcast by its ID and retrieve info on the latest 5 episodes.
My base URL is: https://itunes.apple.com/lookup?id=1493846689&limit=5&sort=recent
Based on the documentation provided here: https://affiliate.itunes.apple.com/resources/documentation/itunes-store-web-service-search-api/ my best guess is that I would need to specify an entity parameter in order to get information about each episode as opposed to the podcast as a whole. I've tried different entity values but to no avail.
If anyone has any suggestions or workarounds that would be much appreciated, thank you.
Post not yet marked as solved
Last year I built a jukebox app in Mac Catalyst that gives me greater control over my playlists. Specifically it allows scheduling of playlists at certain hours, maintains artist separation, and excludes songs from frequent playback by filtering out recently played items. With the exception of playback time not working and resorting to a weird fix, as reported here, I was very pleased with the result until I upgraded from Big Sur to Monterey this month. I then discovered that the MPMusicPlayerControllerNowPlayingItemDidChange notification has lost functionality, as it only works once per playback queue, then fails to fire until a new playback queue is called up. I had to build a workaround that changes out song info upon playback time reverting to zero, which seems an unnecessary addition to overhead. No one has posted about this yet, so I thought I’d put in my two cents on the matter. Thanks for any attention you can direct toward this… “bug”?
Post not yet marked as solved
At random points the recent-played endpoint will be missing songs that a users listened to. I will attach the most recent json but my issues is
I listened to 5 jazz songs this afternoon.
This morning I listened to 5 songs by the artist Trevor Hall.
Yesterday I listened to Astronaut in the Ocean.
When I was querying the endpoint this morning. The Trevor Halls songs were included in the return.
If I query the endpoint now, they are missing. In the 'Trevor_hall_missing.json' it goes directly from the jazz music, to astronaut in the ocean.
Earlier today (I will try and find the json and attach). it would be jazz, Trevor hall, then astronaut.
There was no music listened to in between this range.
trevor_hall_missing.json
trevor_hall_included.json
Post not yet marked as solved
In the recently played endpoint, if a user listens to the same song more than once and it only shows up once. For example if they listen to a 10 songs ago, and they listen to it again now. It will only show the most recent play
Post not yet marked as solved
Hi,
I'm developing a B2B web-app which will be only used internally by other businesses that already are subscribed to the Apple Developer Program.
This app has to communicate with the MusicKit API.
I'd like to know if I can ask those business to create a Media ID from their developer account and insert their Team ID, Key ID and Secret in my app, in order to be able to generate a token. I'd like to do so in order to avoid any possible request rate limit on my account in case I made the app use my Media ID for all their requests.
Is it possible or doing so I may violate any Apple license aggreement? I can't find this answer anywhere
Post not yet marked as solved
As per this documentation shared link below,
https://developer.apple.com/documentation/applemusicapi/create_a_new_library_playlist
I'm able to get developer token and music user token but I am getting error for 'Invalid Request Body' (400 Bad Request).
My body parameters are as follows:
{
"name": "Demo Playlist",
"description" : "This is Demo Playlist"
}
Please suggest with proper example for body parameters. Thanks!
Post not yet marked as solved
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.
I have an existing iOS app that uses MPMusicPlayerController systemMusicPlayer. When running on a MacBook with M1 processor, calling currentPlaybackTime returns 0 during play. Once paused, the correct playtime is returned.
Anyone else having this issue or have an idea of how to get the correct playtime?
Post not yet marked as solved
Hi all
Can anybody let me know how I can get chart data from iTunes?
I enrolled in developer programs for that but just noticed that it only provides Apple Music API.
Is there any way that I can check iTunes chart data?
It seems there is iTunes API but it is only for 'search'.
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)
Hi there!
I am trying to map the Apple Music API endpoints to MusicKit. For example, I am looking at the catalog playlist endpoints.
To get a catalog playlist by its identifier, it is:
let request = MusicCatalogResourceRequest<Playlist>(matching: \.id, equalTo: "pl.f4d106fed2bd41149aaacabb233eb5eb")
let response = try await request.response()
print(response.items)
For multiple identifiers, it is:
let request = MusicCatalogResourceRequest<Playlist>(matching: \.id, memberOf: ["pl.f4d106fed2bd41149aaacabb233eb5eb", "pl.4b364b8b182f4115acbf6deb83bd5222"])
let response = try await request.response()
print(response.items)
To get its relationship like more by curator and featured artists, I can set the properties:
var request = MusicCatalogResourceRequest<Playlist>(matching: \.id, equalTo: "pl.f4d106fed2bd41149aaacabb233eb5eb")
request.properties = [.featuredArtists, .moreByCurator, .tracks]
let response = try await request.response()
print(response.items)
My question is, how can I map the endpoint Get a Catalog Playlist's Relationship Directly by Name" to MusicKit:
https://api.music.apple.com/v1/catalog/{storefront}/playlists/{id}/{relationship}
The possible value of the relationship can be curator, library, or tracks. Where can I set these relationship values in the MusicKit request?
Thank you!