Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to find new packager codes with API #4405

Open
Tracked by #5523
A1CY0N opened this issue Oct 23, 2020 · 4 comments
Open
Tracked by #5523

Unable to find new packager codes with API #4405

A1CY0N opened this issue Oct 23, 2020 · 4 comments
Labels
API READ All READ APIs include Product, Search… API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) 📍🏭 Packager codes https://blog.openfoodfacts.org/en/news/discover-what-food-products-are-made-near-you-with-made-near- ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it.

Comments

@A1CY0N
Copy link

A1CY0N commented Oct 23, 2020

What

Reproduction steps

Steps to reproduce the behavior:

  1. Go to https://world.openfoodfacts.org/product/6842420174016/chocolat
  2. The packaging code is EMB 07113Y
  3. Go to https://world.openfoodfacts.org/packager-codes or http://world.openfoodfacts.org/packager-codes.json
  4. EMB 07113Y packaging code doesn't exist

Number of products impacted

I have noticed this on several recently added products

Part of

@A1CY0N A1CY0N added the 🐛 bug This is a bug, not a feature request. label Oct 23, 2020
@svensven
Copy link
Contributor

svensven commented Oct 24, 2020

on the web site, it's probably not in the first 10000 results, and just on another page.
it shows up for https://world.openfoodfacts.org/packager-codes?filter=7113 (or even https://world.openfoodfacts.org/packager-codes?filter=emb ).
can't speak for the api/python library though.

@A1CY0N
Copy link
Author

A1CY0N commented Oct 24, 2020

Indeed, it seems that the python library should only get the first 10000 results. The filter option is very interesting but I don't think it's implemented in the library.

Unfortunately, the filter option is not available on the api : https://world.openfoodfacts.org/packager-codes.json?filter=emb

@svensven
Copy link
Contributor

I had look through the server code, and it looks like adding a json=anything parameter is an alternative to the .json extension.

# API calls may request JSON, JSONP or XML by appending .json, .jsonp or .xml at the end of the query string
# .jqm returns results in HTML specifically formatted for the OFF mobile app (which uses jquerymobile)
# for calls to /cgi/ actions (e.g. search.pl), the format can also be indicated with a parameter &json=1 &jsonp=1 &xml=1 &jqm=1
# (or ?json=1 if it's the first parameter)

And https://world.openfoodfacts.org/packager-codes?filter=emb&json=1 does indeed seem to do the trick.

@github-actions github-actions bot added the ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. label Jan 23, 2021
@teolemon teolemon added API READ All READ APIs include Product, Search… 📍🏭 Packager codes https://blog.openfoodfacts.org/en/news/discover-what-food-products-are-made-near-you-with-made-near- and removed ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. labels Jul 19, 2021
@teolemon teolemon added the API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) label Aug 21, 2021
Copy link
Contributor

This issue has been open 90 days with no activity. Can you give it a little love by linking it to a parent issue, adding relevant labels and projets, creating a mockup if applicable, adding code pointers from https://github.com/openfoodfacts/openfoodfacts-server/blob/main/.github/labeler.yml, giving it a priority, editing the original issue to have a more comprehensive description… Thank you very much for your contribution to 🍊 Open Food Facts

@github-actions github-actions bot added the ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. label Feb 11, 2024
@teolemon teolemon removed the 🐛 bug This is a bug, not a feature request. label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API READ All READ APIs include Product, Search… API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) 📍🏭 Packager codes https://blog.openfoodfacts.org/en/news/discover-what-food-products-are-made-near-you-with-made-near- ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it.
Projects
Status: To discuss and validate
Development

No branches or pull requests

3 participants