Skip to main content
Question

Python BoX API to get all items in folder Or how to search folder by FolderName?

  • May 22, 2025
  • 3 replies
  • 67 views

Forum|alt.badge.img

I am using 

client.folder(folder_id=fldID).get_items(limit=5000)

 to retrieve all folders/files inside parent folder and look for foldername and create it if does not exist. But as per box api reference, get_items() methods returns only 1000 items. 

1. offset=2, limit=1000 : though i set offset =2 , it does not return 2nd page data. 

2. folder object does not return file/folder length/count and other information. 

 

Please let me know how can i search a folder and create if does not exist. currently i am creating it and if exists its throwing exception , capturing the {FolderID} from it(which is a wrong way but work around for me now). 

 

Any help would be appreciated. 

3 replies

Forum|alt.badge.img

I am assuming your intent on search  is to locate a folder and deposit a file there. You could use a program called ccScan to do the same search and if it does not find it automatically create it. It can automatically look up multiple folder and deposit the file and/or create multiple folder for multiple files.Just google ccScan and you see more information. 


Forum|alt.badge.img

Thank you. I need to do it in Python Programming language. 


Forum|alt.badge.img

 I think you might be using the `offset` parameter the wrong way; it's not the page number, by the index to start returning results from.  So, the first page has (limit=1000, offset=0) to return the first 1000 items, i.e. the items at index 0-999.  The second page should have (limit=1000, offset=1000) to return the items at index 1000-1999.