You must have double quotes for JSON, its JSON format. IF python is making a dictionary with single quotes you will have to do the replace "'" with '"' (replace single with double)