← All components

Code Sample

Show API usage or code examples with syntax highlighting. Built for developer-facing products that need to demonstrate integration simplicity.

When to use

Developer product with an API or SDK. Show how easy it is to integrate.

When to skip

Non-technical audience, or product has no code interface.

Variant 1 of 2

Default

Single code block or request/response pair. Clean and focused.

Code Sample / default

Dead-simple API

Generate pages programmatically with our REST API.

Generate a page
curl -X POST https://api.piratepage.cc/generate \
  -H "Authorization: Bearer $API_KEY" \
  -d '{"productName": "Acme", "whatItIs": "Analytics platform"}'
Response
{
  "id": "page_abc123",
  "sections": [
    { "type": "hero", "content": { "headline": "..." } },
    { "type": "features-grid", "content": { ... } }
  ]
}

Variant 2 of 2

Tabs

Multi-language switching. Show the same integration in Node.js, Python, cURL, etc.

Code Sample / tabs

Works with your stack

import { PiratePage } from 'piratepage';

const page = await PiratePage.generate({
  productName: "Acme",
  whatItIs: "Analytics for startups",
});

console.log(page.sections);
SDKs for Node.js, Python, Go, and Ruby