> ## Documentation Index
> Fetch the complete documentation index at: https://docs.law4devs.eu/llms.txt
> Use this file to discover all available pages before exploring further.

# Compare articles across multiple frameworks

> Returns articles grouped by framework slug for side-by-side comparison.
Accepts a comma-separated list of framework slugs. Optionally filter
articles by tag to focus the comparison on a specific topic.




## OpenAPI

````yaml /openapi.yaml get /compare
openapi: 3.0.3
info:
  title: Law4Devs API
  version: 1.0.0
  description: >
    Structured EU regulatory compliance data for developers.


    All 19 major EU digital regulations — CRA, NIS2, DORA, GDPR, AI Act, eIDAS,

    DSA, DMA, Data Act, DGA, eIDAS2, CER, PSD2, MiCA, Cybersecurity Act,

    ePrivacy, RED, CSRD, NIS1 — parsed into structured articles, recitals,

    requirements, compliance deadlines, and tags.


    ## Response Conventions


    - **List responses** (paginated): `{ data: [...], meta: { api_version,
    total, page, per_page, pages }, links: { next, prev } }`

    - **List responses** (non-paginated): `{ data: [...], meta: { api_version,
    total } }`

    - **Detail responses**: `{ data: { ... } }`

    - **Error responses**: `{ error: { code: "ERROR_CODE", message:
    "Human-readable message" } }`


    ## Pagination


    All list endpoints accept `page` (≥ 1, default 1) and `per_page` (1–100,
    default 20).

    Invalid values return `400 INVALID_PARAM`.
servers:
  - url: https://demo.law4devs.eu/api/v1
    description: Demo (CRA only, no key required)
security: []
tags:
  - name: Health
    description: API and database health check
  - name: Frameworks
    description: EU regulatory frameworks (CRA, NIS2, GDPR, etc.)
  - name: Articles
    description: Individual articles within a framework
  - name: Recitals
    description: Recitals (preamble paragraphs) within a framework
  - name: Requirements
    description: Extracted compliance requirements with stakeholder role mappings
  - name: Annexes
    description: Technical annexes attached to a framework
  - name: Compliance
    description: Compliance deadlines and key dates
  - name: Stats
    description: Coverage statistics per framework
  - name: Search
    description: Full-text search across articles, recitals, and requirements
  - name: Tags
    description: Semantic tags used to classify content
  - name: Changelog
    description: Content update history and data freshness
  - name: Compare
    description: Cross-framework article comparison
paths:
  /compare:
    get:
      tags:
        - Compare
      summary: Compare articles across multiple frameworks
      description: |
        Returns articles grouped by framework slug for side-by-side comparison.
        Accepts a comma-separated list of framework slugs. Optionally filter
        articles by tag to focus the comparison on a specific topic.
      operationId: compare_frameworks
      parameters:
        - name: frameworks
          in: query
          required: true
          description: Comma-separated list of framework slugs (max 5 recommended)
          schema:
            type: string
            example: cra,nis2,gdpr
        - name: tag
          in: query
          description: Filter articles to those with this tag slug
          schema:
            type: string
            example: risk-assessment
      responses:
        '200':
          description: Articles and requirements grouped by framework
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      frameworks:
                        type: object
                        description: Map of framework slug to its articles and requirements
                        additionalProperties:
                          type: object
                          properties:
                            framework_name:
                              type: string
                              example: Cyber Resilience Act
                            articles:
                              type: array
                              items:
                                type: object
                                properties:
                                  article_number:
                                    type: integer
                                    example: 1
                                  title:
                                    type: string
                                    example: Subject matter
                            requirements:
                              type: array
                              items:
                                $ref: '#/components/schemas/Requirement'
                      tag:
                        description: The tag used to filter, if `tag` param was provided
                        nullable: true
                        allOf:
                          - $ref: '#/components/schemas/Tag'
                  meta:
                    type: object
                    properties:
                      api_version:
                        type: string
                        example: '1.0'
        '404':
          description: One or more framework slugs not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Requirement:
      type: object
      properties:
        id:
          type: integer
          example: 1
        article_number:
          type: integer
          example: 2
        paragraph_ref:
          type: string
          nullable: true
          example: '1'
        requirement_text:
          type: string
          description: The full text of the requirement
        requirement_type:
          type: string
          enum:
            - general
            - mandatory
            - conditional
            - prohibition
          example: general
        stakeholder_roles:
          type: array
          items:
            type: string
          example:
            - manufacturer
            - importer
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagRef'
        compliance_deadline:
          type: string
          nullable: true
        linked_article_numbers:
          type: array
          items:
            type: integer
          example:
            - 3
            - 5
            - 14
        paragraph_content:
          type: string
          nullable: true
          description: First 300 characters of the source paragraph (for context)
        created_at:
          type: string
          format: date-time
        framework_slug:
          type: string
          example: cra
    Tag:
      type: object
      properties:
        id:
          type: integer
          example: 1
        slug:
          type: string
          example: vulnerability-reporting
        name:
          type: string
          example: Vulnerability Reporting
        description:
          type: string
          example: >-
            Requirements related to disclosing and reporting software
            vulnerabilities.
        keywords:
          type: array
          items:
            type: string
          example:
            - vulnerability
            - CVE
            - disclose
            - disclosure
        color:
          type: string
          example: '#e74c3c'
        created_at:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Machine-readable error code
              example: NOT_FOUND
            message:
              type: string
              description: Human-readable error description
              example: Framework 'xyz' not found.
    TagRef:
      type: object
      description: Minimal tag reference embedded inside articles and requirements
      properties:
        slug:
          type: string
          example: vulnerability-reporting
        name:
          type: string
          example: Vulnerability Reporting
        color:
          type: string
          example: '#e74c3c'

````