Support needed? Reach out! 📧

How to Scrape Youtube Music Posts And Shorts

This tutorial shows how to use Youtube Music Posts And Shorts API to scrape and crawl structured Youtube data in real-time.
Connect music IDs to related YouTube Shorts through our API and discover which tracks are driving short-form video trends while measuring their reach across the platform.

Access Youtube Data in 3 Steps

Start crawling Youtube music shorts data. Follow these steps to extract social media data in minutes.

1

Create Your Account

Go to our registration page and make an account. It's free, no credit card, and you get credits right away to play around with.

2

Verify Your Email Address

You'll get a verification email, click the link in it. Once that's done, you can grab your API token from the dashboard.

3

Make Your First API Call

Copy the code snippet below, swap in your API key, and run it. You'll get Youtube data back as JSON within a few seconds.

Code Sample

Here's a JavaScript example to get you going. Swap out the token and you're good, works the same way in any language that can make HTTP requests. Start collecting music shorts data via our REST API!

javascript-logo JavaScript
Youtube Music Id To Shorts
1 const root = 'https://ensembledata.com/apis'
2 const endpoint = '/youtube/music/id-to-shorts'
3 const params = {
4   "id""4qmFsgKsARIRRkVzZnZfYXVkaW9fcGl2b3QaeENBRHlCVlVLUmhJM0NndGFZVGgwU1VsMlNWVlZkeElMV21FNGRFbEpka2xWVlhjYUMwWkhVRlJDWmtGMGQwNVJJZzRJOEtVREVnZ0lEQkNBZ2Nta0F4b0xSa2RRVkVKbVFYUjNUbEVvc096US12VDZyTG40QVdnQpoCHGJyb3dzZS1mZWVkRkVzZnZfYXVkaW9fcGl2b3Q%3D",
5   "depth"1,
6   "token""YOUR-TOKEN-HERE"
7 }
8  
9 const queryString = new URLSearchParams(params).toString();
10 const url = `${root}${endpoint}?${queryString}`;
11  
12 await fetch(url)
13   .then(response => response.json())
14   .then(data => console.log(data))
15   .catch(error => console.error(error));
16  

Parameters

id (string) Music ID. REQUIRED
depth (integer) Abstraction of the API pagination. Depth 1 returns X results, depth N returns N * X results. Note that the exact number of results per depth (X) may differ per endpoint. Please refer to the specific endpoint description for more information.
token (string) Private token assigned to each client to access the APIs. REQUIRED

Example Response

Explore the fields returned by this endpoint. Click a row to expand nested objects and arrays, hover a value to copy it, or use "Expand all" to see everything at once.

