Python for Beginners [37 of 44] Demo: Calling an API

Play Python for Beginners [37 of 44] Demo: Calling an API

The Discussion

  • User profile image
    Aubery14
    Hi dear Susan.
    I got a different ENDPOINT when creating the pythonimageanalyzer, which is: https://m-pythonimageanalyzer.cognitiveservices.azure.com/
    I think it's a wrong URL, but I don't know which step I did wrong. Can you help me?
  • User profile image
    Asaf

    if you getting 404 when you execute the script - make sure you put your created address (aka 'endpoint')
    but than add the '/vision/v2.0' at the end...

    Example Per Susan Script (call_api.py)
    vision_service_address = https://{your_endpoint}/vision/v2.0/

    It should work as a charm if you created your Azure account in the right portal. Good luck!

    Output For my image:
    (venv) PS C:\Python> & c:/Python/venv/Scripts/python.exe c:/Python/26-CallAPI.py
    {"color": {"dominantColorForeground": "White", "dominantColorBackground": "White", "dominantColors": ["White"], "accentColor": "1F7FAC", "isBwImg": false, "isBWImg": false}, "description": {"tags": ["dog", "white", "small", "water", "table", "sitting", "brown", "standing", "riding", "surfing", "board", "man"], "captions": [{"text": "a small white dog riding in the water", "confidence": 0.5942004486902526}]}, "requestId": "1ef9a5c5-81bd-4184-90e3-5fe2be24080a", "metadata": {"width": 900, "height": 900, "format": "Jpeg"}}


Add Your 2 Cents

More episodes in this series

Related episodes