GET
/api/rice/nutrition/{id}Get rice variety by ID
Returns a single rice variety by its ID
Parameters
Name | Type | Required | Description | Default | Parameter |
---|---|---|---|---|---|
id | string | Required | ObjectId of the rice variety | — | — |
Example Request
curl -X GET https://nutri.ricethailand.go.th/api/rice/nutrition/{id} \
--header 'Authorization: Bearer 1POdFZRZbvb...qqillRxMr2z'
Responses
200
400
404
500
{
"cropSampleID": 0,
"action": "string",
"cropSampleName": "string",
"riceVarieties": {
"en": "string",
"th": "string"
},
"cropSampleNameType": "string",
"accessionIDbasedonRGB": "string",
"cropSite": {
"province": "string",
"district": "string",
"subdistrict": "string",
"otherInfo": "string"
},
"yearOfProduction": "string",
"seasonOfProduction": "string",
"organicProduction": "string",
"cropSeedSource": "string",
"cropData": "string",
"yearOfAnalysis": "string",
"siteOfAnalysis": "string",
"dataSource": "string"
}
GET
/api/rice/nutritionGet several rice varieties by ID
Returns a single rice variety by its ID
Parameters
Name | Type | Required | Description | Default | Parameter |
---|---|---|---|---|---|
ids | string | Required | A comma-separated list of the ObjectId of the rice variety | — | — |
Example Request
curl -X GET https://nutri.ricethailand.go.th/api/rice/nutrition \
--header 'Authorization: Bearer 1POdFZRZbvb...qqillRxMr2z'
Responses
200
400
404
500
[
{
"cropSampleID": 0,
"action": "string",
"cropSampleName": "string",
"riceVarieties": {
"en": "string",
"th": "string"
},
"cropSampleNameType": "string",
"accessionIDbasedonRGB": "string",
"cropSite": {
"province": "string",
"district": "string",
"subdistrict": "string",
"otherInfo": "string"
},
"yearOfProduction": "string",
"seasonOfProduction": "string",
"organicProduction": "string",
"cropSeedSource": "string",
"cropData": "string",
"yearOfAnalysis": "string",
"siteOfAnalysis": "string",
"dataSource": "string"
}
]
GET
/api/rice/nutrition/searchGet several rice varieties by ID
Returns a single rice variety by its ID
Parameters
Name | Type | Required | Description | Default | Parameter |
---|---|---|---|---|---|
q | string | Search query string to filter results | — | — | |
page | number | Page number for pagination | 1 | — | |
limit | number | Number of items to return per page | 10 | — | |
sortBy | string | Field to sort the results by | createdAt | createdAt,updatedAt,name,id | |
sortOrder | string | Order of sorting (ascending or descending) | desc | asc,desc | |
color | string | Filter by color. | — | — | |
chalkiness | string | Filter by chalkiness. | — | — | |
length | string,number | Filter by length. Supported formats: - Exact match: 10.99 - Greater than: >10.99 - Greater than or equal: >=10.99 - Less than: <10.99 - Less than or equal: <=10.99 - Range: [10.99,20.99] | — | — | |
amylose | string,number | Filter by amylose. Supported formats: - Exact match: 10.99 - Greater than: >10.99 - Greater than or equal: >=10.99 - Less than: <10.99 - Less than or equal: <=10.99 - Range: [10.99,20.99] | — | — | |
content2AP | string,number | Filter by 2AP content. Supported formats: - Exact match: 10.99 - Greater than: >10.99 - Greater than or equal: >=10.99 - Less than: <10.99 - Less than or equal: <=10.99 - Range: [10.99,20.99] | — | — | |
protein | string,number | Filter by protein. Supported formats: - Exact match: 10.99 - Greater than: >10.99 - Greater than or equal: >=10.99 - Less than: <10.99 - Less than or equal: <=10.99 - Range: [10.99,20.99] | — | — | |
carbohydrate | string,number | Filter by carbohydrate. Supported formats: - Exact match: 10.99 - Greater than: >10.99 - Greater than or equal: >=10.99 - Less than: <10.99 - Less than or equal: <=10.99 - Range: [10.99,20.99] | — | — | |
totalFat | string,number | Filter by total fat. Supported formats: - Exact match: 10.99 - Greater than: >10.99 - Greater than or equal: >=10.99 - Less than: <10.99 - Less than or equal: <=10.99 - Range: [10.99,20.99] | — | — |
Example Request
curl -X GET https://nutri.ricethailand.go.th/api/rice/nutrition/search \
--header 'Authorization: Bearer 1POdFZRZbvb...qqillRxMr2z'
Responses
200
400
404
500
{
"metadata": {
"next": "string",
"previouse": "string",
"hasNextPage": true,
"hasPreviousPage": true,
"totalItems": 0,
"totalPages": 0,
"currentPage": 0,
"limit": 0
},
"items": [
{
"cropSampleID": 0,
"action": "string",
"cropSampleName": "string",
"riceVarieties": {
"en": "string",
"th": "string"
},
"cropSampleNameType": "string",
"accessionIDbasedonRGB": "string",
"cropSite": {
"province": "string",
"district": "string",
"subdistrict": "string",
"otherInfo": "string"
},
"yearOfProduction": "string",
"seasonOfProduction": "string",
"organicProduction": "string",
"cropSeedSource": "string",
"cropData": "string",
"yearOfAnalysis": "string",
"siteOfAnalysis": "string",
"dataSource": "string"
}
]
}
POST
/api/rice/nutrition/searchSearch Rice Nutrition
Search rice nutrition data with filters, pagination, and sorting options.
Request Body
Name | Type | Required | Description | Default |
---|---|---|---|---|
query | any | Required | Search fields include text fields (cropSampleName, riceVarieties.th, riceVarieties.en, cropSite.province, yearOfAnalysis, siteOfAnalysis, dataSource, riceCategories, color), numeric fields (length, chalkiness), and range fields (amylose, content2AP, protein, carbohydrate, totalFat). Text fields support conditions like is, isNot, startsWith, endsWith, contains, notContains, isEmpty, and isNotEmpty. Numeric and range fields support equals, notEquals, greaterThan, lessThan, between, notBetween, isNull, and isNotNull conditions. | — |
page | integer | Required | Page number for pagination | 1 |
limit | integer | Required | Number of items per page | 10 |
sortBy | string | Required | Field to sort by | — |
sortOrder | string | Required | Sort order direction | asc |
Example Request Body
{
"query": {
"0": {
"operator": "AND",
"filters": {
"0": {
"field": "riceVarieties.th",
"condition": "contains",
"value": "กข",
"value2": ""
},
"1": {
"field": "riceVarieties.en",
"condition": "endsWith",
"value": "10",
"value2": ""
}
}
},
"1": {
"operator": "OR",
"filters": {
"0": {
"field": "protein",
"condition": "greaterThan",
"value": "5",
"value2": ""
},
"1": {
"field": "carbohydrate",
"condition": "greaterThanOrEqual",
"value": "100",
"value2": ""
}
}
}
},
"page": 1,
"limit": 10,
"sortBy": "cropSampleName",
"sortOrder": "asc"
}
curl -X POST https://nutri.ricethailand.go.th/api/rice/nutrition/search \
--header 'Authorization: Bearer 1POdFZRZbvb...qqillRxMr2z' \
--form 'query={"0":{"operator":"AND","filters":{"0":{"field":"riceVarieties.th","condition":"contains","value":"กข","value2":""},"1":{"field":"riceVarieties.en","condition":"endsWith","value":"10","value2":""}}},"1":{"operator":"OR","filters":{"0":{"field":"protein","condition":"greaterThan","value":"5","value2":""},"1":{"field":"carbohydrate","condition":"greaterThanOrEqual","value":"100","value2":""}}}}' \
--form 'page=1' \
--form 'limit=10' \
--form 'sortBy="cropSampleName"' \
--form 'sortOrder="asc"'
Responses
200
400
500
{
"metadata": {
"next": "string",
"previouse": "string",
"hasNextPage": true,
"hasPreviousPage": true,
"totalItems": 0,
"totalPages": 0,
"currentPage": 0,
"limit": 0
},
"items": [
{
"cropSampleID": 0,
"action": "string",
"cropSampleName": "string",
"riceVarieties": {
"en": "string",
"th": "string"
},
"cropSampleNameType": "string",
"accessionIDbasedonRGB": "string",
"cropSite": {
"province": "string",
"district": "string",
"subdistrict": "string",
"otherInfo": "string"
},
"yearOfProduction": "string",
"seasonOfProduction": "string",
"organicProduction": "string",
"cropSeedSource": "string",
"cropData": "string",
"yearOfAnalysis": "string",
"siteOfAnalysis": "string",
"dataSource": "string"
}
]
}