Accessing Grouped Questions in Python Using Kobo Toolbox CSV URL

Hello Kobo Toolbox Community,

I hope this message finds you well. I am currently using Python to fetch data from Kobo Toolbox, specifically utilizing the data.csv URL. My goal is to retrieve the data in the same format as it appears in the Kobo form, without any underscores or other modifications.

Here’s a snippet of the code I’m using:
url = “https://kf.kobotoolbox.org/api/v2/assets/aHfTNaJr7N8WorJkcbhv4Z/export-settings/estCqjWTVLBAYUJFfQzxPMX/data.csv
username = “example”
password = “example”

While I successfully managed to fetch the data, I have noticed that the grouped questions are not appearing when I use the data.csv URL. Interestingly, when I use data.json, the grouped questions are visible.

Is there a way to include those grouped questions when using the data.csv URL? Any guidance or suggestions would be greatly appreciated!

Thank you in advance for your help!

Best regards,
Abessolo Ateba Abhas

Hi @Abessolo, If you would like to retrieve the data in the same format as in kobo form, you just need to replace .csv with .xlsx. I believe it is the answer you are looking for

https://kf.kobotoolbox.org/api/v2/assets/aHfTNaJr7N8WorJkcbhv4Z/export-settings/estCqjWTVLBAYUJFfQzxPMX/data.xlsx

1 Like

Hi osman Burcu, thank you for your respond. However, I also tried using data.xlsx, but it also does not provide the grouped questions.

does your grouped questions are inside a roster? because if it is in a roster it in same excel file but in different sheet

1 Like

@Abessolo, as of now the system does not support managing repeat group data for the CSV file. As advised by @osmanburcu, you will only get the repeat group data through the XLS format.