Skip to main content

Data Model

This page describes the public data model used in the Product API, defining the core data structures and their attributes.

Request Example

curl -X GET 'https://www.realpore.com/api/products/{sub-api}' \
-H 'x-api-key: YOUR_API_KEY_HERE'

Request Parameters

type QueryParams {
q?: string; // Search by product code or TNB product code (optional)
page?: number; // Current page number, starting from 1
page_size?: number; // Number of items per page, maximum value is 100
}

Response Data

type Response {
data: ProductInfo[],
pagination: Pagination,
}

type ProductInfo = {
id: number;
itemcode: string; // Product code
itemname: string; // Product name
tnb?: string; // TNB code
category_img: UrlString; // Category image URL
attributes: Record<string, string>; // Attribute key-value pairs

attribute_desc: Record<string, {
label: string; // Attribute display label
drawing_field: string; // Corresponding drawing field
deviation: string; // Deviation description
}>;

attachments: {
drawing: UrlString; // Drawing file URL
rohs: UrlString; // RoHS file URL
msds: UrlString; // MSDS file URL
};
}

type Pagination = {
total: number;
page: number;
page_size: number;
total_pages: number;
}