openfoodfacts / openfoodfacts-python

🐍 Python package for Open Food Facts
https://openfoodfacts.github.io/openfoodfacts-python/
Other
324 stars 67 forks source link

how to get categories by page #56

Open jerome-diver opened 5 years ago

jerome-diver commented 5 years ago

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

Anubhav-Bhargava commented 5 years ago

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

jerome-diver commented 5 years ago

@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 commented 5 years ago

@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 ?

Anubhav-Bhargava commented 5 years ago

@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.

teolemon commented 2 years ago

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