You need to quickly verify how YouTube-related data will look in your app and prove the integration in Postman before wiring it into code. By the end of this guide, you’ll be able to call the Youtube Data API on Zyla API Hub in Postman, fetch similar videos for a given YouTube video, inspect real comment threads, and retrieve video details—then replicate the same calls in Python.
What the Youtube Data API on Zyla gives you
The Youtube Data API on Zyla provides ready-to-use endpoints to:
- Get similar videos to a given YouTube video.
- Fetch recent comments for a specified video.
- Retrieve details (title, description, publish date, counts) for a specific video.
Common use cases include content discovery (recommendations), moderation workflows (fetch latest comments), and analytics dashboards (video metadata and performance context). All endpoints are available under one marketplace account and one API key. Billing is subscription + quota (not pay-per-call). The first API offers a 7-day trial or 50 requests (no Free Plan). Check the API page for current access options and pricing.
Getting started on Zyla API Hub
To make your first call:
- Open the Youtube Data API page on Zyla API Hub and click Subscribe (or Start Free Trial when available).
- Create your account and get your API key. You can also start from the Zyla homepage at zylalabs.com.
- Use the Authorization header with a Bearer token: Authorization: Bearer YOUR_API_KEY.
If you’re new to the platform, you can Register to create a free account and obtain an API key, then subscribe to the API. Your usage is governed by subscription + quota (not pay-per-call).
Postman setup: import, headers, and first call
Quick steps
- Open Postman and create a new Request (or Collection).
- Set the method to GET and paste the exact request URL from the sections below.
- Add a header: Key = Authorization, Value = Bearer YOUR_API_KEY.
- Send the request and inspect the JSON in the Response pane.
Tip: You can also use the Import feature in Postman and paste a cURL command. Postman will parse the URL, method, and headers for you.
Endpoints you can test now
All URLs below are the real endpoints exposed by Zyla API Hub for this API. Do not add or change parameters; use them exactly as shown.
1) Similar Videos
Receive a list of videos related to a specific YouTube video ID.
- Method: GET
- URL: https://zylalabs.com/api/14/youtube-data-api/56/similar-videos
- Description: Pass a YouTube video ID to get a list of the most similar videos.
- Required query params:
- relatedToVideoId: 7ghhRHRP6t4
- part: id,snippet
- type: video
- Optional query params:
- maxResults: 50
Official cURL (copy/paste into Postman Import or your terminal):
curl -s -X GET "https://zylalabs.com/api/14/youtube-data-api/56/similar-videos?relatedToVideoId=7ghhRHRP6t4&part=id%2Csnippet&type=video&maxResults=50" \
-H "Authorization: Bearer YOUR_API_KEY"
Official JSON sample (what you can expect structurally):
{"kind":"youtube#searchListResponse","nextPageToken":"CDIQAA","pageInfo":{"totalResults":108,"resultsPerPage":50},"items":[{"kind":"youtube#searchResult","id":{"kind":"youtube#video","videoId":"mj0XInqZMHY"},"snippet":{"publishedAt":"2019-06-27T14:44:32Z","channelId":"UC0C-w0YjGpqDXGB8IHb662A","title":"Ed Sheeran - Beautiful People (feat. Khalid) [Official Music Video]","description":"The official music video for Ed Sheeran - Beautiful People (feat. @khalid)\nSubtract, the new album, out 05.05.2023. Pre-order: https://es.lnk.to/subtract\n \nTaken from No.6 Collaborations Project released in 2019, which featured the hit singles 'I Don't Care', 'Cross Me', 'Beautiful People', 'Blow', 'Best Part of Me', 'Antisocial', 'South of the Border' &'Take Me Back To London'. \n \nSubscribe to the Ed Sheeran channel for all the best and latest official music videos, behind the scenes and live performances. \nhttp://bit.ly/SubscribeToEdSheeran \n \nSee more official videos from Ed Sheeran here: \nhttps://www.youtube.com/watch?v=ryJgDL9jzKk&list=PLjp0AEEJ0-fGKG_3skl0e1FQlJfnx-TJz \n\nListen to more from the No. 6 Collaborations Project here : \nhttps://www.youtube.com/playlist?list=PLjp0AEEJ0-fHZDWhxhKo0wG08bMUcRy3l\n \nFollow Ed Sheeran on: \nInstagram: http://instagram.com/teddysphotos\nTikTok: https://www.tiktok.com/@edsheeran\nFacebook: http://www.facebook.com/EdSheeranMusic\nTwitter: http://twitter.com/edsheeran\nDiscord: http://discord.gg/edsheeran\nOfficial Website: http://edsheeran.com \n\nAbout Ed Sheeran: \nEd Sheeran may be the quintessential pop star of the 2010s: an internationally acclaimed, multi-award winning singer/songwriter who seems to acknowledge no boundaries between styles or eras with elements of folk, hip-hop, pop, dance, soul, and rock woven throughout his music. \n\nHis incredible catalogue includes the studio albums ‘+’ (plus), ‘x’ (multiply) and ‘÷’ (divide) which spawned hit singles such as ‘The A team’ , ’Lego House’, ‘Sing', ‘Thinking Out Loud’, ‘Photograph’, ‘Shape Of You’, ‘Castle on The Hill’ and ‘Perfect’. \n \nIn 2019, Ed Sheeran released the genre-spanning ‘No.6 Collaborations Project’ which featured a wide-range of artists including ‘Justin Bieber’, ‘Camilla’ Cabello’, ‘Travis Scott’, ‘Eminem’, ‘Cardi B, ‘Paulo Londra’, ‘Bruno Mars’ and ‘Stormzy’ amongst many others, producing hits such as ‘I Don’t Care’, ‘Beautiful People’, ‘South of The Border’ and ‘Take Me Back To London’. \n \n#EdSheeran #Khalid #BeautifulPeople","thumbnails":{"…
What to look for:
- kind: youtube#searchListResponse
- nextPageToken: use this to paginate in subsequent requests if you need more results.
- pageInfo.totalResults and pageInfo.resultsPerPage: counts useful for UI and batching decisions.
- items[].id.videoId: the YouTube video ID for each related video.
- items[].snippet.title, items[].snippet.publishedAt, and other snippet fields for UI display.
2) Video Comments
Get the latest comments about the specified video, including author, like count, and text.
- Method: GET
- URL: https://zylalabs.com/api/14/youtube-data-api/61/video-comments
- Required query params:
- part: snippet
- videoId: 7ghhRHRP6t4
- maxResults: 100
Official cURL:
Response notes:
- kind: youtube#commentThreadListResponse
- nextPageToken: use it to fetch the next page if present.
- items[].snippet.topLevelComment.snippet contains textDisplay, authorDisplayName, likeCount, publishedAt, etc.
- Timestamps are ISO 8601 (UTC) strings such as 2023-06-06T07:11:42Z; parse accordingly.
Example JSON (truncated in the official sample) includes fields like authorProfileImageUrl and authorChannelUrl if you need richer context.
3) Video Details
Retrieve core details for a single video ID, including title, description, publish date, and counters.
- Method: GET
- URL: https://zylalabs.com/api/14/youtube-data-api/62/video-details
- Required query params:
- id: 7ghhRHRP6t4
Official cURL:
Official JSON sample (truncated in the source):
{"kind":"youtube#videoListResponse","items":[{"kind":"youtube#video","id":"7ghhRHRP6t4","snippet":{"publishedAt":"2020-07-24T04:00:10Z","channelId":"UCN1hnUccO4FD5WfM7ithXaw","title":"Maroon 5 - Nobody's Love (Official Music Video)","description":"“Nobody’s Love” is out now: https://smarturl.it/NobodysLove \n\nFor more, visit: \nInstagram: https://www.instagram.com/maroon5 \nFacebook: https://www.facebook.com/maroon5 \nTwitter: https://twitter.com/maroon5 \nSign up for updates: http://smarturl.it/Maroon5.News \n\n// \n\nLYRICS \n\nYou could make a grown man cry\nIf you ever said goodbye\nNever let you go oh-woah oh-I\nNever let you go oh-woah oh-I\nYou could make a grown man cry\nIf you ever left my side\nNever let you go oh-woah oh-I\nNever let you go oh-woah oh-I\n\nYou’re the only hand in my back pocket\nIf you ever left I’d go psychotic\nHeaven hear me cryin cryin oh oh\nBaby you’re the key to my heart locket\nIf you ever left never unlock it\nLonely like an island, island oh oh\n\nIf my love ain’t your love it’s never gonna be nobody’s love \nNever gonna need nobody’s love, but yours, but yours\nIf my love ain’t your love it’s never gonna be nobody’s love\nNever gonna need nob…
What to look for:
- items[0].snippet.title and description for your UI.
- snippet.publishedAt (ISO 8601 UTC).
- Additional counts and fields may be present in the full response based on the API configuration.
Using Postman effectively with this API
Create a Postman Environment
- Open Environments in Postman, create a variable named API_KEY and paste your Zyla key.
- In request headers, set Authorization to: Bearer {{API_KEY}}.
Why: this keeps your key reusable across requests and collections, and avoids leaking it in shared cURL snippets.
Pagination and limits
- Similar Videos and Video Comments can return a nextPageToken field. Use it to paginate subsequent fetches.
- maxResults is available for Similar Videos (optional) and required for Video Comments in this API listing. Respect the provided values shown above.
- The first API on Zyla offers a 7-day trial or 50 requests. Monitor your quota in your Zyla dashboard; usage is subscription + quota.
Code sample: Python requests for Similar Videos
This example reproduces the Similar Videos call and extracts a list of video IDs and titles from the official response schema. Replace YOUR_API_KEY with your token. The URL and parameters must match exactly what’s documented here.
import os
import requests
API_KEY = os.getenv("ZylaApiKey", "YOUR_API_KEY")
url = "https://zylalabs.com/api/14/youtube-data-api/56/similar-videos"
params = {
"relatedToVideoId": "7ghhRHRP6t4",
"part": "id,snippet",
"type": "video",
"maxResults": "50",
}
headers = {
"Authorization": f"Bearer {API_KEY}"
}
resp = requests.get(url, headers=headers, params=params, timeout=30)
resp.raise_for_status()
data = resp.json()
# Extract core fields you likely need in your app:
items = data.get("items", [])
results = []
for it in items:
vid = (it.get("id") or {}).get("videoId")
title = (it.get("snippet") or {}).get("title")
published = (it.get("snippet") or {}).get("publishedAt")
if vid and title:
results.append({"videoId": vid, "title": title, "publishedAt": published})
print(f"Returned {len(results)} related videos")
for r in results[:5]:
print(f"- {r['videoId']}: {r['title']} (published {r['publishedAt']})")
# Handle pagination with nextPageToken if present:
next_token = data.get("nextPageToken")
if next_token:
print("More pages available. Use nextPageToken in a follow-up request.")
Real-world workflows you can ship this week
- Recommendation rail: Use Similar Videos to render a “Related Videos” carousel under a player. Cache responses for a few minutes to reduce repeated lookups on hot pages.
- Comment moderation triage: Pull Video Comments and surface authorDisplayName, textDisplay, likeCount, and publishedAt in a review queue.
- Metadata enrichment: When ingesting a catalog of video IDs, enrich each with Video Details to populate titles and descriptions for search indexing.
Each of these can be validated quickly in Postman first, then moved to production code with the exact URLs and headers shown above.
Calling the API from AI agents via MCP
Every Zyla API can be invoked through MCP-compatible clients (Claude Code, Cursor, Windsurf, and others) via the MCP endpoint. Point your tool to:
And provide your API key as appropriate for your client. The server URL supports apikey in the query when configuring the MCP transport: https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY. Once configured, your agent can call the same endpoints documented above, using the required parameters exactly as shown. Refer to your MCP client’s documentation for how to register tools and pass headers.
Troubleshooting tips
- 401/403 in Postman: Ensure the Authorization header is present and exactly “Bearer YOUR_API_KEY” (case-sensitive on the header name, space before the token).
- Empty items array: Double-check the video ID you passed. In this guide, all examples use 7ghhRHRP6t4.
- Pagination: If you see nextPageToken, you need a follow-up call with the token to continue fetching subsequent pages (where applicable).
- Rate and quota: The marketplace uses subscription + quota. Track usage in your Zyla account and check the API page for access details.
Where to find everything again
- API page: Youtube Data API on Zyla
- Marketplace home: zylalabs.com
FAQ
Q: Is there a free plan?
A: There’s no Free Plan. The first API offers a 7-day trial or 50 requests. Check the API page for current access options and pricing.
Q: How do I authenticate in Postman?
A: Add a header: Authorization with value Bearer YOUR_API_KEY. Make sure to include the space and the exact casing.
Q: How do I paginate results?
A: If the response includes nextPageToken, use it to request subsequent pages (where applicable). The response also includes pageInfo with resultsPerPage to guide batching.
Q: What timestamp format should I expect?
A: Timestamps such as publishedAt are ISO 8601 UTC strings (for example, 2019-06-27T14:44:32Z). Parse accordingly in your language of choice.
Q: Can I call this from an AI coding agent?
A: Yes. Configure your MCP-compatible client to use the Zyla MCP endpoint at https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY and pass the exact endpoints and parameters listed above.
Ready to test it yourself? Create your account, get an API key, and subscribe on the API page. Start here: Register. Then open the Youtube Data API, plug the cURL into Postman, and ship your integration this week.
Official API response
{"kind":"youtube#searchListResponse","nextPageToken":"CDIQAA","pageInfo":{"totalResults":108,"resultsPerPage":50},"items":[{"kind":"youtube#searchResult","id":{"kind":"youtube#video","videoId":"mj0XInqZMHY"},"snippet":{"publishedAt":"2019-06-27T14:44:32Z","channelId":"UC0C-w0YjGpqDXGB8IHb662A","title":"Ed Sheeran - Beautiful People (feat. Khalid) [Official Music Video]","description":"The official music video for Ed Sheeran - Beautiful People (feat. @khalid)\nSubtract, the new album, out 05.05.2023. Pre-order: https://es.lnk.to/subtract\n \nTaken from No.6 Collaborations Project released in 2019, which featured the hit singles 'I Don't Care', 'Cross Me', 'Beautiful People', 'Blow', 'Best Part of Me', 'Antisocial', 'South of the Border' &'Take Me Back To London'. \n \nSubscribe to the Ed Sheeran channel for all the best and latest official music videos, behind the scenes and live performances. \nhttp://bit.ly/SubscribeToEdSheeran \n \nSee more official videos from Ed Sheeran here: \nhttps://www.youtube.com/watch?v=ryJgDL9jzKk&list=PLjp0AEEJ0-fGKG_3skl0e1FQlJfnx-TJz \n\nListen to more from the No. 6 Collaborations Project here : \nhttps://www.youtube.com/playlist?list=PLjp0AEEJ0-fHZDWhxhKo0wG08bMUcRy3l\n \nFollow Ed Sheeran on: \nInstagram: http://instagram.com/teddysphotos\nTikTok: https://www.tiktok.com/@edsheeran\nFacebook: http://www.facebook.com/EdSheeranMusic\nTwitter: http://twitter.com/edsheeran\nDiscord: http://discord.gg/edsheeran\nOfficial Website: http://edsheeran.com \n\nAbout Ed Sheeran: \nEd Sheeran may be the quintessential pop star of the 2010s: an internationally acclaimed, multi-award winning singer/songwriter who seems to acknowledge no boundaries between styles or eras with elements of folk, hip-hop, pop, dance, soul, and rock woven throughout his music. \n\nHis incredible catalogue includes the studio albums ‘+’ (plus), ‘x’ (multiply) and ‘÷’ (divide) which spawned hit singles such as ‘The A team’ , ’Lego House’, ‘Sing', ‘Thinking Out Loud’, ‘Photograph’, ‘Shape Of You’, ‘Castle on The Hill’ and ‘Perfect’. \n \nIn 2019, Ed Sheeran released the genre-spanning ‘No.6 Collaborations Project’ which featured a wide-range of artists including ‘Justin Bieber’, ‘Camilla’ Cabello’, ‘Travis Scott’, ‘Eminem’, ‘Cardi B, ‘Paulo Londra’, ‘Bruno Mars’ and ‘Stormzy’ amongst many others, producing hits such as ‘I Don’t Care’, ‘Beautiful People’, ‘South of The Border’ and ‘Take Me Back To London’. \n \n#EdSheeran #Khalid #BeautifulPeople","thumbnails":{"…
Official API response
{"kind":"youtube#searchListResponse","nextPageToken":"CDIQAA","pageInfo":{"totalResults":108,"resultsPerPage":50},"items":[{"kind":"youtube#searchResult","id":{"kind":"youtube#video","videoId":"mj0XInqZMHY"},"snippet":{"publishedAt":"2019-06-27T14:44:32Z","channelId":"UC0C-w0YjGpqDXGB8IHb662A","title":"Ed Sheeran - Beautiful People (feat. Khalid) [Official Music Video]","description":"The official music video for Ed Sheeran - Beautiful People (feat. @khalid)\nSubtract, the new album, out 05.05.2023. Pre-order: https://es.lnk.to/subtract\n \nTaken from No.6 Collaborations Project released in 2019, which featured the hit singles 'I Don't Care', 'Cross Me', 'Beautiful People', 'Blow', 'Best Part of Me', 'Antisocial', 'South of the Border' &'Take Me Back To London'. \n \nSubscribe to the Ed Sheeran channel for all the best and latest official music videos, behind the scenes and live performances. \nhttp://bit.ly/SubscribeToEdSheeran \n \nSee more official videos from Ed Sheeran here: \nhttps://www.youtube.com/watch?v=ryJgDL9jzKk&list=PLjp0AEEJ0-fGKG_3skl0e1FQlJfnx-TJz \n\nListen to more from the No. 6 Collaborations Project here : \nhttps://www.youtube.com/playlist?list=PLjp0AEEJ0-fHZDWhxhKo0wG08bMUcRy3l\n \nFollow Ed Sheeran on: \nInstagram: http://instagram.com/teddysphotos\nTikTok: https://www.tiktok.com/@edsheeran\nFacebook: http://www.facebook.com/EdSheeranMusic\nTwitter: http://twitter.com/edsheeran\nDiscord: http://discord.gg/edsheeran\nOfficial Website: http://edsheeran.com \n\nAbout Ed Sheeran: \nEd Sheeran may be the quintessential pop star of the 2010s: an internationally acclaimed, multi-award winning singer/songwriter who seems to acknowledge no boundaries between styles or eras with elements of folk, hip-hop, pop, dance, soul, and rock woven throughout his music. \n\nHis incredible catalogue includes the studio albums ‘+’ (plus), ‘x’ (multiply) and ‘÷’ (divide) which spawned hit singles such as ‘The A team’ , ’Lego House’, ‘Sing', ‘Thinking Out Loud’, ‘Photograph’, ‘Shape Of You’, ‘Castle on The Hill’ and ‘Perfect’. \n \nIn 2019, Ed Sheeran released the genre-spanning ‘No.6 Collaborations Project’ which featured a wide-range of artists including ‘Justin Bieber’, ‘Camilla’ Cabello’, ‘Travis Scott’, ‘Eminem’, ‘Cardi B, ‘Paulo Londra’, ‘Bruno Mars’ and ‘Stormzy’ amongst many others, producing hits such as ‘I Don’t Care’, ‘Beautiful People’, ‘South of The Border’ and ‘Take Me Back To London’. \n \n#EdSheeran #Khalid #BeautifulPeople","thumbnails":{"…