Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-33.33%
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc