{"id":19670101,"url":"https://github.com/openfoodfacts/openbeautyfacts-ruby","last_synced_at":"2025-10-09T10:35:09.610Z","repository":{"id":43415556,"uuid":"55851877","full_name":"openfoodfacts/openbeautyfacts-ruby","owner":"openfoodfacts","description":"Open Beauty Facts API Wrapper 💎💄","archived":false,"fork":false,"pushed_at":"2025-10-07T21:05:10.000Z","size":1356,"stargazers_count":10,"open_issues_count":2,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-08T01:25:33.757Z","etag":null,"topics":["api-wrapper","cosmetic","hacktoberfest","openbeautyfacts","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openfoodfacts.png","metadata":{"funding":{"patreon":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"open_collective":"openfoodfacts-server","github":"openfoodfacts","custom":"https://donate.openfoodfacts.org"},"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-04-09T15:29:38.000Z","updated_at":"2025-10-01T21:24:10.000Z","dependencies_parsed_at":"2023-12-08T10:34:37.466Z","dependency_job_id":"f0808079-f168-4876-96e0-351c956f35df","html_url":"https://github.com/openfoodfacts/openbeautyfacts-ruby","commit_stats":{"total_commits":98,"total_committers":6,"mean_commits":"16.333333333333332","dds":0.5408163265306123,"last_synced_commit":"92b4a605582dd98570def13ff4fa7b59e900d1c6"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/openfoodfacts/openbeautyfacts-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfoodfacts%2Fopenbeautyfacts-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfoodfacts%2Fopenbeautyfacts-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfoodfacts%2Fopenbeautyfacts-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfoodfacts%2Fopenbeautyfacts-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openfoodfacts","download_url":"https://codeload.github.com/openfoodfacts/openbeautyfacts-ruby/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfoodfacts%2Fopenbeautyfacts-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000706,"owners_count":26082921,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-wrapper","cosmetic","hacktoberfest","openbeautyfacts","ruby"],"created_at":"2024-11-11T17:04:06.100Z","updated_at":"2025-10-09T10:35:09.605Z","avatar_url":"https://github.com/openfoodfacts.png","language":"Ruby","funding_links":["https://opencollective.com/openfoodfacts-server","https://github.com/sponsors/openfoodfacts","https://donate.openfoodfacts.org"],"categories":[],"sub_categories":[],"readme":"# Open Beauty Facts Ruby SDK\n\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://static.openbeautyfacts.org/images/logos/obf-logo-horizontal-dark.png?refresh_github_cache=1\"\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://static.openbeautyfacts.org/images/logos/obf-logo-horizontal-light.png?refresh_github_cache=1\"\u003e\n  \u003cimg height=\"48\" src=\"https://static.openbeautyfacts.org/images/logos/obf-logo-horizontal-light.svg\"/\u003e\n\u003c/picture\u003e\n\n[![Gem Version](https://badge.fury.io/rb/openbeautyfacts.svg)](https://badge.fury.io/rb/openbeautyfacts)\n[![Build Status](https://github.com/openfoodfacts/openbeautyfacts-ruby/actions/workflows/ruby.yml/badge.svg)](https://github.com/openfoodfacts/openbeautyfacts-ruby/actions/workflows/ruby.yml)\n[![RuboCop](https://github.com/openfoodfacts/openbeautyfacts-ruby/actions/workflows/rubocop-analysis.yml/badge.svg)](https://github.com/openfoodfacts/openbeautyfacts-ruby/actions/workflows/rubocop-analysis.yml)\n[![Documentation](https://inch-ci.org/github/openfoodfacts/openbeautyfacts-ruby.svg?branch=master)](https://inch-ci.org/github/openfoodfacts/openbeautyfacts-ruby)\n\nAPI Wrapper for [Open Beauty Facts](https://openbeautyfacts.org/), the open database about beauty products.\n- We have a similar package for food: https://github.com/openfoodfacts/openfoodfacts-ruby\n- Note: This package needs updates for the newest APIs.\n- Please see on https://wiki.openfoodfacts.org/API/Ruby how to join the community to help\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'openbeautyfacts'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install openbeautyfacts\n\n## Models\n\nAll data is available for World, French, UK and US version for now. You should update the gem page URLs mapping for others.\n\n- Additive\n- Brand\n- Category\n- City\n- Contributor\n- Country\n- EntryDate\n- Faq\n- IngredientThatMayBeFromPalmOil\n- Label\n- LastEditDate\n- Locale\n- ManufacturingPlace\n- Mission\n- NumberOfIngredients\n- Origin\n- PackagerCode\n- Packaging\n- PeriodAfterOpening\n- Press\n- Product\n- ProductState\n- PurchasePlace\n- Store\n- Trace\n- User\n\n## Usage\n\n```ruby\nrequire 'openbeautyfacts'\n\n# Browse a product\n\ncode = \"3029330003533\"\nproduct = Openbeautyfacts::Product.get(code, locale: 'fr')\n\nproduct.product_name\n# =\u003e \"Crousti Moelleux Complet\"\n\nproduct.nutriments.to_hash\n# =\u003e {\"sodium\"=\u003e\"0.44\", \"sugars\"=\u003e6.5, \"fat_unit\"=\u003e\"g\", \"carbohydrates_unit\"=\u003e\"g\", \"proteins_unit\"=\u003e\"g\", \"nutrition-score-fr_100g\"=\u003e-2, \"fat\"=\u003e2.5, \"proteins_serving\"=\u003e12.8, \"sodium_serving\"=\u003e0.535, \"salt\"=\u003e1.1176, \"proteins\"=\u003e10.5, \"nutrition-score-uk_serving\"=\u003e-2, \"nutrition-score-fr\"=\u003e-2, \"fat_serving\"=\u003e3.04, \"sugars_unit\"=\u003e\"g\", \"sugars_100g\"=\u003e\"6.5\", \"sodium_unit\"=\u003e\"g\", \"saturated-fat_unit\"=\u003e\"g\", \"saturated-fat_serving\"=\u003e0.608, \"sodium_100g\"=\u003e0.44, \"fiber_unit\"=\u003e\"g\", \"energy\"=\u003e1067, \"energy_unit\"=\u003e\"kJ\", \"sugars_serving\"=\u003e7.9, \"carbohydrates_100g\"=\u003e44, \"nutrition-score-uk\"=\u003e-2, \"proteins_100g\"=\u003e10.5, \"fiber_serving\"=\u003e7.29, \"carbohydrates_serving\"=\u003e53.5, \"nutrition-score-fr_serving\"=\u003e-2, \"energy_serving\"=\u003e1300, \"fat_100g\"=\u003e\"2.5\", \"saturated-fat_100g\"=\u003e\"0.5\", \"nutrition-score-uk_100g\"=\u003e-2, \"fiber\"=\u003e6, \"salt_serving\"=\u003e1.36, \"salt_100g\"=\u003e\"1.1176\", \"carbohydrates\"=\u003e44, \"fiber_100g\"=\u003e6, \"energy_100g\"=\u003e1067, \"saturated-fat\"=\u003e0.5}\n\n# Update product\n\nuser = Openbeautyfacts::User.login(\"USERNAME\", \"PASSWORD\")\nif user\n    product.brands = \"Jacquet\"\n    product.update\n    # true\nend\n\n# Search products\n\nproducts = Openbeautyfacts::Product.search(\"Chocolate\", locale: 'world', page_size: 3)\n# =\u003e [#\u003cOpenbeautyfacts::Product _id=\"3045140105502\" code=\"3045140105502\" id=\"3045140105502\" image_small_url=\"https://en.openbeautyfacts.org/images/products/304/514/010/5502/front.7.100.jpg\" lc=\"en\" product_name=\"Milka au lait du Pays Alpin\"\u003e, #\u003cOpenbeautyfacts::Product _id=\"3046920028363\" code=\"3046920028363\" id=\"3046920028363\" image_small_url=\"https://en.openbeautyfacts.org/images/products/304/692/002/8363/front.5.100.jpg\" lc=\"en\" product_name=\"Tableta de chocolate negro \\\"Lindt Excellence\\\" 85% cacao\"\u003e, #\u003cOpenbeautyfacts::Product _id=\"3046920029759\" code=\"3046920029759\" id=\"3046920029759\" image_small_url=\"https://en.openbeautyfacts.org/images/products/304/692/002/9759/front.9.100.jpg\" lc=\"en\" product_name=\"Tableta de chocolate negro \\\"Lindt Excellence\\\" 90% cacao\"\u003e]\n\n# You might need to fetch full product data from results\n\nproducts.first.fetch\n\n# By product state\n\nproduct_states = Openbeautyfacts::ProductState.all\nproduct_states.last.products\n\n# Config\n\nOpenbeautyfacts::Locale.all\n# =\u003e [\"ad\", \"ad-es\", \"ad-fr\", \"ad-pt\", \"ae\", \"al\", \"am\", \"ar\", \"at\", \"au\", \"ax\", \"az\", \"bd\", \"be\", \"be-de\", \"be-fr\", \"bf\", \"bg\", \"bi\", \"bi-rn\", \"bn\", \"br\", \"by\", \"by-be\", \"bz\", \"ca\", \"ca-fr\", \"cg\", \"ch\", \"ch-fr\", \"ch-it\", \"ci\", \"cl\", \"cn\", \"co\", \"cr\", \"cu\", \"cy\", \"cy-tr\", \"cz\", \"de\", \"dk\", \"do\", \"dz\", \"dz-fr\", \"ec\", \"eg\", \"es\", \"es-ca\", \"es-eu\", \"es-gl\", \"fi\", \"fi-sv\", \"fr\", \"ga\", \"gf\", \"gn\", \"gp\", \"gr\", \"hk\", \"hr\", \"hu\", \"id\", \"ie\", \"ie-ga\", \"il\", \"il-ar\", \"il-ru\", \"in\", \"iq\", \"iq-ku\", \"ir\", \"is\", \"it\", \"jp\", \"ke\", \"ke-sw\", \"kh\", \"kr\", \"kw\", \"kz\", \"kz-kk\", \"lb\", \"lk\", \"lk-ta\", \"lu\", \"lu-de\", \"lu-lb\", \"lv\", \"ma\", \"ma-es\", \"ma-fr\", \"mc\", \"md\", \"mf\", \"ml\", \"mn\", \"mo\", \"mo-zh\", \"mq\", \"mr\", \"mt\", \"mt-mt\", \"mu\", \"mx\", \"my\", \"nc\", \"nl\", \"no\", \"nz\", \"nz-mi\", \"pa\", \"pe\", \"pf\", \"ph\", \"ph-tl\", \"pl\", \"pm\", \"pt\", \"qa\", \"re\", \"ro\", \"rs\", \"ru\", \"sa\", \"se\", \"sg\", \"sg-ms\", \"sg-ta\", \"sg-zh\", \"si\", \"sk\", \"sn\", \"sy\", \"th\", \"tn\", \"tr\", \"tw\", \"tz\", \"tz-sw\", \"ua\", \"uk\", \"us\", \"ve\", \"vn\", \"vu\", \"vu-bi\", \"world\", \"ye\", \"yt\", \"za\", \"za-af\", \"za-nr\", \"za-ss\", \"za-st\", \"za-tn\", \"za-ts\", \"za-ve\", \"za-xh\", \"za-zu\"]\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\n1. Fork it ( https://github.com/openfoodfacts/openbeautyfacts-ruby/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Using this SDK and Third party applications\n\n- If you use this SDK, feel free to open a PR to add your application in the list in [REUSERS.md](https://github.com/openfoodfacts/openbeautyfacts-ruby/blob/develop/REUSERS.md)\n- Make sure you comply with the OdBL licence, mentioning the Source of your data, and ensuring to avoid combining non free data you can't release legally as open data. Another requirement is contributing back any product you add using this SDK.\n- Please get in touch at reuse@openfoodfacts.org\n- We are very interested in learning what the Open Food Facts data is used for. It is not mandatory, but we would very much appreciate it if you tell us about your re-uses (https://forms.gle/hwaeqBfs8ywwhbTg8) so that we can share them with the Open Food Facts community. You can also fill this form to get a chance to get your app featured: https://forms.gle/hwaeqBfs8ywwhbTg8\n\n## Authors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfoodfacts%2Fopenbeautyfacts-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenfoodfacts%2Fopenbeautyfacts-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfoodfacts%2Fopenbeautyfacts-ruby/lists"}