openfoodfacts-python icon indicating copy to clipboard operation
openfoodfacts-python copied to clipboard

how to get categories by page

Open jerome-diver opened this issue 5 years ago • 5 comments

i can get how to have categories by page with page_size. running facets.get_categories() is very long, i would like to load page by page my view from a thread... thank you

jerome-diver avatar May 07 '19 13:05 jerome-diver

Hey @jerome-diver Can you please elaborate and provide some examples, if possible?

Anubhav-Bhargava avatar May 12 '19 12:05 Anubhav-Bhargava

@Anubhav-Bhargava i can imagine what could be a request, but i can not give an example about something i don't know how it is working. I would like to get categories facets by page for a given page_size, and for selected country and/or selected langage (and sorted_by category name): french_categories_page2 = openfoodfacts.factes.get_categories(country="France", page=2, page_size=25, sorted_by='name')

jerome-diver avatar May 12 '19 13:05 jerome-diver

@Anubhav-Bhargava, i answered but you didn't tell me how to get products by categories for a defined country with the total products count number. Could you help me with that please ?

jerome-diver avatar May 19 '19 12:05 jerome-diver

@jerome-diver Currently there is no such functionality available. I've raised a request with the team to look into it. Will update you if there's any progress.

Anubhav-Bhargava avatar May 19 '19 15:05 Anubhav-Bhargava

New doc: https://openfoodfacts.github.io/api-documentation/

teolemon avatar Apr 10 '22 10:04 teolemon