Legalize Stats API

The Stats API from Legalize — 1 operation(s) for stats.

GitHub OpenAPI

Operations 1

GET /api/v1/{country}/stats Api Stats #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/legalize-dev:legalize-dev-stats-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

legalize-dev-stats-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Legalize Stats API
  description: Open legislation API. Every law as structured data, every reform as a diff.
  version: 0.18.0
tags:
- name: Stats
paths:
  /api/v1/{country}/stats:
    get:
      tags:
      - Stats
      summary: Api Stats
      description: 'Get aggregate statistics: reform activity by year, most reformed laws, and law types.'
      operationId: api_stats_api_v1__country__stats_get
      security:
      - ApiKeyAuth: []
      parameters:
      - name: country
        in: path
        required: true
        schema:
          type: string
          title: Country
      - name: jurisdiction
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Scope the statistics to one jurisdiction code, or 'national' for the laws that carry no jurisdiction at all (the national corpus).
          title: Jurisdiction
        description: Scope the statistics to one jurisdiction code, or 'national' for the laws that carry no jurisdiction at all (the national corpus).
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatsResponse'
            application/xml:
              schema:
                $ref: '#/components/schemas/StatsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
            application/xml:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '401':
          description: Missing, malformed, or invalid API key
        '429':
          description: Monthly quota exceeded. Includes Retry-After header.
components:
  schemas:
    ArticleCoverage:
      properties:
        laws_with_articles:
          type: integer
          title: Laws With Articles
        laws_total:
          type: integer
          title: Laws Total
        articles_total:
          type: integer
          title: Articles Total
      type: object
      required:
      - laws_with_articles
      - laws_total
      - articles_total
      title: ArticleCoverage
      description: 'How much of a corpus is broken down into articles.


        ``article_count: 0`` on a law is ambiguous — it can mean the law has no

        articles, or that nobody ever broke it down — and a caller only finds out

        the hard way, by asking for one article and getting the whole document.

        This is the same question asked of a whole corpus, before that happens.'
    StatsResponse:
      properties:
        country:
          type: string
          title: Country
        jurisdiction:
          anyOf:
          - type: string
          - type: 'null'
          title: Jurisdiction
        reform_activity_by_year:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Reform Activity By Year
        most_reformed_laws:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Most Reformed Laws
        law_types:
          items:
            type: string
          type: array
          title: Law Types
        article_coverage:
          anyOf:
          - $ref: '#/components/schemas/ArticleCoverage'
          - type: 'null'
      type: object
      required:
      - country
      - reform_activity_by_year
      - most_reformed_laws
      - law_types
      title: StatsResponse
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Bearer token. Get one for free at https://legalize.dev/api — no credit card, 2,000 calls/month on Free. Format: `Bearer leg_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`'