Templates API
Endpoints for browsing and downloading project templates.
List Templates
GET /api/templatesReturns templates filtered by the caller’s tier. Free-tier users only see free templates. Pro users see free and pro templates.
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
category | string | Filter by category (optional) |
Response:
{
"templates": [
{
"id": 1,
"slug": "simple-erc20-token",
"title": "Simple ERC-20 Token",
"description": "A standard ERC-20 token with mint, burn, and pause",
"category": "token-tools",
"tier": "free",
"tags": ["erc20", "token", "solidity"]
}
]
}List Categories
GET /api/templates/categoriesReturns all template categories.
Response:
{
"categories": ["defi-dex", "token-tools", "nfts-games", "launch-token-sales", "templates-clones"]
}Get Template
GET /api/templates/:idReturns a single template by ID or slug.
Response:
{
"template": {
"id": 1,
"slug": "simple-erc20-token",
"title": "Simple ERC-20 Token",
"description": "...",
"category": "token-tools",
"tier": "free",
"tags": ["erc20", "token", "solidity"],
"parameters": [],
"created_at": "2026-01-15T00:00:00.000Z",
"download_count": 1234
}
}Returns 404 if the template is not found.
Download Template
GET /api/templates/:id/downloadReturns a download URL for the template zip file.
Free templates can be downloaded by any authenticated user. Non-free templates require the user to have purchased the template on the marketplace.
Response (success):
{
"url": "https://api.web3.market/downloads/templates/1.zip",
"filename": "simple-erc20-token.zip"
}Response (not purchased):
{
"error": {
"code": "NOT_PURCHASED",
"message": "You must purchase this template before downloading."
}
}Status code: 403
If the purchase verification service is unavailable, the endpoint returns 503 with code PURCHASE_CHECK_FAILED.