{"id":17000790,"url":"https://github.com/sergkash7/fdc-facade","last_synced_at":"2026-05-15T20:33:05.513Z","repository":{"id":57048308,"uuid":"238789731","full_name":"sergkash7/fdc-facade","owner":"sergkash7","description":"Facade for The FoodData Central API.","archived":false,"fork":false,"pushed_at":"2020-12-20T16:07:36.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-20T07:57:10.527Z","etag":null,"topics":["api","center","data","food","usda"],"latest_commit_sha":null,"homepage":null,"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/sergkash7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-06T21:36:56.000Z","updated_at":"2020-12-20T16:03:59.000Z","dependencies_parsed_at":"2022-08-23T19:10:23.675Z","dependency_job_id":null,"html_url":"https://github.com/sergkash7/fdc-facade","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/sergkash7/fdc-facade","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergkash7%2Ffdc-facade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergkash7%2Ffdc-facade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergkash7%2Ffdc-facade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergkash7%2Ffdc-facade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sergkash7","download_url":"https://codeload.github.com/sergkash7/fdc-facade/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergkash7%2Ffdc-facade/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33078899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T20:25:35.270Z","status":"ssl_error","status_checked_at":"2026-05-15T20:25:34.732Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","center","data","food","usda"],"created_at":"2024-10-14T04:13:00.709Z","updated_at":"2026-05-15T20:33:05.487Z","avatar_url":"https://github.com/sergkash7.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FDC Facade\n\nFacade for [The FoodData Central API](https://github.com/thephpleague/commonmark).\n\n## Install\n\n``` bash\ncomposer require sergkash7/fdc-facade\n```\n\n## Gaining Access\n\nAnyone may access and use the API.\nHowever, a data.gov API key must be incorporated into each API request.\n[Sign up to obtain a key](https://fdc.nal.usda.gov/api-key-signup.html).\n\n\n## Example\n\n``` php\n$fdc = new FdcFacade('YOUR_API_KEY');\n$food = $fdc-\u003efetch(173441);\n\nprint_r([\n    'Protein (grams)' =\u003e $food-\u003egetProtein(),\n    'Fat total (grams)' =\u003e $food-\u003egetFatTotal(),\n    'Carbohydrates (grams)' =\u003e $food-\u003egetCarbohydrates(),\n    'Fat saturated (grams)' =\u003e $food-\u003egetFatSaturated(),\n    'Fat monounsaturated (grams)' =\u003e $food-\u003egetFatMonounsaturated(),\n    'Fat polyunsaturated (grams)' =\u003e $food-\u003egetFatPolyunsaturated(),\n    'Fat trans (grams)' =\u003e $food-\u003egetFatTrans(),\n    'Sugar (grams)' =\u003e $food-\u003egetSugar(),\n    'Fiber (grams)' =\u003e $food-\u003egetFiber(),\n    'Water (grams)' =\u003e $food-\u003egetWater(),\n    'Cholesterol (milligrams)' =\u003e $food-\u003egetCholesterol(),\n    'Caffeine (milligrams)' =\u003e $food-\u003egetCaffeine(),\n    'Vitamin A (micrograms)' =\u003e $food-\u003egetVitaminA(),\n    'Thiamin (milligrams)' =\u003e $food-\u003egetThiamin(),\n    'Riboflavin (milligrams)' =\u003e $food-\u003egetRiboflavin(),\n    'Niacin (milligrams)' =\u003e $food-\u003egetNiacin(),\n    'Pantothenic acid (milligrams)' =\u003e $food-\u003egetPantothenicAcid(),\n    'Vitamin B6 (milligrams)' =\u003e $food-\u003egetVitaminB6(),\n    'Vitamin B12 (micrograms)' =\u003e $food-\u003egetVitaminB12(),\n    'Vitamin C (milligrams)' =\u003e $food-\u003egetVitaminC(),\n    'Vitamin D (micrograms)' =\u003e $food-\u003egetVitaminD(),\n    'Vitamin E (milligrams)' =\u003e $food-\u003egetVitaminE(),\n    'Vitamin K (micrograms)' =\u003e $food-\u003egetVitaminK(),\n    'Folate (micrograms)' =\u003e $food-\u003egetFolate(),\n    'Calcium (milligrams)' =\u003e $food-\u003egetCalcium(),\n    'Iron (milligrams)' =\u003e $food-\u003egetIron(),\n    'Magnesium (milligrams)' =\u003e $food-\u003egetMagnesium(),\n    'Phosphorus (milligrams)' =\u003e $food-\u003egetPhosphorus(),\n    'Potassium (milligrams)' =\u003e $food-\u003egetPotassium(),\n    'Sodium (milligrams)' =\u003e $food-\u003egetSodium(),\n    'Zinc (milligrams)' =\u003e $food-\u003egetZinc(),\n    'Copper (milligrams)' =\u003e $food-\u003egetCopper(),\n    'Manganese (milligrams)' =\u003e $food-\u003egetManganese(),\n    'Selenium (micrograms)' =\u003e $food-\u003egetSelenium(),\n]);\n```\n\n``` bash\n[Protein (grams)] =\u003e 3.37\n[Fat total (grams)] =\u003e 0.97\n[Carbohydrates (grams)] =\u003e 4.99\n[Fat saturated (grams)] =\u003e 0.633\n[Fat monounsaturated (grams)] =\u003e 0.277\n[Fat polyunsaturated (grams)] =\u003e 0.035\n[Fat trans (grams)] =\u003e \n[Sugar (grams)] =\u003e 5.2\n[Fiber (grams)] =\u003e \n[Water (grams)] =\u003e 89.92\n[Cholesterol (milligrams)] =\u003e 5\n[Caffeine (milligrams)] =\u003e \n[Vitamin A (micrograms)] =\u003e 14.1\n[Thiamin (milligrams)] =\u003e 0.02\n[Riboflavin (milligrams)] =\u003e 0.185\n[Niacin (milligrams)] =\u003e 0.093\n[Pantothenic acid (milligrams)] =\u003e 0.361\n[Vitamin B6 (milligrams)] =\u003e 0.037\n[Vitamin B12 (micrograms)] =\u003e 0.47\n[Vitamin C (milligrams)] =\u003e \n[Vitamin D (micrograms)] =\u003e 0.025\n[Vitamin E (milligrams)] =\u003e 0.01\n[Vitamin K (micrograms)] =\u003e 0.1\n[Folate (micrograms)] =\u003e 5\n[Calcium (milligrams)] =\u003e 125\n[Iron (milligrams)] =\u003e 0.03\n[Magnesium (milligrams)] =\u003e 11\n[Phosphorus (milligrams)] =\u003e 95\n[Potassium (milligrams)] =\u003e 150\n[Sodium (milligrams)] =\u003e 44\n[Zinc (milligrams)] =\u003e 0.42\n[Copper (milligrams)] =\u003e 0.01\n[Manganese (milligrams)] =\u003e 0.003\n[Selenium (micrograms)] =\u003e 3.3\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergkash7%2Ffdc-facade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsergkash7%2Ffdc-facade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergkash7%2Ffdc-facade/lists"}