Sparepart API Documentation
Access comprehensive data for 14,000+ computer components including CPUs, GPUs, Memory, Motherboards, Cases, Coolers, PSUs, and Storage devices.
https://partcomp.ruang.app
Authentication
The API uses two authentication methods:
JWT Token
Used for account management operations like creating and managing API keys.
Authorization: Bearer <token>
API Key
Used for accessing component data. Get your key from the dashboard.
X-API-Key: sk_your_key_here
Quick Start Guide
Get up and running in 3 simple steps:
Create an Account
{
"email": "your@email.com",
"password": "yourpassword",
"name": "Your Name"
}
Login & Get Token
{
"email": "your@email.com",
"password": "yourpassword"
}
// Response
{
"token": "eyJhbGciOiJIUzI1NiIs...",
"user": { "id": 1, "name": "Your Name" }
}
Create API Key & Access Data
// Request
{ "name": "My Application" }
// Response
{
"apiKey": {
"key": "sk_abc123def456...",
"name": "My Application"
}
}
curl -H "X-API-Key: sk_abc123..." \
https://partcomp.ruang.app/api/cpu
Register User
Create a new user account.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Valid email address |
password | string | Yes | Min 6 characters |
name | string | Yes | Display name |
Response
{
"message": "User registered successfully",
"user": {
"id": 1,
"email": "user@example.com",
"name": "John Doe"
}
}
Login
Authenticate and receive a JWT token valid for 24 hours.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Registered email |
password | string | Yes | Account password |
Response
{
"message": "Login successful",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": {
"id": 1,
"email": "user@example.com",
"name": "John Doe"
}
}
Create API Key
Generate a new API key. Store it securely - it's only shown once!
Headers
| Header | Value |
|---|---|
Authorization | Bearer YOUR_JWT_TOKEN |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Key identifier |
List API Keys
List all API keys for your account. Keys are masked for security.
Delete API Key
Revoke an API key. The key will stop working immediately.
Get All Components
Retrieve paginated list of components. Replace {component} with:
cpu, gpu, memory, motherboard,
case, cooler, psu, or storage.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number |
limit | integer | 20 | Items per page (max 100) |
Example
curl -H "X-API-Key: sk_your_key" \
"https://partcomp.ruang.app/api/cpu?page=1&limit=5"
{
"data": [
{
"id": 1,
"partType": "cpu",
"name": "Intel Core i9-14900K",
"brand": "Intel",
"socket": "LGA 1700",
"speed": 6.0,
"coreCount": 24,
"threadCount": 32,
"power": 125
}
],
"pagination": {
"page": 1,
"limit": 5,
"total": 458,
"totalPages": 92
}
}
Get Single Component
Retrieve a single component by its ID.
Example
curl -H "X-API-Key: sk_your_key" \
"https://partcomp.ruang.app/api/gpu/42"
Search Components
Search components by name (case-insensitive partial match).
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
q | string | Yes | Search keyword |
limit | integer | No | Max results (default 20) |
Example
curl -H "X-API-Key: sk_your_key" \
"https://partcomp.ruang.app/api/gpu/search?q=RTX%204090"
CPU Schema
| Field | Type | Description |
|---|---|---|
id | integer | Unique identifier |
partType | string | Always "cpu" |
name | string | Full product name |
brand | string | Intel or AMD |
socket | string | Socket type (LGA 1700, AM5, etc.) |
speed | number | Base clock speed in GHz |
coreCount | integer | Number of cores |
threadCount | integer | Number of threads |
power | integer | TDP in watts |
GPU Schema
| Field | Type | Description |
|---|---|---|
id | integer | Unique identifier |
partType | string | Always "gpu" |
name | string | Full product name |
brand | string | NVIDIA, AMD, or Intel |
vram | integer | Video memory in GB |
resolution | string | Target resolution |
power | integer | TDP in watts |
Memory Schema
| Field | Type | Description |
|---|---|---|
id | integer | Unique identifier |
partType | string | Always "memory" |
name | string | Full product name |
type | string | DDR4, DDR5, etc. |
size | string | Capacity (16GB, 32GB, etc.) |
Motherboard Schema
| Field | Type | Description |
|---|---|---|
id | integer | Unique identifier |
partType | string | Always "motherboard" |
name | string | Full product name |
brand | string | Manufacturer |
socket | string | CPU socket type |
size | string | Form factor (ATX, mATX, ITX) |
Case Schema
| Field | Type | Description |
|---|---|---|
id | integer | Unique identifier |
partType | string | Always "case" |
name | string | Full product name |
size | string | Supported form factors |
Cooler Schema
| Field | Type | Description |
|---|---|---|
id | integer | Unique identifier |
partType | string | Always "cooler" |
name | string | Full product name |
type | string | Air or Liquid |
PSU Schema
| Field | Type | Description |
|---|---|---|
id | integer | Unique identifier |
partType | string | Always "psu" |
name | string | Full product name |
power | integer | Wattage |
size | string | Form factor (ATX, SFX) |
Storage Schema
| Field | Type | Description |
|---|---|---|
id | integer | Unique identifier |
partType | string | Always "storage" |
name | string | Full product name |
type | string | SSD, HDD, or NVMe |
space | string | Storage capacity |
Ready to Start Building?
Create your free account and get your API key in seconds.
Get Your API Key →