FatSecret Platform API Documentation

Authentication

Note that you must be signed up as a developer, and agree to our Terms of Service in order to obtain the credentials required to send requests to the REST API.

  • For OAuth 2.0: Client ID and Client Secret
  • For OAuth 1.0 Consumer Key and Shared Secret

There are two types of request that the REST API Supports:


While OAuth 1.0 supports both types of requests, OAuth 2.0 only support the Signed Requests!

Signed Requests (Client ID and Token - OAuth 2.0, Consumer Key and Signature - OAuth 1.0)

All requests to the REST API must be signed (using your Shared Secret).

Signed Requests, unlike Signed and Delegated Requests, don't represent information for a specific user's profile on the FatSecret Platform. For example, the food.get.v4 API method provides nutritional details for a chosen food. Since the response gives information about a shared concept (such as a single food item) without tailoring to any specific user, you must sign requests to the food.get.v4 API method. This signature verifies the request, eliminating the need for additional user-specific credentials.

Signed and Delegated Requests (Consumer Key and Access Token and Signature - OAuth 1.0 ONLY)

Many REST API requests execute on behalf of an individual user. For example, weights.get_month.v2 retrieves the recorded weight for a selected user and month, and food_entry.create logs an entry in a user's Food Diary.

To record and store information per user, the FatSecret Platform offers developers profiles, unique identifiers for individual users. You can create profiles using a unique identifier like a member name, email address, or unique member ID, or without any user-specific information. In the latter case, you'll need to store the profile's oauth_token and oauth_secret in your system (see profile.create).

The Profile Management REST API methods let you generate unique OAuth access tokens for each user, and retrieve the secret for each token to sign requests on their behalf. See the API methods profile.create and profile.get_auth for details.

Besides creating profiles for your users, you can use FatSecret.com's full 3-legged OAuth to obtain an access token for a profile directly linked to a user account on FatSecret.com. Click here for more information.