You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

fatsecret-api

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fatsecret-api

An unofficial API wrapper for FatSecret made for node.js

1.0.3
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

FatSecret API Wrapper

This package is an unofficial fatsecret.com API wrapper for Node.js. The FatSecret API, in addition to many other features, allows you to gather nutritional information about foods.

Install

# install locally
npm install fatsecret-api --save

Highlights

  • ✔ Full type-definitions
  • ✔ Automatic access token refreshing
  • ✔ Uses OAUTH2

Usage

Initialize a new FatSecretClient instance with your credentials.

import { FatSecretClient } from "fatsecret-api";

const fatSecretClient = new FatSecretClient({
    clientId: "YOUR_CLIENT_ID",
    clientSecret: "YOUR_CLIENT_SECRET",
    scope: "SEE_FATSECRET_DOCS",
});

Methods

Examples of basic methods on the FatSecretClient instance. To see documentation on parameters and responses please visit the official docs here.

// food.get.v2: Returns detailed nutritional information for the specified food.
await fatSecretClient.getFood({ food_id: "4278773" });

// foods.search: Conducts a search of the food database using the search expression specified.
await fatSecretClient.getFoodSearch({ search_expression: "Cereal" });

// recipe.get: Returns detailed information for the specified recipe.
await fatSecretClient.getRecipe({ recipe_id: "31341" });

// recipes.search: Conducts a search of the recipe database using the search expression specified.
await fatSecretClient.getRecipeSearch({ search_expression: "Brownies" });

// ... to see more methods view the official api docs

📌 OAUTH1 is currently not supported.

Keywords

nutrition

FAQs

Package last updated on 10 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts