Skip to content

chore(lookup): migrate Open Food Facts to API v3#13

Merged
Azyrn merged 1 commit into
mainfrom
chore/openfoodfacts-api-v3
Jul 13, 2026
Merged

chore(lookup): migrate Open Food Facts to API v3#13
Azyrn merged 1 commit into
mainfrom
chore/openfoodfacts-api-v3

Conversation

@Azyrn

@Azyrn Azyrn commented Jul 13, 2026

Copy link
Copy Markdown
Owner

v2 is deprecated; v3 is the version the docs recommend for new integrations. All three OFF-family projects (Food, Beauty, Pet Food) serve it.

v3 reports the outcome as a string ("success"/"failure") where v2 used an integer 1, and a missing product still comes back as HTTP 200 — so the status: Int DTOs would have thrown a SerializationException on every lookup. Switch the three response DTOs to a string status and gate on it.

Field names and the fields query param are unchanged in v3 (verified live against all three hosts), so the product/nutriments mappings stay as they are.

Also fix the User-Agent to the AppName/Version (contact) format OFF asks for, and share it from one place instead of two hardcoded copies.

v2 is deprecated; v3 is the version the docs recommend for new integrations.
All three OFF-family projects (Food, Beauty, Pet Food) serve it.

v3 reports the outcome as a string ("success"/"failure") where v2 used an
integer 1, and a missing product still comes back as HTTP 200 — so the
`status: Int` DTOs would have thrown a SerializationException on every
lookup. Switch the three response DTOs to a string status and gate on it.

Field names and the `fields` query param are unchanged in v3 (verified live
against all three hosts), so the product/nutriments mappings stay as they are.

Also fix the User-Agent to the AppName/Version (contact) format OFF asks for,
and share it from one place instead of two hardcoded copies.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
scanly Ready Ready Preview, Comment Jul 13, 2026 10:03am

@Azyrn Azyrn merged commit 6a18556 into main Jul 13, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant