Building Material Price
The Building Material Price allows users to obtain historical pricing information for specific material specifications across multiple states. Data is grouped by material specification and then by state, where each state includes detailed monthly price figures.
Get All Material Groups
API Endpoint
GET /internal/data/material/group
Headers
| Type | Value | Require |
|---|---|---|
| Accept | application/json | Yes |
| Authorization | Bearer {{access_token}} | Yes |
Sample Request
curl --location \
--request GET 'https://n3c-api.cidb.gov.my/internal/data/material/group' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {{access_token}}'
Sample Response
[
{
"id": 1,
"name": "Cement",
"code": "M1",
"description": "",
"created_at": "2025-06-23T08:07:27.000000Z",
"updated_at": "2025-06-23T08:07:27.000000Z"
},
{
"id": 2,
"name": "Aggregate",
"code": "M2",
"description": "",
"created_at": "2025-06-23T08:07:27.000000Z",
"updated_at": "2025-06-23T08:07:27.000000Z"
},
...
]
Get All Specifications
API Endpoint
GET /internal/data/material/specification
Headers
| Type | Value | Require |
|---|---|---|
| Accept | application/json | Yes |
| Authorization | Bearer {{access_token}} | Yes |
Sample Request
curl --location \
--request GET 'https://n3c-api.cidb.gov.my/internal/data/material/specification' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {{access_token}}'
Sample Response
[
{
"id": 116,
"material_group_id": 6,
"specification": "AAC, Light Weight Block - 100mm x 200mm x 600mm",
"group": "Bricks",
"unit": "Piece",
"pay_terms": "60 Del"
},
{
"id": 117,
"material_group_id": 6,
"specification": "AAC, Light Weight Block - 125mm x 200mm x 600mm",
"group": "Bricks",
"unit": "Piece",
"pay_terms": "60 Del"
},
...
]
Generate Building Material Price by State, Time Period, and Specification
API Endpoint
GET /internal/products/building-material-price
Headers
| Type | Value | Required |
|---|---|---|
| Accept | application/json | Yes |
| Authorization | Bearer {{access_token}} | Yes |
Request Guideline
There are two main modes controlled by the option parameter:
one– filter for selected material specifications onlytwo– ignorematerialsand return all material prices for a state/year
The example below shows a request with:
- Multiple selected material specifications
- Two states selected (Selangor and Sarawak - Sibu)
- Interval type
Three(duration between two month/year pairs)
{
"materials": [
{
"material_group": "Cement",
"selectedSpecs": [
{
"id": 188,
"material_group_id": 1,
"specification": "Hume Panda / Tasek Buaya, 50kg/bag",
"group": "Cement",
"unit": "Bag",
"pay_terms": "60 Del"
},
{
"id": 103,
"material_group_id": 1,
"specification": "Lafarge Walcrete, 50kg/bag",
"group": "Cement",
"unit": "Bag",
"pay_terms": "60 Del"
}
]
},
{
"material_group": "Aggregate",
"selectedSpecs": [
{
"id": 211,
"material_group_id": 2,
"specification": "Crusher run",
"group": "Aggregate",
"unit": "MT",
"pay_terms": "60 Del"
}
]
}
],
"selectedStates": [
{
"id": 13,
"name": "Selangor",
"code": "SGR"
},
{
"id": 18,
"name": "Sarawak - Sibu",
"code": "SWK_SBU"
}
],
"option": "one",
"interval": "Three",
"only_month": {
"month": "November",
"year": 2025
},
"between_month": {
"from": {
"month": "November",
"year": 2025
},
"and": {
"month": "November",
"year": 2025
}
},
"between_duration": {
"from": {
"month": "November",
"year": 2024
},
"to": {
"month": "November",
"year": 2025
}
},
"only_year": {
"year": 2025
}
}
Query Parameters
| Field | Type | Required | Description |
|---|---|---|---|
materials | array | Required if option = "one" | List of material groups and selected specifications to include. Ignored when option = "two". |
selectedStates | array | Yes | List of states to include in the result. Each entry must at least contain the state id. |
option | string | Yes | "one" for selected material only, "two" for all materials. |
interval | string | Yes | Controls the time range filter. One of: "One", "Two", "Three", "Four". |
only_month | object | Required if interval = "One" | Single month/year filter. |
between_month | object | Required if interval = "Two" | Two specific months/years. |
between_duration | object | Required if interval = "Three" | Continuous duration between two month/year combinations. |
only_year | object | Required if interval = "Four" | Single year filter. |
option field behaviour
| Value | Meaning |
|---|---|
"one" | Filter by the selected material specifications listed in materials[*].selectedSpecs. |
"two" | Ignore materials and return all material prices for the specified state and year. |
When option = "two", the API expects:
- At least one state in
selectedStates only_year.yearto be present
and will return a different, summarized structure for all groups/specifications in that state and year.
interval field behaviour
| Value | Behaviour |
|---|---|
"One" | Filter by a single month and year (only_month.month, only_month.year). |
"Two" | Filter by two specific months/years (between_month.from and between_month.and). Both month/year pairs are included. |
"Three" | Filter by a continuous duration between two month/year pairs (between_duration.from → between_duration.to). |
"Four" | Filter by a single year (only_year.year), including all published months for that year. |
Sample Request option = "one"
Example using option = "one" and interval = "Three":
curl --location \
--request GET 'https://n3c-api.cidb.gov.my/internal/products/building-material-price' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Content-Type: application/json' \
--json '{
"materials": [{
"material_group": "Cement",
"selectedSpecs": [
{
"id": 188,
"material_group_id": 1,
"specification": "Hume Panda / Tasek Buaya, 50kg/bag",
"group": "Cement",
"unit": "Bag",
"pay_terms": "60 Del"
},
{
"id": 103,
"material_group_id": 1,
"specification": "Lafarge Walcrete, 50kg/bag",
"group": "Cement",
"unit": "Bag",
"pay_terms": "60 Del"
}
],
},
{
"material_group": "Aggregate",
"selectedSpecs": [
{
"id": 211,
"material_group_id": 2,
"specification": "Crusher run",
"group": "Aggregate",
"unit": "MT",
"pay_terms": "60 Del"
}
],
}],
"selectedStates": [{
"id": 13,
"name": "Selangor",
"code": "SGR",
},
{
"id": 18,
"name": "Sarawak - Sibu",
"code": "SWK_SBU",
}],
"option": "one",
"interval": "Three",
"between_duration": {
"from": {
"month": "November",
"year": 2024
},
"to": {
"month": "November",
"year": 2025
}
},
}'
Sample Response option = "one"
The response for option = "one" is grouped by material specification and state:
- Top-level: array of material items
- For each material item:
material– material specification namestates– array of states and their time seriescode- material codegroup- material grouppay_terms- material pay termsunit- material unit
Each state contains:
name– state namemonth_year_rates– array of rate records per month/year
Each rate record contains:
month– short month (e.g.Jan-Dec)year– numeric yearaverage_price– average price of materialmonth_year– formatted label (Mon-YYYY)
[
{
"group": "Cement",
"pay_terms": "60 Del",
"material": "Hume Panda / Tasek Buaya, 50kg/bag",
"code": "1.4",
"unit": "Bag",
"states": [
{
"name": "Sarawak - Sibu",
"month_year_rates": [
{
"month": "Nov",
"year": 2024,
"average_price": 29.75,
"month_year": "Nov-2024"
},
{
"month": "Dec",
"year": 2024,
"average_price": 29.75,
"month_year": "Dec-2024"
},
{
"month": "Jan",
"year": 2025,
"average_price": 29.75,
"month_year": "Jan-2025"
},
{
"month": "Feb",
"year": 2025,
"average_price": 29.75,
"month_year": "Feb-2025"
},
...
]
},
{
"name": "Selangor",
"month_year_rates": [
{
"month": "Nov",
"year": 2024,
"average_price": 21.5,
"month_year": "Nov-2024"
},
{
"month": "Dec",
"year": 2024,
"average_price": 21.5,
"month_year": "Dec-2024"
},
{
"month": "Jan",
"year": 2025,
"average_price": 21.5,
"month_year": "Jan-2025"
},
...
]
}
]
},
{
"group": "Cement",
"pay_terms": "60 Del",
"material": "Lafarge Walcrete, 50kg/bag",
"code": "1.3",
"unit": "Bag",
"states": [
{
"name": "Sarawak - Sibu",
"month_year_rates": [
{
"month": "Nov",
"year": 2024,
"average_price": 0,
"month_year": "Nov-2024"
},
{
"month": "Dec",
"year": 2024,
"average_price": 0,
"month_year": "Dec-2024"
},
{
"month": "Jan",
"year": 2025,
"average_price": 0,
"month_year": "Jan-2025"
},
...
]
},
{
"name": "Selangor",
"month_year_rates": [
{
"month": "Nov",
"year": 2024,
"average_price": 0,
"month_year": "Nov-2024"
},
{
"month": "Dec",
"year": 2024,
"average_price": 0,
"month_year": "Dec-2024"
},
{
"month": "Jan",
"year": 2025,
"average_price": 0,
"month_year": "Jan-2025"
},
...
]
}
]
},
{
"group": "Aggregate",
"pay_terms": "60 Del",
"material": "Crusher run",
"code": null,
"unit": "MT",
"states": [
{
"name": "Sarawak - Sibu",
"month_year_rates": [
{
"month": "Jan",
"year": 2025,
"average_price": 0,
"month_year": "Jan-2025"
},
{
"month": "Feb",
"year": 2025,
"average_price": 0,
"month_year": "Feb-2025"
},
{
"month": "Mar",
"year": 2025,
"average_price": 0,
"month_year": "Mar-2025"
},
...
]
}
]
}
]
Sample Request option = "two"
Example using option = "two" and interval = "Four":
curl --location \
--request GET 'https://n3c-api.cidb.gov.my/internal/products/building-material-price' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {{access_token}}' \
--json '{
"selectedStates": [
{
"id": 13,
"name": "Selangor",
"code": "SGR",
"region_code": "C",
"region": "Peninsular Malaysia",
"region_id": 1,
...
}
],
"option": "two",
"interval": "Four",
"only_year": {
"year": 2025
}
}'
Sample Response option = "two"
For requests where option = "two", the API response is structured by all material specifications, filtered according to the specified state, and includes data exclusively for the given year:
- Top-level structure
state– detailed information about the selected stateyear– the selected yearmonths– list of available short months (e.g."Jan"-"Dec")data_months– metadata of published months for that state in that year- Includes fields such as:
id,month,year,status,sample, timestamps
- Includes fields such as:
data– grouped material dataset- Each material group contains:
name– material group name (e.g. "Cement")specifications– list of material specifications- Each specification contains month-based wage records:
-
code- material code -unit- material unit -pay_terms- material pay terms -specification- material specification name - Month key (Jan-Dec) with average price of material
- Each material group contains:
{
"state": {
"id": 13,
"name": "Selangor",
"code": "SGR",
"region_code": "C",
"region": "Peninsular Malaysia",
"region_id": 1,
...
},
"year": "2024",
"months": [
"Jan",
"Feb",
"Mar",
...
],
"data_months": [
{
"id": 4269,
"state_id": 13,
"month": "January",
"year": 2024,
"status": "Published",
"sample": 3,
...
},
{
"id": 4467,
"state_id": 13,
"month": "February",
"year": 2024,
"status": "Published",
"sample": 3,
...
},
{
"id": 4313,
"state_id": 13,
"month": "March",
"year": 2024,
"status": "Published",
"sample": 3,
...
},
...
],
"data": [
{
"name": "Cement",
"specifications": [
{
"code": "1.1",
"unit": "Bag",
"pay_terms": "60 Del",
"specification": "Ordinary Portland Cement, 50 kg bag",
"Jan": 20.4,
"Feb": 20.4,
"Mar": 20.4,
...
},
{
"code": "1.2",
"unit": "MT",
"pay_terms": "60 Del",
"specification": "Ordinary Portland Cement in Bulk",
"Jan": 380,
"Feb": 380,
"Mar": 380,
...
},
{
"code": "1.3",
"unit": "Bag",
"pay_terms": "60 Del",
"specification": "Lafarge Walcrete, 50kg/bag",
"Jan": 0,
"Feb": 0,
"Mar": 0,
...
},
]
},
...
]
}
