I am pulling a list of my contacts via the API with Python. The JSON file that is being put by Hubspot is incorrectly formatted. When I run it through Pandas in Python to convert it to a CSV, I keep getting a ValueError. Below is a sample of what I get from the API.
As it turns out, if I incase the last section of the JSON file in {} and move the ] to the second line from the end, the file reads properly. See the code below for a sample that works properly after two, slight modifications.
Is there a way to correct the JSON code that is coming from the API? Or perhaps I am not pulling the code properly (I am using a simple GET from Python). See the code below.