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.
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.
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.
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!
| 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
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.
dataarray2 items · schema from #0 2 items
pageHeaderRendererobject2 fields
contentobject1 field
pageHeaderViewModelobject4 fields
titleobject1 field
dynamicTextViewModelobject3 fields
textobject1 field
rendererContextobject3 fields
loggingContextobject1 field
loggingDirectivesobject3 fields
visibilityobject1 field
clientVeSpecobject2 fields
accessibilityContextobject1 field
commandContextobject1 field
onTapobject1 field
innertubeCommandobject3 fields
commandMetadataobject1 field
webCommandMetadataobject3 fields
watchEndpointobject2 fields
watchEndpointSupportedOnesieConfigobject1 field
html5PlaybackOnesieConfigobject1 field
commonConfigobject1 field
imageobject1 field
contentPreviewImageViewModelobject4 fields
imageobject1 field
sourcesarray1 item · schema from #0 1 item
rendererContextobject3 fields
loggingContextobject1 field
loggingDirectivesobject1 field
accessibilityContextobject1 field
commandContextobject1 field
onTapobject1 field
innertubeCommandobject3 fields
commandMetadataobject1 field
webCommandMetadataobject3 fields
watchEndpointobject2 fields
watchEndpointSupportedOnesieConfigobject1 field
html5PlaybackOnesieConfigobject1 field
commonConfigobject1 field
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
processorobject1 field
borderImageProcessorobject1 field
textobject2 fields
styleRunsarray1 item · schema from #0 1 item
rendererContextobject3 fields
loggingContextobject1 field
loggingDirectivesobject3 fields
visibilityobject1 field
clientVeSpecobject2 fields
accessibilityContextobject1 field
commandContextobject1 field
onTapobject1 field
innertubeCommandobject3 fields
commandMetadataobject1 field
webCommandMetadataobject4 fields
browseEndpointobject2 fields
rendererContextobject1 field
loggingContextobject1 field
loggingDirectivesobject3 fields
visibilityobject1 field
clientVeSpecobject2 fields
rendererContextobject1 field
loggingContextobject1 field
loggingDirectivesobject3 fields
visibilityobject1 field
clientVeSpecobject2 fields
Response Codes
Status codes this endpoint can return, so you can handle errors before they surprise you in production.
API Pricing
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.
Music ID Mapping
Link a music ID directly to the Shorts videos using that track.
Usage Counts
See exactly how many Shorts currently use a given song.
Reach Metrics
Measure a track's traction across YouTube Shorts content.