Skip to content

fix: Implement text search with OpenFoodFacts API v2#29

Open
meghana-0211 wants to merge 1 commit into
1MindLabs:mainfrom
meghana-0211:fix/openfoodfacts-api-search
Open

fix: Implement text search with OpenFoodFacts API v2#29
meghana-0211 wants to merge 1 commit into
1MindLabs:mainfrom
meghana-0211:fix/openfoodfacts-api-search

Conversation

@meghana-0211

@meghana-0211 meghana-0211 commented Feb 28, 2025

Copy link
Copy Markdown

Description

This PR fixes issue #21 by implementing the text search functionality with OpenFoodFacts API v2.

Changes

  • Uncommented and updated the text search route in search.py
  • Changed API method from text_search() to search() to match v2 API
  • Added consistent processing of search results similar to the barcode route
  • Updated error handling and database operations

Testing

Tested the API endpoint with various product names to ensure proper functioning.

Related Issue

Fixes #21

Type of Change

  • 🐛 Bug fix

Checklist

  • Pre-commit hooks have been run successfully
  • Tests pass locally

@areebahmeddd

Copy link
Copy Markdown
Member

Hi @meghana-0211,

Thanks for the contribution! You're amazing!

Currently, during the GSoC session, I'm participating with Open Food Facts, so it will take me some time to test your changes. However, do check out the API I'm using in this codebase. Seeing your interest, I also suggest you explore it!

Link: https://github.com/openfoodfacts

@meghana-0211

meghana-0211 commented Mar 3, 2025 via email

Copy link
Copy Markdown
Author

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.

Upgrade OpenFoodFacts API

2 participants