Show Menu

IBM Watson Cheat Sheet (DRAFT) by


This is a draft cheat sheet. It is a work in progress and is not finished yet.


Download Python
Install PIP
curl https:­//b­oot­str­ap.p­yp­a.i­o/g­et-­ -o | python3
Install Packages
pip3 install opencv­-python ibm-watson

Basic setup

from ibm_watson import VisualRecognitionV3
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
#Build connection to the Service
authenticator = IAMAuthenticator('API_KEY')
service = VisualRecognitionV3(

Text to Speech

#Import required packages
from ibm_watson import TextToSpeechV1
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator

#connect to service
authenticator = IAMAuthenticator('{apikey}')
text_to_speech = TextToSpeechV1(


#write the response from the server to the hello_world.wav audio file

#open the audio file
with open('hello_world.wav', 'wb') as audio_file:
    #write something into the file
        #get the response from the service and set the parameters as you like
            'Hello world',

Help Us Go Positive!

We offset our carbon usage with Ecologi. Click the link below to help us!

We offset our carbon footprint via Ecologi