Skip to content
L Legalize.pe

Search

Find a law, jump to a section, or run a command.

API

REST endpoints

Read-only access to commit history, diffs, and search. All endpoints return JSON. Public, no auth.

  • GET /api/normas/:id/history

    Returns the full commit history for a norm.

  • GET /api/normas/:id/at/:commit

    Returns the file content at a specific commit.

  • GET /api/normas/:id/diff?from=&to=

    Returns a unified diff between two commits.

  • GET /api/normas/:id/compare?from=&to=

    Returns a side-by-side comparison between two commits.

  • GET /api/og/:slug

    Generates an Open Graph image for a norm or page.

  • GET /api/search/smart?q=

    Smart search over the corpus index.

  • GET /feed.xml

    RSS feed of the latest norms.

Want a richer API? Clone the corpus repo and run any tool that reads git history. The whole API is just git log and git diff under the hood.