Merran documentation API & integrations
Test a USDA key
POST
/api/settings/server/nutrition/test
const url = 'http://localhost:3000/api/settings/server/nutrition/test';const options = { method: 'POST', headers: { cookie: 'merran.session_token=<merran.session_token>', 'Content-Type': 'application/json' }, body: '{}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/api/settings/server/nutrition/test \ --header 'Content-Type: application/json' \ --cookie merran.session_token=<merran.session_token> \ --data '{}'Server admins only. Searches USDA FoodData Central for apples with a key, before saving it, or with the saved one.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
usdaKey
A key to try before saving it; the saved one when left out.
string
Example
{}Responses
Section titled “Responses”It works.
Media typeapplication/json
object
found
required
What a search for apples found.
string
Example
{ "found": "Apples, raw, with skin"}No key to test.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string
Example
{ "error": { "code": "not_found", "message": "There's nothing here.", "fields": { "name": "Give it a name." } }}Not signed in.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string
Example
{ "error": { "code": "not_found", "message": "There's nothing here.", "fields": { "name": "Give it a name." } }}Not allowed.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string
Example
{ "error": { "code": "not_found", "message": "There's nothing here.", "fields": { "name": "Give it a name." } }}USDA refused the key.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string
Example
{ "error": { "code": "not_found", "message": "There's nothing here.", "fields": { "name": "Give it a name." } }}USDA’s limit for the hour.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string
Example
{ "error": { "code": "not_found", "message": "There's nothing here.", "fields": { "name": "Give it a name." } }}USDA didn’t answer.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string
Example
{ "error": { "code": "not_found", "message": "There's nothing here.", "fields": { "name": "Give it a name." } }}© 2026 Kyle Johnson. Documentation: CC BY 4.0. Merran: AGPL-3.0-or-later.