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.
POST https://shareyourhtml.com/pages with Content-Type: application/json.
{
"slug": "my-page",
"html": "<h1>Hello</h1>"
}
curl -X POST https://shareyourhtml.com/pages \
-H "Content-Type: application/json" \
-d '{"slug":"my-page","html":"<h1>Hello</h1>"}'
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());
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)
{
"slug": "my-page",
"url": "https://my-page.shareyourhtml.com",
"edit_key": "f1e2d3c4-b5a6-7890-1234-567890abcdef"
}
{
"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.