{"id":18879581,"url":"https://github.com/statickidz/bedca-api","last_synced_at":"2025-04-14T19:23:26.672Z","repository":{"id":5621980,"uuid":"53582040","full_name":"statickidz/bedca-api","owner":"statickidz","description":"PHP API wrapper to http://www.bedca.net/bdpub/ public foods database.","archived":false,"fork":false,"pushed_at":"2023-07-31T13:45:54.000Z","size":23,"stargazers_count":17,"open_issues_count":2,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T07:51:10.379Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://phpsandbox.io/n/bedca-api-test-engkv#index.php","language":"PHP","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/statickidz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":["statickidz"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2016-03-10T12:18:37.000Z","updated_at":"2025-02-28T15:23:13.000Z","dependencies_parsed_at":"2022-08-06T19:00:37.274Z","dependency_job_id":"d148420e-941d-46c7-9247-7545c2d9d2c5","html_url":"https://github.com/statickidz/bedca-api","commit_stats":{"total_commits":8,"total_committers":2,"mean_commits":4.0,"dds":0.125,"last_synced_commit":"d7ff799a920b5ec1763a5734013e7771ce1b8d26"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statickidz%2Fbedca-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statickidz%2Fbedca-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statickidz%2Fbedca-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statickidz%2Fbedca-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/statickidz","download_url":"https://codeload.github.com/statickidz/bedca-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625493,"owners_count":21135513,"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","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":[],"created_at":"2024-11-08T06:37:45.524Z","updated_at":"2025-04-14T19:23:26.642Z","avatar_url":"https://github.com/statickidz.png","language":"PHP","funding_links":["https://github.com/sponsors/statickidz"],"categories":[],"sub_categories":[],"readme":"![BEDCA](http://img.imgur.com/nGR9U4c.png)\n\n### Spanish Food Composition Database (Base de Datos Española de Composición de Alimentos)\n\nPHP API wrapper to get foods from http://www.bedca.net/bdpub/ public database.\n\n## Installation\n\nInstall this package via [Composer](https://getcomposer.org/).\n\n```\ncomposer require statickidz/bedca-api\n```\n\nOr edit your project's `composer.json` to require `statickidz/bedca-api` and then run `composer update`.\n\n```json\n\"require\": {\n    \"statickidz/bedca-api\": \"1.1.0\"\n}\n```\n\n## Usage\n\n#### Init\n```php\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse StaticKidz\\BedcaAPI\\BedcaClient;\n\n$client = new BedcaClient();\n```\n\n#### Demo\nhttps://phpsandbox.io/n/bedca-api-test-engkv#index.php\n\n#### Get food groups\n```php\n$foodGroups = $client-\u003egetFoodGroups();\n```\n\nExample response:\n```php\nobject(stdClass)#17 (1) {\n  [\"food\"]=\u003e\n  array(13) {\n    [0]=\u003e\n    object(stdClass)#18 (3) {\n      [\"fg_id\"]=\u003e\n      string(1) \"1\"\n      [\"fg_ori_name\"]=\u003e\n      string(20) \"Lácteos y derivados\"\n      [\"fg_eng_name\"]=\u003e\n      string(22) \"Milk and milk products\"\n    }\n    [1]=\u003e\n    object(stdClass)#19 (3) {\n      [\"fg_id\"]=\u003e\n      string(1) \"2\"\n      [\"fg_ori_name\"]=\u003e\n      string(18) \"Huevos y derivados\"\n      [\"fg_eng_name\"]=\u003e\n      string(21) \"Eggs and egg products\"\n    }\n    [2]=\u003e\n    object(stdClass)#20 (3) {\n      [\"fg_id\"]=\u003e\n      string(1) \"3\"\n      [\"fg_ori_name\"]=\u003e\n      string(21) \"Cárnicos y derivados\"\n      [\"fg_eng_name\"]=\u003e\n      string(22) \"Meat and meat products\"\n    }\n    ..........\n  }\n}\n```\n\n#### Get foods in a food group\nKnowing the food group ID, we can retrieve all foods in these group.\n```php\n$food = $client-\u003egetFoodsInGroup(3);\n```\n\n#### Get single food by ID\nSame operation with previous data, knowing food ID we can retrieve all data.\n```php\n$food = $client-\u003egetFood(893);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatickidz%2Fbedca-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstatickidz%2Fbedca-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatickidz%2Fbedca-api/lists"}