Error 8: Invalid signature: please refer to the documentation

14 views
Skip to first unread message

Tamil Maghiznan

unread,
Jun 16, 2026, 1:55:48 AM (5 days ago) Jun 16
to fatsecret Platform API
from fatsecret import Fatsecret

CONSUMER_KEY = ""
CONSUMER_SECRET = ""

fs = Fatsecret(CONSUMER_KEY, CONSUMER_SECRET)

search_results = fs.foods.get_v5("Banana")

print(search_results)

i have this code with Premier Free Plan api keys, i have tried using get_v1,get_v2... or search_v1,search_v2..search_v5 but same error pops up..

seba...@fatsecret.com

unread,
Jun 16, 2026, 1:56:52 AM (5 days ago) Jun 16
to fatsecret Platform API
Thanks, looks like you have mis-configured your OAuth2 signature requests

Tamil Maghiznan

unread,
Jun 16, 2026, 3:50:15 PM (4 days ago) Jun 16
to fatsecret Platform API

how to fix it? i found a way with out using from fatsecret import Fatsecret
look this out
import requests
from requests_oauthlib import OAuth1

CONSUMER_KEY = ""
CONSUMER_SECRET = ""

auth = OAuth1(CONSUMER_KEY, client_secret=CONSUMER_SECRET)

# 2. Set up the REST API URL and parameters

params = {
"method": "foods.search",
"search_expression": "dosa",
"format": "json"
}

response = requests.get(url, auth=auth, params=params)

if response.status_code == 200:
data = response.json()
if "error" in data:
print(f"FatSecret API Error {data['error']['code']}: {data['error']['message']}")
else:
foods_list = data.get("foods", {}).get("food", [])
if foods_list:
for i in foods_list:
print(i)
for j in range(5):
print()
else:
print("No foods found matching that description.")
else:
print(f"HTTP Request Failed with status code: {response.status_code}")
print(response.text)
this works but i prefer fatsecret module but idk how to use it.. 

seba...@fatsecret.com

unread,
Jun 16, 2026, 3:52:00 PM (4 days ago) Jun 16
to fatsecret Platform API
Please see our full Postman library here: https://www.postman.com/fatsecret/97960a9b-5292-4c02-89c1-ded0c29c0641

We recommend using Postman first before building your own native application integration.

For further assistance on how to make a call via OAuth2.0 please see previous threads in our developer support forum

Reply all
Reply to author
Forward
0 new messages