{"uid":"cap_cGyx03-bYTSnkWzIgCGx7","slug":"audio-withzero-xyz-youtube-music-video-analyzer-lyria-ready-057de1a8","name":"YouTube Music Video Analyzer (Lyria-Ready)","description":"Analyze a public YouTube or direct-audio music reference, optionally combine Gemini semantics with local BPM/key/downbeat/loudness DSP, and return bar-aware sections plus a ready-to-generate original Lyria request.","url":"https://audio.withzero.xyz/api/v1/music-analyses?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","example":{"focus":"prioritize the drum pattern, bass movement, and energy changes","endSec":240,"startSec":0,"youtubeUrl":"https://www.youtube.com/watch?v=example","barAlignment":"4-bars","instrumental":true,"tailReserveSec":5,"targetDurationSec":180,"sectionTargetCount":8,"instrumentalLeadMode":"piano-led"},"required":["startSec","endSec","instrumental","analysisDepth","barAlignment","instrumentalLeadMode","instrumentalLeadContinuity","tailReserveSec"],"properties":{"seed":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"description":"Optional best-effort Lyria seed copied into the compiled request."},"audio":{"type":"string","maxLength":21000000,"minLength":1,"description":"Base64 MP3 or WAV for hybrid semantic + DSP analysis (15 MiB decoded maximum)."},"focus":{"type":"string","maxLength":500,"minLength":1,"description":"Optional analysis emphasis, for example \"prioritize the drums, bass groove, and chorus lift\"."},"endSec":{"type":"integer","default":300,"maximum":21600,"minimum":30,"description":"End of the analyzed video window in whole seconds. Defaults to 300."},"audioUrl":{"type":"string","format":"uri","maxLength":2048,"description":"Public HTTPS MP3/WAV/M4A/OGG/FLAC URL for hybrid semantic + DSP analysis."},"startSec":{"type":"integer","default":0,"maximum":21600,"minimum":0,"description":"Start of the analyzed video window in whole seconds. Defaults to 0."},"mastering":{"type":"object","required":["targetLufs","truePeakDb","fadeOutSec"],"properties":{"fadeOutSec":{"type":"number","default":1,"maximum":10,"minimum":0,"description":"Final fade duration in seconds."},"targetLufs":{"type":"number","default":-14,"maximum":-8,"minimum":-24,"description":"Target integrated loudness in LUFS."},"truePeakDb":{"type":"number","default":-1,"maximum":-0.1,"minimum":-6,"description":"Maximum true peak in dBTP."}},"description":"Optional mastering controls copied into the ready-to-generate Lyria request.","additionalProperties":false},"youtubeUrl":{"type":"string","format":"uri","maxLength":2048,"description":"Public YouTube video URL to analyze. Private and unlisted videos are not supported."},"audioFormat":{"enum":["mp3","wav"],"type":"string","description":"Required when audio is supplied as base64."},"barAlignment":{"enum":["none","bar","4-bars","8-bars"],"type":"string","default":"none","description":"Optionally snap compiled section boundaries to the detected musical grid. Omit to preserve the semantic timestamps."},"instrumental":{"type":"boolean","default":true,"description":"Compile an instrumental Lyria request by default; set false to permit original vocals."},"analysisDepth":{"enum":["standard","deep"],"type":"string","default":"standard","description":"Deep mode requests finer bar-level arrangement, envelope, and transition evidence."},"tailReserveSec":{"type":"integer","default":0,"maximum":15,"minimum":0,"description":"Optionally reserve a non-essential final tail because Lyria can end several seconds early."},"matchPriorities":{"type":"object","properties":{"groove":{"type":"integer","maximum":5,"minimum":1},"harmony":{"type":"integer","maximum":5,"minimum":1},"structure":{"type":"integer","maximum":5,"minimum":1},"production":{"type":"integer","maximum":5,"minimum":1},"instrumentation":{"type":"integer","maximum":5,"minimum":1}},"description":"Optional 1–5 importance weights. Higher-weight traits receive stronger analysis, prompting, and candidate-ranking emphasis.","additionalProperties":false},"targetDurationSec":{"type":"integer","maximum":300,"minimum":30,"description":"Optional duration for the compiled Lyria song; otherwise the detected music duration is used, clamped to 30–300 seconds."},"sectionTargetCount":{"type":"integer","maximum":12,"minimum":2,"description":"Requested number of functional sections before the safety tail is appended."},"instrumentalLeadMode":{"enum":["auto","piano-led","synth-led","custom"],"type":"string","default":"auto","description":"How analyzed vocal functions should become instrumental parts. Piano-led makes the main vocal role an expressive piano melody."},"instrumentalLeadMapping":{"type":"array","items":{"type":"object","required":["role","instrument"],"properties":{"role":{"enum":["lead","harmony","response","ad-lib","sustained","ensemble"],"type":"string","description":"The source vocal function being reassigned."},"register":{"enum":["low","mid","high","wide"],"type":"string"},"instrument":{"type":"string","maxLength":80,"minLength":1,"description":"Instrument that should perform this role, for example expressive piano or bright pluck synth."},"articulation":{"type":"string","maxLength":160,"minLength":1,"description":"Phrasing and envelope, for example clipped staccato attacks with short releases."}},"additionalProperties":false},"maxItems":8,"minItems":1,"description":"Custom vocal-function mappings. These override the selected instrumentalLeadMode role by role."},"instrumentalLeadContinuity":{"enum":["sectional","persistent"],"type":"string","default":"persistent","description":"Persistent keeps the mapped lead instrument in front after every section transition in the compiled Lyria request."}},"additionalProperties":false},"responseSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["source","analysis","lyriaRequest","limitations","model","price_usdc"],"properties":{"model":{"type":"string"},"source":{"type":"object","required":["startSec","endSec","analysisMethod"],"properties":{"endSec":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991},"audioUrl":{"type":"string","format":"uri"},"startSec":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991},"youtubeUrl":{"type":"string","format":"uri"},"audioUpload":{"type":"boolean"},"analysisMethod":{"enum":["gemini-video-semantic","gemini-audio-plus-dsp"],"type":"string"}},"additionalProperties":false},"analysis":{"type":"object","required":["durationSec","clipMusicStartSec","clipMusicEndSec","tempo","key","timeSignature","genres","moods","drums","bass","harmony","lead","instrumentation","production","energyArc","signatureTraits","sections","overallConfidence","warnings"],"properties":{"key":{"type":"object","required":["tonic","mode","confidence"],"properties":{"mode":{"type":"string","maxLength":32,"minLength":1,"description":"Estimated mode such as major, minor, dorian, or mixolydian."},"tonic":{"type":"string","maxLength":8,"minLength":1,"description":"Estimated tonic, using a note name such as C, F#, or Bb."},"confidence":{"type":"number","maximum":1,"minimum":0}},"additionalProperties":false},"bass":{"type":"string","maxLength":600,"minLength":1,"description":"Bass timbre, register, articulation, rhythm, and interaction with the kick."},"lead":{"type":"string","maxLength":600,"minLength":1,"description":"Lead timbres, melodic contour, phrasing density, and call-and-response without quoting the melody."},"drums":{"type":"string","maxLength":600,"minLength":1,"description":"Kit, pattern, subdivisions, fills, accents, and processing."},"moods":{"type":"array","items":{"type":"string","maxLength":80,"minLength":1},"maxItems":8,"minItems":1},"tempo":{"type":"object","required":["bpm","confidence","alternativesBpm","feel"],"properties":{"bpm":{"type":"integer","maximum":240,"minimum":40,"description":"Most likely musical pulse in beats per minute."},"feel":{"type":"string","maxLength":240,"minLength":1,"description":"Rhythmic feel, swing, syncopation, and subdivision."},"confidence":{"type":"number","maximum":1,"minimum":0},"alternativesBpm":{"type":"array","items":{"type":"integer","maximum":240,"minimum":40},"maxItems":2,"description":"Plausible half-time or double-time interpretations, if any."}},"additionalProperties":false},"genres":{"type":"array","items":{"type":"string","maxLength":80,"minLength":1},"maxItems":6,"minItems":1},"harmony":{"type":"string","maxLength":600,"minLength":1,"description":"Chord language, harmonic rhythm, voicing density, and tonal movement without transcribing the source."},"sections":{"type":"array","items":{"type":"object","required":["startSec","endSec","name","description","intensity"],"properties":{"bars":{"type":"integer","maximum":9007199254740991,"description":"Approximate section length in bars, when available.","exclusiveMinimum":0},"name":{"type":"string","maxLength":64,"minLength":1,"description":"Functional section name such as Intro, Verse, Build, Chorus, Drop, Breakdown, Bridge, or Outro."},"endSec":{"type":"integer","maximum":600,"minimum":1,"description":"Section end relative to the beginning of the primary music, in whole seconds."},"startBar":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"description":"Approximate starting bar on the analyzed musical grid, when available."},"startSec":{"type":"integer","maximum":600,"minimum":0,"description":"Section start relative to the beginning of the primary music, in whole seconds."},"intensity":{"type":"integer","maximum":10,"minimum":1,"description":"Perceived intensity from 1 (minimal) to 10 (maximum)."},"description":{"type":"string","maxLength":500,"minLength":1,"description":"Section-specific rhythm, harmony, instrumentation, transition, and production traits."}},"additionalProperties":false},"maxItems":20,"minItems":1},"warnings":{"type":"array","items":{"type":"string","maxLength":240,"minLength":1},"maxItems":8},"energyArc":{"type":"string","maxLength":600,"minLength":1,"description":"How density and intensity change through the arrangement."},"production":{"type":"string","maxLength":800,"minLength":1,"description":"Mix, space, stereo field, dynamics, texture, transitions, and mastering character."},"vocalRoles":{"type":"array","items":{"type":"object","required":["role","description"],"properties":{"role":{"enum":["lead","harmony","response","ad-lib","sustained","ensemble"],"type":"string"},"description":{"type":"string","maxLength":240,"minLength":1,"description":"Register, phrasing density, articulation, envelope, and interaction of this vocal function."}},"additionalProperties":false},"maxItems":8,"description":"Functional vocal parts that can be reassigned to instruments without copying the source melody."},"durationSec":{"type":"integer","maximum":600,"minimum":1,"description":"Duration of the primary continuous musical performance inside the selected clip."},"timeSignature":{"type":"string","maxLength":16,"minLength":1},"clipMusicEndSec":{"type":"integer","maximum":600,"minimum":1,"description":"Where the primary music ends, relative to the selected clip."},"instrumentation":{"type":"array","items":{"type":"string","maxLength":120,"minLength":1},"maxItems":16,"minItems":1},"signatureTraits":{"type":"array","items":{"type":"string","maxLength":240,"minLength":1},"maxItems":10,"minItems":1,"description":"High-value abstract traits that explain the track identity without naming or copying protected expression."},"vocalPerformance":{"type":"object","required":["summary","phraseProfiles"],"properties":{"summary":{"type":"string","maxLength":320,"minLength":1,"description":"Phrase timing, breathing space, density, contour language, and handoffs without notes, intervals, lyrics, or melody transcription."},"phraseProfiles":{"type":"array","items":{"type":"object","required":["sectionName","role","phraseBars","pickup","restBeats","density","contour","cadence","delivery","handoff"],"properties":{"role":{"enum":["lead","harmony","response","ad-lib","sustained","ensemble"],"type":"string"},"pickup":{"enum":["none","eighth-note","sixteenth-note","mixed"],"type":"string","description":"Typical pickup behavior before phrase entrances."},"cadence":{"enum":["open","short-stop","falling-resolution","rising-lift","sustained-resolution"],"type":"string"},"contour":{"type":"array","items":{"enum":["level","rising","falling","arch","inverted-arch","repeated-note","leap-and-answer","sustained"],"type":"string"},"maxItems":4,"minItems":1,"description":"Ordered high-level contour gestures without pitches, intervals, or a melody transcription."},"density":{"enum":["sparse","moderate","dense","rapid"],"type":"string","description":"Relative event density of the vocal delivery."},"handoff":{"type":"string","maxLength":160,"minLength":1,"description":"How this phrase yields to or answers another part."},"delivery":{"type":"string","maxLength":160,"minLength":1,"description":"Articulation, attack, sustain, and dynamic behavior."},"restBeats":{"type":"integer","maximum":8,"minimum":0,"description":"Typical breathing space after a phrase, in beats."},"phraseBars":{"type":"integer","maximum":8,"minimum":1,"description":"Typical phrase length in bars, without transcribing notes or lyrics."},"sectionName":{"type":"string","maxLength":64,"minLength":1,"description":"Name of the arrangement section this performance profile belongs to."}},"additionalProperties":false},"maxItems":16,"minItems":1}},"description":"A non-note-level performance map used to make an instrument occupy the functional role of the source vocals.","additionalProperties":false},"clipMusicStartSec":{"type":"integer","maximum":600,"minimum":0,"description":"Where the primary music begins, relative to the selected clip."},"overallConfidence":{"type":"number","maximum":1,"minimum":0}},"additionalProperties":false},"price_usdc":{"type":"string"},"dspEvidence":{"type":"object","required":["durationSec","tempo","brightness","energy","sections","cues"],"properties":{"key":{"type":"object","required":["tonic","mode","camelot","confidence"],"properties":{"mode":{"enum":["major","minor"],"type":"string"},"tonic":{"type":"string"},"camelot":{"type":"string"},"confidence":{"type":"number","maximum":1,"minimum":0}},"additionalProperties":false},"cues":{"type":"object","required":["mixInSec","mixOutSec"],"properties":{"mixInSec":{"type":"number","minimum":0},"mixOutSec":{"type":"number","minimum":0}},"additionalProperties":false},"tempo":{"type":"object","required":["bpm","beatOffsetSec","beatIntervalSec","downbeatOffsetBeats","downbeatConfidence"],"properties":{"bpm":{"type":"number","exclusiveMinimum":0},"beatOffsetSec":{"type":"number","minimum":0},"beatIntervalSec":{"type":"number","exclusiveMinimum":0},"downbeatConfidence":{"type":"number","maximum":1,"minimum":0},"downbeatOffsetBeats":{"type":"integer","maximum":3,"minimum":0}},"additionalProperties":false},"energy":{"type":"array","items":{"type":"number","maximum":1,"minimum":0}},"stereo":{"type":"object","required":["correlation","sideToMidRatio"],"properties":{"correlation":{"type":"number","maximum":1,"minimum":-1},"sideToMidRatio":{"type":"number","minimum":0}},"additionalProperties":false},"loudness":{"type":"object","required":["integratedLufs","rangeLu","truePeakDb"],"properties":{"rangeLu":{"type":"number"},"truePeakDb":{"type":"number"},"integratedLufs":{"type":"number"}},"additionalProperties":false},"sections":{"type":"array","items":{"type":"object","required":["kind","startSec","endSec"],"properties":{"kind":{"type":"string"},"endSec":{"type":"number","exclusiveMinimum":0},"startSec":{"type":"number","minimum":0}},"additionalProperties":false}},"brightness":{"type":"array","items":{"type":"number","maximum":1,"minimum":0}},"durationSec":{"type":"number","exclusiveMinimum":0}},"additionalProperties":false},"limitations":{"type":"array","items":{"type":"string"}},"lyriaRequest":{"type":"object","required":["prompt","negativePrompt","durationSec","instrumental","temperature","topP","sections"],"properties":{"seed":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991},"topP":{"type":"number","maximum":1,"minimum":0},"prompt":{"type":"string","maxLength":4000,"minLength":1},"sections":{"type":"array","items":{"type":"object","required":["startSec","endSec","name","description","intensity"],"properties":{"name":{"type":"string"},"endSec":{"type":"integer","maximum":300,"minimum":1},"startSec":{"type":"integer","maximum":300,"minimum":0},"intensity":{"type":"integer","maximum":10,"minimum":1},"description":{"type":"string"}},"additionalProperties":false},"maxItems":20,"minItems":1},"mastering":{"type":"object","required":["targetLufs","truePeakDb","fadeOutSec"],"properties":{"fadeOutSec":{"type":"number","default":1,"maximum":10,"minimum":0,"description":"Final fade duration in seconds."},"targetLufs":{"type":"number","default":-14,"maximum":-8,"minimum":-24,"description":"Target integrated loudness in LUFS."},"truePeakDb":{"type":"number","default":-1,"maximum":-0.1,"minimum":-6,"description":"Maximum true peak in dBTP."}},"additionalProperties":false},"durationSec":{"type":"integer","maximum":300,"minimum":30},"temperature":{"type":"number","maximum":2,"minimum":0},"instrumental":{"type":"boolean"},"negativePrompt":{"type":"string","maxLength":1000,"minLength":1},"tailReserveSec":{"type":"integer","maximum":15,"minimum":0},"selectionTarget":{"type":"object","required":["bpm"],"properties":{"bpm":{"type":"number","maximum":240,"minimum":40},"matchPriorities":{"type":"object","properties":{"groove":{"type":"integer","maximum":5,"minimum":1},"harmony":{"type":"integer","maximum":5,"minimum":1},"structure":{"type":"integer","maximum":5,"minimum":1},"production":{"type":"integer","maximum":5,"minimum":1},"instrumentation":{"type":"integer","maximum":5,"minimum":1}},"description":"Optional 1–5 importance weights. Higher-weight traits receive stronger analysis, prompting, and candidate-ranking emphasis.","additionalProperties":false}},"additionalProperties":false},"instrumentalLeadMapping":{"type":"array","items":{"type":"object","required":["role","instrument"],"properties":{"role":{"enum":["lead","harmony","response","ad-lib","sustained","ensemble"],"type":"string","description":"The source vocal function being reassigned."},"register":{"enum":["low","mid","high","wide"],"type":"string"},"instrument":{"type":"string","maxLength":80,"minLength":1,"description":"Instrument that should perform this role, for example expressive piano or bright pluck synth."},"articulation":{"type":"string","maxLength":160,"minLength":1,"description":"Phrasing and envelope, for example clipped staccato attacks with short releases."}},"additionalProperties":false},"maxItems":8},"instrumentalLeadContinuity":{"enum":["sectional","persistent"],"type":"string"}},"description":"Ready to POST to /api/v1/songs/lyria-3-pro.","additionalProperties":false}},"additionalProperties":false},"example":null,"exampleRequest":null,"tags":[],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","requiresHandshake":false,"reviewCount":2,"rating":{"score":"0.92","successRate":"0.58","reviews":2,"stars":"4.7","state":"rated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_yMz_gDD-7IEUjb3kjRMuA","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":"audio.withzero.xyz","brandSlug":"audio-withzero-xyz-mpp","brandBaseUrl":"https://audio.withzero.xyz","brandDocsUrl":null,"whatItDoes":"Analyzes a bounded window of a public YouTube music video to extract tempo, key, groove, instrumentation, production details, timestamped sections, and outputs a ready-to-use Google Lyria music generation request.","exampleAgentPrompt":"Analyze the first 3 minutes of this YouTube track https://www.youtube.com/watch?v=dQw4w9WgXcQ — I want the tempo, key, drum and bass groove breakdown, and a compiled instrumental Lyria request I can use to generate something similar.","exampleUseCases":[{"title":"Reference track breakdown for music production","prompt":"Can you analyze the section from 0 to 240 seconds of https://www.youtube.com/watch?v=example and give me a full breakdown of the drums, bass, key, and production style? I want an instrumental Lyria request at the end so I can generate something in that vibe."},{"title":"Genre and mood fingerprinting for playlist curation","prompt":"Look at this YouTube video from second 30 to second 180: https://www.youtube.com/watch?v=example — what are the genres and moods, what's the energy arc like, and what instrumentation is being used throughout?"},{"title":"Timestamped section map for remixing","prompt":"Analyze the full first 5 minutes of https://www.youtube.com/watch?v=example and give me timestamped sections with descriptions of how the energy and arrangement change — I'm trying to understand the song structure for a remix. Focus on the drum pattern and chord movement."}],"resultDescription":"Returns a structured JSON object containing: source metadata (URL, window, analysis method), full music analysis (BPM with confidence and feel, key/mode with confidence, time signature, genres, moods, drum/bass/lead/harmony descriptions, instrumentation list, production characteristics, energy arc, signature traits, timestamped section breakdown, overall confidence score, and warnings), plus a compiled ready-to-use Google Lyria generation request that mirrors the analyzed track's musical character, and pricing metadata.","failureModes":["Private or unlisted YouTube videos return an error — only public videos are supported","Video window shorter than 30 seconds is rejected","endSec must be at least 30 seconds greater than startSec","Target duration outside 30–300 second range is rejected","Videos with no detectable music (e.g. speech-only) may return low confidence scores and sparse analysis","YouTube URL parsing failures if URL is malformed","Network or Gemini model errors may cause transient failures","Analysis confidence may be low for heavily mixed, live, or distorted recordings"],"whenToPreferThis":"Choose this endpoint when you need a deep, structured musical analysis of a specific reference track on YouTube — especially when your goal is to generate an original Lyria song inspired by that track. It is superior to generic audio analysis when you want timestamped section breakdowns, drum/bass/lead decompositions, and a production-ready Lyria prompt all in one call. Prefer this over manual music analysis when you need structured JSON output usable for downstream AI music generation pipelines.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":12,"lastUsedAt":"2026-08-05T21:04:49.827Z","lastSuccessfullyRanAt":"2026-08-05T21:04:49.827Z","lastHealthCheckAt":"2026-10-12T18:53:58.090Z","isFirstParty":true,"canonicalSlug":"audio-withzero-xyz-youtube-music-video-analyzer-lyria-ready-057de1a8"}