JSON
Youtube Music Id To Shorts
dataarray2 items · schema from #0 2 items
pageHeaderRendererobject2 fields
pageTitlestring"Nonsense (Sped Up Version)"
contentobject1 field
pageHeaderViewModelobject4 fields
titleobject1 field
dynamicTextViewModelobject3 fields
textobject1 field
contentstring"Nonsense (Sped Up Version)"
maxLinesnumber2
rendererContextobject3 fields
loggingContextobject1 field
loggingDirectivesobject3 fields
trackingParamsstring"CBQQj-QKIhMI8d6CqLfphQMVrsc_BB16MgXV"
visibilityobject1 field
typesstring"12"
clientVeSpecobject2 fields
uiTypenumber176655
veCounternumber725149087
accessibilityContextobject1 field
labelstring"Nonsense (Sped Up Version)"
commandContextobject1 field
onTapobject1 field
innertubeCommandobject3 fields
clickTrackingParamsstring"CBQQj-QKIhMI8d6CqLfphQMVrsc_BB16MgXV"
commandMetadataobject1 field
webCommandMetadataobject3 fields
urlstring"/watch?v=zSLLyBci-EI"
webPageTypestring"WEB_PAGE_TYPE_WATCH"
rootVenumber3832
watchEndpointobject2 fields
videoIdstring"zSLLyBci-EI"
watchEndpointSupportedOnesieConfigobject1 field
html5PlaybackOnesieConfigobject1 field
commonConfigobject1 field
urlstring"https://rr3---sn-ab5sznzs.googlevideo.com/initplayback?source=youtube&…"
imageobject1 field
contentPreviewImageViewModelobject4 fields
imageobject1 field
sourcesarray1 item · schema from #0 1 item
urlstring"https://lh3.googleusercontent.com/okiCBLFN89NkTJmznpN43t4ibp4bwD38MKPh…"
widthnumber1400
heightnumber1400
stylestring"CONTENT_PREVIEW_IMAGE_STYLE_SQUARE"
layoutModestring"CONTENT_PREVIEW_IMAGE_LAYOUT_MODE_UNKNOWN"
rendererContextobject3 fields
loggingContextobject1 field
loggingDirectivesobject1 field
trackingParamsstring"CBMQ5KQJIhMI8d6CqLfphQMVrsc_BB16MgXV"
accessibilityContextobject1 field
labelstring"Go to video"
commandContextobject1 field
onTapobject1 field
innertubeCommandobject3 fields
clickTrackingParamsstring"CBMQ5KQJIhMI8d6CqLfphQMVrsc_BB16MgXV"
commandMetadataobject1 field
webCommandMetadataobject3 fields
urlstring"/watch?v=zSLLyBci-EI"
webPageTypestring"WEB_PAGE_TYPE_WATCH"
rootVenumber3832
watchEndpointobject2 fields
videoIdstring"zSLLyBci-EI"
watchEndpointSupportedOnesieConfigobject1 field
html5PlaybackOnesieConfigobject1 field
commonConfigobject1 field
urlstring"https://rr3---sn-ab5sznzs.googlevideo.com/initplayback?source=youtube&…"
metadataobject1 field
contentMetadataViewModelobject3 fields
metadataRowsarray2 items · schema from #0 2 items
metadataPartsarray1 item · schema from #0 1 item
avatarStackobject1 field
avatarStackViewModelobject3 fields
avatarsarray1 item · schema from #0 1 item
avatarViewModelobject3 fields
imageobject2 fields
sourcesarray1 item · schema from #0 1 item
urlstring"https://yt3.ggpht.com/33C8OwZRHkFh8XRbSbe8VFMLgnc-8fzyFY2ESbSegA4avDdu…"
widthnumber48
heightnumber48
processorobject1 field
borderImageProcessorobject1 field
circularbooleantrue
accessibilityTextstring"Go to channel"
avatarImageSizestring"AVATAR_SIZE_XS"
textobject2 fields
contentstring"Sabrina Carpenter"
styleRunsarray1 item · schema from #0 1 item
startIndexnumber0
fontNamestring""
fontSizenumber0
fontColornumber4289374890
rendererContextobject3 fields
loggingContextobject1 field
loggingDirectivesobject3 fields
trackingParamsstring"CBIQi6ULIhMI8d6CqLfphQMVrsc_BB16MgXV"
visibilityobject1 field
typesstring"12"
clientVeSpecobject2 fields
uiTypenumber184971
veCounternumber725149085
accessibilityContextobject1 field
labelstring"Go to channel"
commandContextobject1 field
onTapobject1 field
innertubeCommandobject3 fields
clickTrackingParamsstring"CBIQi6ULIhMI8d6CqLfphQMVrsc_BB16MgXV"
commandMetadataobject1 field
webCommandMetadataobject4 fields
urlstring"/channel/UCPKWE1H6xhxwPlqUlKgHb_w"
webPageTypestring"WEB_PAGE_TYPE_CHANNEL"
rootVenumber3611
apiUrlstring"/youtubei/v1/browse"
browseEndpointobject2 fields
browseIdstring"UCPKWE1H6xhxwPlqUlKgHb_w"
paramsstring"8gYFCgOaAQA%3D"
delimiterstring"•"
rendererContextobject1 field
loggingContextobject1 field
loggingDirectivesobject3 fields
trackingParamsstring"CBEQ9eQKIhMI8d6CqLfphQMVrsc_BB16MgXV"
visibilityobject1 field
typesstring"12"
clientVeSpecobject2 fields
uiTypenumber176757
veCounternumber725149083
rendererContextobject1 field
loggingContextobject1 field
loggingDirectivesobject3 fields
trackingParamsstring"CBAQot8KIhMI8d6CqLfphQMVrsc_BB16MgXV"
visibilityobject1 field
typesstring"12"
clientVeSpecobject2 fields
uiTypenumber176034
veCounternumber725149081

Response Codes

Status codes this endpoint can return, so you can handle errors before they surprise you in production.

200SuccessSuccessful Response
422Client ErrorValidation Error
491Client ErrorToken not found
492Client ErrorEmail not verified
493Client ErrorSubscription expired
495Client ErrorAll daily units used
500Server ErrorSomething went wrong

API Pricing

#returned_shorts / 10 units Cost per successful call to this endpoint.

Fetch Youtube Data at Scale

Track YouTube music trends at scale and see how audio choices translate into views and engagement in short-form video content.

deco-icon

Music ID Mapping

Link a music ID directly to the Shorts videos using that track.

deco-icon

Usage Counts

See exactly how many Shorts currently use a given song.

deco-icon

Reach Metrics

Measure a track's traction across YouTube Shorts content.