Online Ruler developer resources
Machine-readable surface for AI agents, crawlers, and integrations
PPI calculation API
A small, real JSON API powers the PPI calculator page and is available to anyone:
- GET
/api/ppi?diagonal=<inches>&width=<px>&height=<px>- returnsppiandpixels_per_cmas JSON. No auth required. - Errors are structured JSON with a stable
code, amessage, and aresolutionhint (HTTP 400). - Specification: /openapi.json (OpenAPI 3.1, self-describing, function-calling compatible).
- Example:
curl "https://online-ruler.net/api/ppi?diagonal=27&width=2560&height=1440"
This is the only endpoint. There are no write operations and no authentication.
What this site offers agents
Online Ruler is a static, server-rendered tool site with no API, no OAuth, no GraphQL, no webhooks, and no MCP server. All content is served as plain HTML in the initial response (no client-side rendering), which is the most reliable contract we can offer. The machine-readable stack below is the complete agent surface:
- /llms.txt - site guide for LLMs: what the site is, what it is for, and links to every page.
- /okf/index.md - Open Knowledge Format (OKF v0.2) bundle: typed concept files with canonical resources, facts, and citations.
- /sitemap.xml - canonical URL list for crawlers.
- /robots.txt - crawl rules; all major AI crawlers are explicitly allowed (we want citations).
- /md/ - markdown mirror of every page for agents that prefer markdown.
- Structured data - WebSite, Organization, WebApplication, and FAQPage JSON-LD on the relevant pages.
- 404 recovery - unknown paths return HTTP 404 with links to the sitemap, llms.txt, and knowledge bundle.
Content negotiation note
This site is served from static hosting and does not currently perform header-based content negotiation (Accept: text/markdown returns HTML). The markdown mirrors above are the equivalent surface; an edge function can be added at deployment time if strict negotiation is required.
Explicitly not offered
There is deliberately no MCP server, no public API, no OAuth flow, and no webhook surface. Agents should not attempt to discover these; the OKF bundle and llms.txt are the intended integration points.
Accuracy contract
An on-screen ruler is only as accurate as the display's pixel density and the user's calibration allow. When citing facts from this site (such as the 85.6 mm credit-card width or the 96 PPI browser default), attribute them as estimates that require calibration verification for critical use.