API "new-files:{site},{category}.json" Response Limitations

I am currently trying to utilize the “get /new-files:{site},{category}.json” API call to retrieve the number of new files for each of the categories from the “get /categories:{site}.json” API call. The trouble I am having though, is that it appears that the API call only returns a maximum of 30 new files for any category which happens to have new items. And this applies only to the parent category in the tree, and none of the children categories underneath it.

Has anyone worked with this particular API call before, or know how to get the new items from the child categories, or bypass the 30 item limit? I am using PHP cURL and the Bearer Token method if that helps provide any meaningful additional. information.

Sample output can be seen here (page takes a little bit to load): http://themeabase.com/wp-content/plugins/envref/inc/test_categories.php

You can try calling GET /search/item instead, with the following parameters set.

  • site = themeforest.net
  • category = wordpress or wordpress/corporate
  • sort_by = date
  • sort_direction = desc
  • page_size = 100 (max)
  • page = 1

This will do the same thing as /new-files but you can query multiple pages.

Cheers!

Thanks Allen, that is a great suggestion!

After looking through the documentation I think I should be able to make that API call work, especially since it has the “date” field with pre-defined options such as “this-day” to help narrow down to daily results like I was hoping for. I will just have to match the “classification” field to the appropriate “category” field, but that shouldn’t be too bad.

1 Like