API文档

通过REST API以编程方式访问材料数据。

快速开始

MaterialRegistry API免费使用,公共接口无需认证。

curl "https://api.materialregistry.com/api/v1/materials?q=304"

基础URL

https://api.materialregistry.com

接口端点

GET /api/v1/materials

Search materials

参数

NameTypeDescription
qstringSearch query (e.g., "304", "1.4301")
categorystringFilter by category
limitnumberResults per page (default: 20)
offsetnumberPagination offset

示例

curl "https://api.materialregistry.com/api/v1/materials?q=304"
GET /api/v1/materials/:slug

Get material by slug

示例

curl "https://api.materialregistry.com/api/v1/materials/stainless-steel-304"
GET /api/v1/materials/:slug/equivalents

Get standard equivalents for a material

示例

curl "https://api.materialregistry.com/api/v1/materials/stainless-steel-304/equivalents"
GET /api/v1/search/suggest

Get search suggestions (autocomplete)

参数

NameTypeDescription
qstringSearch query (min 2 characters)
limitnumberMax suggestions (default: 10)

示例

curl "https://api.materialregistry.com/api/v1/search/suggest?q=304"
GET /api/v1/categories

List all material categories

示例

curl "https://api.materialregistry.com/api/v1/categories"
GET /api/v1/standards

List all supported standards

示例

curl "https://api.materialregistry.com/api/v1/standards"

响应格式

所有响应以JSON格式返回,结构如下:

// Success
{
  "success": true,
  "data": { ... }
}

// Error
{
  "success": false,
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message"
  }
}

速率限制

公共API限制为每个IP地址每分钟100次请求。如果您的应用程序需要更高的限额,请联系我们。