• Getting started
  • Tutorials
    Authorization Code Flow
    Client Credentials
    Refreshing tokens
    Rice varieties
    Rice nutrition
Base URL: https://nutri.ricethailand.go.th
GET
/api/rice/nutrition/{id}

Get rice variety by ID

Returns a single rice variety by its ID

Parameters
NameTypeRequiredDescriptionDefaultParameter
idstring
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/nutrition

Get several rice varieties by ID

Returns a single rice variety by its ID

Parameters
NameTypeRequiredDescriptionDefaultParameter
idsstring
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/search

Get several rice varieties by ID

Returns a single rice variety by its ID

Parameters
NameTypeRequiredDescriptionDefaultParameter
qstringSearch query string to filter results——
pagenumberPage number for pagination1—
limitnumberNumber of items to return per page10—
sortBystringField to sort the results bycreatedAtcreatedAt,updatedAt,name,id
sortOrderstringOrder of sorting (ascending or descending)descasc,desc
colorstringFilter by color.——
chalkinessstringFilter by chalkiness.——
lengthstring,numberFilter 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] ——
amylosestring,numberFilter 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] ——
content2APstring,numberFilter 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] ——
proteinstring,numberFilter 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] ——
carbohydratestring,numberFilter 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] ——
totalFatstring,numberFilter 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/search

Search Rice Nutrition

Search rice nutrition data with filters, pagination, and sorting options.

Request Body
NameTypeRequiredDescriptionDefault
queryany
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.—
pageinteger
Required
Page number for pagination1
limitinteger
Required
Number of items per page10
sortBystring
Required
Field to sort by—
sortOrderstring
Required
Sort order directionasc
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"
    }
  ]
}
API Documentation
HomeDocumentation