Hello @Ana
Welcome to Dhan Community! Excited to know you are exploring Dhan APIs.
This may happen if you are running the code in Jupyter notebook. You can use this example code instead, which should help you out: Marketfeed api - sample python code error - #10 by Hardik