Search code examples
pythonpython-3.xyoutube-apiyoutube-data-api

Python YouTube API Skip Entering Authentication Key


I'm trying to automate the code that changes thumbnails with the YouTube api. I have to enter the authentication key every time I do it, so is there a way to omit this part?

terminal when running


Solution

  • You can use python-youtube:

    The documentation clearly listed how to initialize it with access token or api-key:

    >>> from pyyoutube import Api
    >>> api = Api(api_key="your api key")
    

    Or with access token:

    >>> from pyyoutube import Api
    >>> api = Api(access_token='your api key')
    

    More can be found here