Get Project List
Get list of all published projects, with pagination and filtering support.
Interface Information
- Endpoint:
GET /api/projects - Authentication: Not required (public interface)
- Content-Type:
application/json
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| page | number | No | Page number, default 1 |
| limit | number | No | Items per page, default 10 |
| category | number | No | Category ID filter |
| status | string | No | Status filter: published/draft |
Response Fields
| Field Name | Type | Description |
|---|---|---|
| data | array | Project list |
| total | number | Total records |
| page | number | Current page number |
| limit | number | Items per page |
| totalPages | number | Total pages |
Project Fields
| Field Name | Type | Description |
|---|---|---|
| id | number | Project ID |
| title | string | Project title |
| description | string | Project description |
| coverImage | string | Cover image URL |
| demoUrl | string | Demo link |
| repoUrl | string | Code repository link |
| techStack | array | Technology stack tags |
| likeCount | number | Like count |
| viewCount | number | View count |
| status | string | Status: published/draft |
| createdAt | string | Creation time |
Request Examples
bash
# Get first page
curl http://localhost:3000/api/projects
# Get page 2, 20 per page
curl http://localhost:3000/api/projects?page=2&limit=20
# Filter by category
curl http://localhost:3000/api/projects?category=1Response Example
json
{
"success": true,
"data": [
{
"id": 1,
"title": "Personal Blog System",
"description": "Modern blog system based on Nuxt.js 3",
"coverImage": "https://example.com/project1.jpg",
"demoUrl": "https://demo.example.com",
"repoUrl": "https://github.com/user/blog",
"techStack": ["Nuxt.js", "TypeScript", "Tailwind CSS"],
"likeCount": 45,
"viewCount": 230,
"status": "published",
"createdAt": "2024-01-15T10:00:00.000Z"
}
],
"total": 100,
"page": 1,
"limit": 10,
"totalPages": 10
}Error Responses
| HTTP Status Code | Description |
|---|---|
| 400 | Parameter error |
| 500 | Server error |