Youtube API allows you to search & list videos and obtain the mediaplayer URL, so that you can play videos within your web page
Youtube Data API
Youtube Java Data API - Search and List Videos
Youtube Java Data API - Getting Started
It does not allow you to download the byte content of videos - because Google is protecting their own rights and the rights of the content creators.
Google API Terms of Service
Prohibitions:
Your API Client will not, and You will not encourage or create
functionality for Your users or other third parties to:
...
- promote separately the audio or video components of any YouTube audiovisual content made available through the YouTube API;
- access any portion of any YouTube audiovisual content by any means other than use of a YouTube player or other video player expressly
authorized by YouTube;
- store copies of YouTube audiovisual content;
...