Fatsecret superficial REST API
This fastsecret REST API tries to cover a series of basic needs when obtaining nutritional information from fatsecret.
Its main purpose is to return nutritional information about the food you are requesting for.
The main petition is as follows,
/food/{country}/{food_name}
where country indicates the country from which you want the information and food_name the name of the food you are looking for information.
The response of the API is as follows,
{
"type": 'food',
"country": <country>, [Actually US and ES are supported]
"timestamp": <timestamp>,
"food_array": [array, of, food, objects]
}
where a food object is as follows,
{
"food_name": 'food_name'
"food_brand": 'food_brand'
"protein": 0.0
"carbs": 0.0
"fat": 0.0
"kcal": 0.0
"unit": 'units'
"quantity": 0.0
}
This API also comes with swagger doc in /
path.
- Clone the repo:
git clone https://github.com/T1b4lt/fatsecret-rest-api.git
cd fatsecret-rest-api
- Create a virtual Python environment the way you prefer (I usually use this):
python3 -m venv fatsecret_env
- Activate the enviroment:
source fatsecret_env/bin/activate
- Install all dependencies:
pip install -r requirements.txt
- Run app.py
python app.py
- Visit Swagger Doc at localhost:5000