ShareYourHTML.com

JSON API

shareyourhtml has a tiny JSON API so you can create pages from any tool that can make an HTTP request — including LLMs with tool-use capabilities. The endpoint mirrors the upload form exactly: one slug, one HTML blob, out comes a public URL and an edit key.

Create a page

POST https://shareyourhtml.com/pages with Content-Type: application/json.

{
  "slug": "my-page",
  "html": "<h1>Hello</h1>"
}

curl

curl -X POST https://shareyourhtml.com/pages \
  -H "Content-Type: application/json" \
  -d '{"slug":"my-page","html":"<h1>Hello</h1>"}'

fetch (JavaScript)

await fetch("https://shareyourhtml.com/pages", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    slug: "my-page",
    html: "<h1>Hello</h1>"
  })
}).then(r => r.json());

Ruby (Net::HTTP)

require "net/http"
require "json"

uri = URI("https://shareyourhtml.com/pages")
res = Net::HTTP.post(
  uri,
  { slug: "my-page", html: "<h1>Hello</h1>" }.to_json,
  "Content-Type" => "application/json"
)
JSON.parse(res.body)

Success response (201 Created)

{
  "slug": "my-page",
  "url": "https://my-page.shareyourhtml.com",
  "edit_key": "f1e2d3c4-b5a6-7890-1234-567890abcdef"
}

What you get back

Save the edit_key. It is the only way to edit or delete the page. We cannot recover it for you.

Error response (422 Unprocessable Entity)

{
  "errors": {
    "base": ["slug has already been taken"]
  }
}

Validation errors (slug taken, slug format, empty body, content too large) all come back as 422 with an errors object.