List and filter parts
Retrieve a paginated list of parts/components. Search by part name, number, or revision number.
API v2 Preview
The TofuPilot API v2.0 is currently in public preview and is subject to change as we stabilize until release (planned for Aug 2025).
Access
API Key | Access Level | Description |
---|---|---|
User | Full | Users can list parts |
Station | Full | Stations can list parts |
Endpoint
/v2/parts
API key for authentication. Use format: Bearer YOUR_API_KEY
In: header
Query Parameters
Maximum number of parts to return in a single page.
50
1 <= value <= 100
Offset position for pagination. Use the next_cursor from the previous response to get the next page.
Search text to filter parts by name, part number, or revision number.
length <= 100
Field to sort results by.
"created_at"
"name" | "number" | "created_at"
Sort order direction.
"desc"
"asc" | "desc"
Response Body
from tofupilot.v2 import TofuPilot
# Initialize the TofuPilot client
client = TofuPilot()
# Execute the operation
result = client.parts.list(
limit=50,
cursor=50,
search_query="PCB",
sort_by="created_at",
sort_order="desc"
)
# Handle response
print(result)
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"number": "PCB-V2.0",
"name": "Main PCB Board",
"created_at": "2019-08-24T14:15:22Z",
"revisions": [
{
"id": "550e8400-e29b-41d4-a716-446655440001",
"number": "REV-A",
"image": "https://example.com/revision-image.jpg"
}
]
}
],
"meta": {
"has_more": true,
"next_cursor": 50
}
}
{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}
How is this guide?
Get part GET
Retrieve a single part by its part number. Returns comprehensive part data including all revisions.
Update part PATCH
Update part number and/or name. The current part number is specified in the URL path. Part numbers are matched case-insensitively (e.g., "PART-001" and "part-001" are considered the same).