Magzdown URL Scheme

AI agents and developer tools can open markdown content directly in Magzdown by constructing a URL with base64-encoded markdown. The recipient clicks the link (or the agent opens it automatically) and the content is rendered immediately — no account required, no data sent to any server.

URL Format

https://magzdown.com/open?md={base64_encoded_markdown}
ParameterRequiredDescription
mdYesURL-safe base64-encoded markdown content. Use standard base64 with + replaced by -, / replaced by _, and trailing = padding removed.

Encoding

The payload uses a versioned format for forward compatibility. Construct it as follows:

  1. Prepend two bytes: [0x01, 0x00] before the UTF-8 markdown bytes (version byte + reserved byte)
  2. Base64-encode the combined payload
  3. Replace + with -, / with _, and remove trailing = padding

Size Limits

Recommended maximum: ~100 KB of markdown (~135 KB encoded). URLs exceeding browser or server limits may be silently truncated, resulting in corrupted content.

Code Examples

function openInMagzdown(markdown) {
  const bytes = new TextEncoder().encode(markdown);
  const payload = new Uint8Array(2 + bytes.length);
  payload[0] = 0x01; // version
  payload[1] = 0x00; // reserved
  payload.set(bytes, 2);
  const binary = Array.from(payload, (b) => String.fromCharCode(b)).join("");
  const encoded = btoa(binary)
    .replace(/\+/g, "-")
    .replace(/\//g, "_")
    .replace(/=+$/, "");
  const url = `https://magzdown.com/open?md=${encoded}`;
  window.open(url, "_blank");
}

Try It

Integration Notes

Content is processed entirely client-side — no data is sent to any server. Articles opened via /open are saved to the user's local browser storage with source tag "agent", making them easy to identify in the library. The URL scheme is compatible with any tool that can construct URLs and open a browser tab.