- API reference
- Search and match the catalog
Embed player
POST/public/embed/url
CoreAuthNo credential
This endpoint allows you to send a request with a share URL to any track, artist, or album from music service, and it will generate an embed player code (an iframe) for that resource, enabling easy embedding of the music player on a website or application.
This endpoint, in addition to the iframe will return available sizes of that music player, so if you would like to change the default size, you need to insert the selected height in two places: into the height property of a returned iframe as well as in the URL height param within that iframe src property.
Request body
application/json · required
url
string
requiredURL to track, album or artist of music service
Response
200application/json · EmbedPlayerResponseok
embedCode
string
requiredHTML iframe code used to embed music player
embedUrl
string
requiredURL used as the source of the iframe
sizes
EmbedPlayerSize[]
requiredAvailable sizes for iframe
sizes[].height
number
required
sizes[].label
string
required
defaultSize
EmbedPlayerSize
required
defaultSize.height
number
required
defaultSize.label
string
required
{
"embedCode": "<iframe title='embed-player' width='100%' height='152' src='https://api.musicapi.com/public/embed/track/28?height=152' allow='encrypted-media' style='border:none;position:relative;overflow:hidden;max-width:100%;'/>",
"embedUrl": "https://api.musicapi.com/public/embed/track/55754?height=152",
"sizes": [
{
"height": 152,
"label": "Medium"
}
],
"defaultSize": {
"height": 152,
"label": "Medium"
}
}