๐Ÿ” Projects API โ€“ Authenticated Access

The Projects API allows you to fetch your own project data from the platform using a secure API key. This is ideal for developers who want to integrate their projects into personal portfolios or other external applications.


๐Ÿš€ Getting Started

To use the authenticated endpoint, you need to:

  1. Generate an API key
  2. Make requests to the API with your key in the Authorization header

๐Ÿงพ Generate Your API Key

You can generate an API key from your user dashboard


๐Ÿ“ก Fetch Your Projects

GET /api/projects

๐Ÿ” Authorization Header

Authorization: Bearer YOUR_API_KEY

๐Ÿงฉ Query Parameters

NameTypeDescription
limitnumberHow many projects to fetch. Optional.
offsetnumberOffset for pagination. Optional, defaults to 0.
cachestringCan be none or private. Defaults to none.

๐Ÿงช Example Request

curl https://colearnspace.netlify.app/api/projects?limit=10&cache=private 
  -H "Authorization: Bearer sk_live_91bff1f8-5ad7-42ab-85f9-abc12345def6"

๐Ÿ›ก๏ธ Caching Behavior

You control the caching behavior using the cache query param:

ValueEffect
noneCache-Control: no-store โ€” no caching
privateCache-Control: private, max-age=60 โ€” browser-only 1 min cache

You cannot use public CDN caching for authenticated data.


โœ… Response Example

{
	"data": [
		{
			"id": "84e2dbb3-7124-44d5-a7b1-2145df2cebb4",
			"title": "AI-powered Budget Planner",
			"image": "https://colearnspace.netlify.app/projects/ai-budget.jpg",
			"links": [
				{
					"name": "GitHub",
					"url": "https://github.com/lethabomaepa11/budget-planner"
				},
				{
					"name": "Live Demo",
					"url": "https://budget-ai.netlify.app"
				}
			],
			"technologies": ["SvelteKit", "Supabase", "TailwindCSS", "OpenAI API"],
			"description": "A smart tool that helps users manage grocery budgets using AI to generate realistic shopping lists with average pricing.",
			"created_at": "2025-06-22T18:30:00.000Z",
			"rank": 12,
			"score": 98
		},
		{
			"id": "a029c5cd-1b3a-4d95-9d3a-d728e930b3a9",
			"title": "Campus RideShare App",
			"image": "https://colearnspace.netlify.app/projects/rideshare.jpg",
			"links": [
				{
					"name": "GitHub",
					"url": "https://github.com/lethabomaepa11/campus-rideshare"
				},
				{
					"name": "Live Demo",
					"url": "https://campus-taxi.netlify.app"
				}
			],
			"technologies": ["React Native", "Expo", "Leaflet.js", "Supabase"],
			"description": "An Uber-like app for public transport focused on campus routes with real-time taxi tracking and commuter security.",
			"created_at": "2025-06-15T10:00:00.000Z",
			"rank": 4,
			"score": 91
		}
	]
}

๐Ÿ” Fetch a Single Project by ID

GET /api/projects?id=PROJECT_ID

๐Ÿ” Authorization Header

Authorization: Bearer YOUR_API_KEY

๐Ÿงฉ Query Parameters

NameTypeDescription
idstringThe unique ID of the project.
cachestringnone or private. Optional.

โœ… Response Example (Single Project)

{
	"data": [
		{
			"id": "84e2dbb3-7124-44d5-a7b1-2145df2cebb4",
			"title": "AI-powered Budget Planner",
			"image": "https://colearnspace.netlify.app/projects/ai-budget.jpg",
			"links": [
				{
					"name": "GitHub",
					"url": "https://github.com/lethabomaepa11/budget-planner"
				},
				{
					"name": "Live Demo",
					"url": "https://budget-ai.netlify.app"
				}
			],
			"technologies": ["SvelteKit", "Supabase", "TailwindCSS", "OpenAI API"],
			"description": "A smart tool that helps users manage grocery budgets using AI to generate realistic shopping lists with average pricing.",
			"content": "<div><p>This is raw HTML from Trix editor...</p></div>",
			"created_at": "2025-06-22T18:30:00.000Z",
			"rank": 12,
			"score": 98
		}
	]
}

๐Ÿšซ Error Responses

StatusMessageWhen it Happens
401Unauthorized AccessNo or invalid API key
429Rate limit exceededToo many requests

๐Ÿ’ก Use Cases


๐Ÿง  Notes