I see various references to 'InnerTube', an unofficial name for YouTube's internal API. Although it's intended only for internal use, it's sometimes possible to get external tools to work with it.
(sidenote: You can find references to this internal API by googling for 'youtubei')
What is InnerTube?
Third-party libraries:
Scripts that leverage the "InnerTube" API:
Background discussions by developers about trying to reverse-engineer the API: