Parse Data from API

I need to first extract all the data using Python from a specific board and parse it so that each item from the board is on a different line.

Here is my code->
import requests
import json

apiKey = “my api key”
apiUrl = “
headers = {“Authorization” : apiKey}

query2 = ‘{boards (ids: 2257165976) { name id description items { name column_values{title id type text } } } }’
data = {‘query’ : query2}

r =, json=data, headers=headers) # make request

Now, I do get all the items in the output but I’m not sure how to put each of them in different lines. Could someone please modify my code so that I get the desired output please?

Hello @rajniali and welcome to the community!

I hope you like it here :muscle:

I do not have experience with Python, but you might be able to find some useful information by searching for the posts related to Python in the community.

Hope you find what you are looking for :slightly_smiling_face:



I think the Python json functionality is broken, what is returned fails json formatting tests. It’s also mentioned in another post on here with the same error I see.

Best Regards,

Quite late to this thread, but I’ve found that running python vars through json.dumps usually fixes the main formatting issues

1 Like