Skip to content

T1b4lt/fatsecret-rest-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fatsecret-rest-api

FatsecretIMG

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.


Try it!

  1. Clone the repo:
git clone https://github.com/T1b4lt/fatsecret-rest-api.git
cd fatsecret-rest-api
  1. Create a virtual Python environment the way you prefer (I usually use this):
python3 -m venv fatsecret_env
  1. Activate the enviroment:
source fatsecret_env/bin/activate
  1. Install all dependencies:
pip install -r requirements.txt
  1. Run app.py
python app.py
  1. Visit Swagger Doc at localhost:5000