Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/angristan/openfoodfacts-api-c
Simple program to get product information from the Open Food Facts API, in C.
https://github.com/angristan/openfoodfacts-api-c
api c curl jansson json openfoodfacts
Last synced: about 1 hour ago
JSON representation
Simple program to get product information from the Open Food Facts API, in C.
- Host: GitHub
- URL: https://github.com/angristan/openfoodfacts-api-c
- Owner: angristan
- License: mit
- Created: 2019-03-13T20:45:11.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-21T11:25:08.000Z (almost 6 years ago)
- Last Synced: 2025-01-19T22:16:23.405Z (3 days ago)
- Topics: api, c, curl, jansson, json, openfoodfacts
- Language: C
- Size: 9.77 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Open Food Facts API request in C
[![CircleCI](https://circleci.com/gh/angristan/openfoodfact-api-c.svg?style=svg)](https://circleci.com/gh/angristan/openfoodfact-api-c)
Simple program to get product information from the Open Food Facts API.
## Dependencies
- [curl](https://curl.haxx.se/libcurl/c/)
- [jansson](https://jansson.readthedocs.io/)## Usage
```sh
$ make
$ ./get_off_product
usage: ./get_off_product
```Example:
```sh
$ ./get_off_product 737628064502
Product name: Stir-Fry Rice Noodles
Product image: https://static.openfoodfacts.org/images/products/073/762/806/4502/front_en.6.400.jpg
```### Docker
You can run the program in Docker with the provided Dockerfile:
```sh
$ docker build -t openfoodfact-api-c .
$ docker run --rm openfoodfact-api-c 737628064502
Product name: Stir-Fry Rice Noodles
Product image: https://static.openfoodfacts.org/images/products/073/762/806/4502/front_en.6.400.jpg
```## License
MIT