API Documentation

Integrate code preview functionality into your applications with our simple and powerful API

Authentication

Currently, the API is available for public use with rate limiting. Authentication will be required in future versions.

Note: API requests are limited to 100 requests per minute per IP address.

Render API

POST
https://codepeek.jobsum.works/api/render/upsert
Request Body
{
  {
    "content": "Your code here",
    "id": "Optional ID for updates"
  }
}
Response
{
  "success": true,
  "id": "generated-id",
  "url": "https://example.com/view/generated-id"
}

Parameters

Name Type Required Description
content string Required The code content to render (HTML, SVG, or Mermaid)
id string Optional Existing render ID to update
Example
fetch('https://codepeek.jobsum.works/api/render/upsert', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    content: '

Hello World

' }) }) .then(response => response.json()) .then(data => console.log(data));

Status Codes

Code Description
200 Successfully created or updated render
400 Content is required
500 Internal server error