Skip to content
merran
GitHubInstall

Merran documentation API & integrations

Test a USDA key

POST
/api/settings/server/nutrition/test
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.

Media typeapplication/json
object
usdaKey

A key to try before saving it; the saved one when left out.

string
>= 10 characters <= 200 characters

Example

{}

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.