Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

mikirey's avatar
mikirey
New member | Level 2
7 months ago
Solved

Limit in Request for files/list_folder

Hi Dropbox Developers,

Based on the documentation for list_folder and list_folder_continue, I know Dropbox doesn't exactly return the exact number set by limit. I've noticed that difference is sometimes very significant, e.g. I asked for a 100 set by the limit, but only receive about 9 items for my request - is this normal?

limit UInt32 (min=1, max=2000)? The maximum number of results to return per request. Note: This is an approximate number and there can be slightly more entries returned in some cases. This field is optional.

Thanks,

  • That's correct, the 'limit' parameter on the /2/files/list_folder endpoint is a way to request an approximate upper bound on how many entries to return. The /2/files/list_folder endpoint, whether or not used with the 'limit' parameter, does not offer a minimum number of entries per page, however.

    Due to some specifics of how the Dropbox backend is implemented, that means that in some cases, you will see smaller page sizes like this. Unfortunately this isn't something you can control, as it depends on a variety of factors, such as the activity in the account itself.

    In any case, whenever you're using the /2/files/list_folder[/continue] endpoints, with 'limit' or not, you need to make sure you're always checking the "has_more" result value, and call back to /2/files/list_folder/continue if it's true. The page size isn't guaranteed, so apps must always do so in order to make sure they get the full and accurate listing.

1 Reply

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    7 months ago

    That's correct, the 'limit' parameter on the /2/files/list_folder endpoint is a way to request an approximate upper bound on how many entries to return. The /2/files/list_folder endpoint, whether or not used with the 'limit' parameter, does not offer a minimum number of entries per page, however.

    Due to some specifics of how the Dropbox backend is implemented, that means that in some cases, you will see smaller page sizes like this. Unfortunately this isn't something you can control, as it depends on a variety of factors, such as the activity in the account itself.

    In any case, whenever you're using the /2/files/list_folder[/continue] endpoints, with 'limit' or not, you need to make sure you're always checking the "has_more" result value, and call back to /2/files/list_folder/continue if it's true. The page size isn't guaranteed, so apps must always do so in order to make sure they get the full and accurate listing.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!