API Documentation

Substrata serves structured building product specification data via a REST API. No authentication required during beta. All responses are JSON.

Base URL: https://substrata-34wm.polsia.app/v1

Products

GET /v1/products

Returns a paginated list of building products. Supports full-text search, filtering by category/manufacturer/performance specs, and sorting.

Query Parameters

ParameterDescriptionExample
qFull-text searchq=triple+pane
categoryProduct categorywindows, doors, insulation
subcategorySubcategorycasement, entry, spray-foam
manufacturerManufacturer (partial, case-insensitive)andersen
min_u_valueMin thermal transmittance0.15
max_u_valueMax thermal transmittance0.25
min_r_valueMin thermal resistance15
max_r_valueMax thermal resistance30
min_shgcMin solar heat gain coefficient0.20
max_shgcMax solar heat gain coefficient0.30
energy_starENERGY STAR filtertrue
min_priceMin price (USD)100
max_priceMax price (USD)1000
frame_materialFrame material (partial match)vinyl
glazing_typeGlazing type (partial match)triple
core_materialCore material (partial match)polyurethane
sortSort fieldname, u_value, price_min_usd
orderSort directionasc, desc
pagePage number (default: 1)2
limitResults per page (max: 100, default: 20)10

Example Request

curl "https://substrata-34wm.polsia.app/v1/products?category=windows&energy_star=true&max_u_value=0.25&limit=3"

Response

{
  "data": [
    {
      "id": 6,
      "name": "Andersen E-Series Triple Pane Casement",
      "slug": "andersen-e-series-triple-casement",
      "manufacturer": "Andersen",
      "category": "windows",
      "subcategory": "casement",
      "description": "Premium architectural-grade casement...",
      "width_mm": 762,
      "height_mm": 1524,
      "u_value": "0.170",
      "shgc": "0.190",
      "vt": "0.330",
      "stc_rating": 37,
      "frame_material": "Wood/Aluminum",
      "glazing_type": "Triple Low-E",
      "price_min_usd": "1200.00",
      "price_max_usd": "2400.00",
      "warranty_years": 20,
      "energy_star": true,
      "certifications": ["ENERGY STAR","NFRC","AAMA","PHI"],
      "model_number": "AE-TC3060"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 3,
    "total": 7,
    "total_pages": 3,
    "has_next": true,
    "has_prev": false
  },
  "filters_applied": {
    "category": "windows",
    "energy_star": "true",
    "max_u_value": "0.25"
  }
}
GET /v1/products/:slug

Returns a single product by its URL slug. Returns 404 if not found.

Example

curl "https://substrata-34wm.polsia.app/v1/products/andersen-400-casement"

Response

{
  "data": {
    "id": 2,
    "name": "Andersen 400 Series Casement Window",
    "slug": "andersen-400-casement",
    "manufacturer": "Andersen",
    ...all product fields
  }
}

Categories

GET /v1/categories

Returns all product categories with subcategories and product counts.

curl "https://substrata-34wm.polsia.app/v1/categories"
{
  "data": [
    {
      "category": "doors",
      "product_count": "16",
      "subcategories": ["entry","patio","multi-slide","garage","interior","folding"]
    },
    {
      "category": "insulation",
      "product_count": "18",
      "subcategories": ["fiberglass-batt","mineral-wool","rigid-board","blown-in","spray-foam",...]
    },
    {
      "category": "windows",
      "product_count": "19",
      "subcategories": ["double-hung","casement","awning","sliding","picture",...]
    }
  ]
}

Manufacturers

GET /v1/manufacturers

Returns all manufacturers with product counts and which categories they produce.

curl "https://substrata-34wm.polsia.app/v1/manufacturers"
{
  "data": [
    {
      "manufacturer": "Andersen",
      "product_count": "4",
      "categories": ["windows","doors"]
    },
    {
      "manufacturer": "Owens Corning",
      "product_count": "3",
      "categories": ["insulation"]
    },
    ...
  ]
}

Statistics

GET /v1/stats

Returns aggregate statistics about the product database.

{
  "data": {
    "total_products": "53",
    "total_manufacturers": "35",
    "total_categories": "3",
    "energy_star_products": "26",
    "avg_u_value": "0.259",
    "avg_r_value": "13.40",
    "avg_price_min": "919.41",
    "avg_price_max": "2781.80"
  }
}

Product Schema

Every product in the database has the following fields. Null values indicate data not applicable to that product type.

FieldTypeDescription
idintegerUnique ID
namestringProduct name
slugstringURL-safe identifier
manufacturerstringManufacturer name
categorystringwindows, doors, insulation
subcategorystringProduct subcategory
descriptionstringProduct description
width_mmintegerWidth in millimeters
height_mmintegerHeight in millimeters
depth_mmintegerDepth in millimeters
thickness_mmnumericThickness in millimeters
weight_kgnumericWeight in kilograms
u_valuenumericThermal transmittance (W/m²K)
r_valuenumericThermal resistance (m²K/W)
shgcnumericSolar Heat Gain Coefficient
vtnumericVisible Transmittance
stc_ratingintegerSound Transmission Class
fire_ratingstringFire resistance rating
wind_load_paintegerWind load (Pascals)
air_leakagenumericAir leakage rate (L/s/m²)
frame_materialstringFrame material
glazing_typestringGlazing type
core_materialstringCore/insulation material
finishstringSurface finish
price_min_usdnumericMinimum price (USD)
price_max_usdnumericMaximum price (USD)
warranty_yearsintegerWarranty period
energy_starbooleanENERGY STAR certified
certificationsarrayList of certifications
model_numberstringManufacturer model number