Skip to main content
Question

Unable to fetch the box search results.

  • May 26, 2026
  • 1 reply
  • 204 views

We are using the BOX API with a service ID to connect and fetch files from BOX.

The connection is working successfully, and able to fetch filenames and metadata with IDs. But  although the API connection is still successful, no files are being fetched from the search query even though the data is available in BOX.

Could you please help us diagnose the issue and let us know if there are any API limitations, token/session expiry issues, rate limits, scheduled maintenance activities, or permission-related concerns that could be causing this behaviour?

long offsetValue = 0;
long limitValue = 2000000;
BoxSearch boxSearch = new BoxSearch(api);
BoxSearchParameters searchParams = new BoxSearchParameters();
searchParams.setQuery("*");
List<String> folderIds = new ArrayList<>();
folderIds.add(folderId);
searchParams.setAncestorFolderIds(folderIds);
do {
searchResults = boxSearch.searchRange(offsetValue, limitValue, searchParams);
  for (BoxItem.Info itemInfo : searchResults) {
     System.out.println(itemInfo.getName()
   }
} while (searchResults.size() % 200 == 0 && searchResults.size() != 0);

1 reply

  • Box Employee
  • June 1, 2026

@Meghana Gandham - It looks, from the use if the ‘*’, that you are trying to get a list of objects available.  Kind of like “SELECT * FROM FOO” works in a SQL statement.  That’s not the way the search API works.  You need to provide something meaningful for the query param.  Also - the search API performance will start degrading significantly after about 50K results.

Use the List items in folder API recursively if you really want to get a list of everything.