curl --request POST \
--url https://api.aisa.one/apis/v1/afcd-foodstandards-gov-au/foods/search-foods \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "vegemite"
}
'import requests
url = "https://api.aisa.one/apis/v1/afcd-foodstandards-gov-au/foods/search-foods"
payload = { "query": "vegemite" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: 'vegemite'})
};
fetch('https://api.aisa.one/apis/v1/afcd-foodstandards-gov-au/foods/search-foods', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/afcd-foodstandards-gov-au/foods/search-foods",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => 'vegemite'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/afcd-foodstandards-gov-au/foods/search-foods"
payload := strings.NewReader("{\n \"query\": \"vegemite\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/afcd-foodstandards-gov-au/foods/search-foods")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"vegemite\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/afcd-foodstandards-gov-au/foods/search-foods")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"vegemite\"\n}"
response = http.request(request)
puts response.read_body{
"catalogue_size": 1588,
"food_group_id": null,
"foods": [
{
"classification_id": 31102,
"derivation": "Analysed",
"food_group": "Miscellaneous",
"food_group_id": 2,
"inclusions": null,
"name": "Spread, yeast, vegemite",
"pfk": "F008785",
"sub_food_group": "Yeast, and yeast vegetable or meat extracts",
"sub_food_group_id": 11,
"url": "https://www.foodstandards.gov.au/science-data/food-nutrient-databases/afcd/search/food/F008785"
}
],
"letter": null,
"observed_at_ms": 1791942979360,
"page": 1,
"page_size": 50,
"query": "vegemite",
"source_url": "https://www.foodstandards.gov.au/science-data/food-nutrient-databases/afcd/search/api/foods/alphabetical",
"sub_food_group_id": null,
"total_matches": 1,
"total_pages": 1
}Search foods
To find the AFCD Public Food Key of a food by name (e.g. ‘vegemite’, ‘weet-bix’, ‘lamb chop’), to list all foods in a group, or to browse foods starting with a letter. Follow with get_food for the nutrient profile.
curl --request POST \
--url https://api.aisa.one/apis/v1/afcd-foodstandards-gov-au/foods/search-foods \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "vegemite"
}
'import requests
url = "https://api.aisa.one/apis/v1/afcd-foodstandards-gov-au/foods/search-foods"
payload = { "query": "vegemite" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: 'vegemite'})
};
fetch('https://api.aisa.one/apis/v1/afcd-foodstandards-gov-au/foods/search-foods', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/afcd-foodstandards-gov-au/foods/search-foods",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => 'vegemite'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/afcd-foodstandards-gov-au/foods/search-foods"
payload := strings.NewReader("{\n \"query\": \"vegemite\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/afcd-foodstandards-gov-au/foods/search-foods")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"vegemite\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/afcd-foodstandards-gov-au/foods/search-foods")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"vegemite\"\n}"
response = http.request(request)
puts response.read_body{
"catalogue_size": 1588,
"food_group_id": null,
"foods": [
{
"classification_id": 31102,
"derivation": "Analysed",
"food_group": "Miscellaneous",
"food_group_id": 2,
"inclusions": null,
"name": "Spread, yeast, vegemite",
"pfk": "F008785",
"sub_food_group": "Yeast, and yeast vegetable or meat extracts",
"sub_food_group_id": 11,
"url": "https://www.foodstandards.gov.au/science-data/food-nutrient-databases/afcd/search/food/F008785"
}
],
"letter": null,
"observed_at_ms": 1791942979360,
"page": 1,
"page_size": 50,
"query": "vegemite",
"source_url": "https://www.foodstandards.gov.au/science-data/food-nutrient-databases/afcd/search/api/foods/alphabetical",
"sub_food_group_id": null,
"total_matches": 1,
"total_pages": 1
}请求规范
- 方法与路径: POST /apis/v1/afcd-foodstandards-gov-au/foods/search-foods
- 可用状态: enabled
- 请求 URL 模板:
https://api.aisa.one/apis/v1/afcd-foodstandards-gov-au/foods/search-foods
{
"operationId": "afcd-foodstandards-gov-au.foods.search-foods",
"method": "POST",
"path": "/apis/v1/afcd-foodstandards-gov-au/foods/search-foods",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"examples": {
"provider": {
"summary": "Official provider example; checked against AIsa request constraints",
"value": {
"query": "vegemite"
}
}
},
"schema": {
"additionalProperties": true,
"properties": {
"food_group_id": {
"description": "Restrict to one AFCD food group (see list_food_groups).\n\nProvider reference: minimum 1.",
"type": "number",
"x-alexandria-option-metadata": {
"in": "body",
"min": 1
}
},
"letter": {
"description": "Browse foods whose name starts with this letter (A-Z); switches to the per-letter endpoint. Pattern: ^[A-Za-z]$.",
"type": "string",
"x-alexandria-option-metadata": {
"in": "body"
}
},
"page": {
"default": 1,
"description": "1-based page of the client-side paginated result (the API returns the whole list).\n\nProvider reference: minimum 1; default 1.",
"type": "number",
"x-alexandria-option-metadata": {
"in": "body",
"min": 1
}
},
"page_size": {
"default": 50,
"description": "Rows per page (1-200).\n\nProvider reference: minimum 1; maximum 200; default 50.",
"type": "number",
"x-alexandria-option-metadata": {
"in": "body",
"max": 200,
"min": 1
}
},
"query": {
"description": "Case-insensitive substring matched against the food name and inclusions (e.g. 'vegemite', 'breakfast cereal'). Optional when a group or letter is given.",
"type": "string",
"x-alexandria-option-metadata": {
"in": "body"
}
},
"sub_food_group_id": {
"description": "Restrict to one AFCD sub food group (see list_food_groups).\n\nProvider reference: minimum 1.",
"type": "number",
"x-alexandria-option-metadata": {
"in": "body",
"min": 1
}
}
},
"type": "object"
}
}
},
"required": false
},
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
费用与请求规则
按实际用量收费。 默认请求预估费用:$0.0005 USD。 最终费用以实际用量为准。 账户适用价格可能不同;支持报价的接口可按实际请求获取报价。授权
请求体
响应
Search the Australian Food Composition Database (AFCD Release 3.0, Food Standards Australia New Zealand) for foods by name (GET https://www.foodstandards.gov.au/science-data/food-nutrient-databases/afcd/search/api/foods/alphabetical, the complete catalogue of 1,588 foods, or /foods/alphabetical/{letter} when letter is given). AFCD has no server-side search: the program applies query as a case-insensitive substring match over the food name and its inclusions (alternative names), exactly as the AFCD site does, then filters by food group / sub food group and pages the result. Each row carries the Public Food Key (pfk) for get_food, the AUSNUT classification code, the food group pair and the public food page URL. Returns an empty foods list for a query nothing matches; not_found for a food_group_id / sub_food_group_id that does not exist in AFCD or a page past the last one.
The response contains the tool result directly.
| Documented field | Provider type | Description |
|---|---|---|
catalogue_size | number | Foods in the AFCD list the filter ran over (the whole database, or the letter's foods). |
food_group_id | number | The food group filter applied; null when none. |
foods | object[] | The page of matching foods in AFCD's alphabetical order. |
letter | string | The letter browsed (upper case); null when none. |
observed_at_ms | number | Unix milliseconds when this program read the AFCD API. |
page | number | |
page_size | number | |
query | string | The query applied, trimmed; null when none. |
source_url | string | The AFCD API URL this answer was read from. |
sub_food_group_id | number | The sub food group filter applied; null when none. |
total_matches | number | Foods matching query and filters across all pages. |
total_pages | number |
These are the provider's documented fields. Field requiredness, nullability and nested object structures are specified only where the descriptions explicitly say so.