> ## 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.

# Full-text search across articles, recitals, and requirements

> Searches article titles and content, recital content, and requirement
text across all active frameworks. Returns ranked results with context
snippets. Supports filtering by framework, tag, stakeholder role,
and result type.

Query must be at least 2 characters and at most 500 characters.




## OpenAPI

````yaml /openapi.yaml get /search
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:
  /search:
    get:
      tags:
        - Search
      summary: Full-text search across articles, recitals, and requirements
      description: |
        Searches article titles and content, recital content, and requirement
        text across all active frameworks. Returns ranked results with context
        snippets. Supports filtering by framework, tag, stakeholder role,
        and result type.

        Query must be at least 2 characters and at most 500 characters.
      operationId: search
      parameters:
        - name: q
          in: query
          required: true
          description: Search query (2–500 characters)
          schema:
            type: string
            minLength: 2
            maxLength: 500
            example: cybersecurity requirements
        - name: framework
          in: query
          description: Limit search to one framework slug
          schema:
            type: string
            example: cra
        - name: tag
          in: query
          description: Filter results to those with this tag slug
          schema:
            type: string
            example: risk-assessment
        - name: role
          in: query
          description: Filter requirements by stakeholder role
          schema:
            type: string
            example: manufacturer
        - name: type
          in: query
          description: Limit to one result type
          schema:
            type: string
            enum:
              - article
              - recital
              - requirement
        - $ref: '#/components/parameters/PageParam'
        - $ref: '#/components/parameters/PerPageParam'
      responses:
        '200':
          description: Search results with facets
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/SearchResult'
                  meta:
                    type: object
                    properties:
                      api_version:
                        type: string
                        example: '1.0'
                      total:
                        type: integer
                        example: 159
                      page:
                        type: integer
                        example: 1
                      per_page:
                        type: integer
                        example: 20
                      query:
                        type: string
                        example: cybersecurity requirements
                      facets:
                        type: object
                        description: Count of results per category
                        additionalProperties:
                          type: integer
                        example:
                          articles: 45
                          recitals: 30
                          requirements: 84
        '400':
          description: Query missing, too short (<2 chars), or too long (>500 chars)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    PageParam:
      name: page
      in: query
      description: Page number (1-based)
      schema:
        type: integer
        minimum: 1
        default: 1
        example: 1
    PerPageParam:
      name: per_page
      in: query
      description: Results per page (max 100)
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 20
        example: 20
  schemas:
    SearchResult:
      type: object
      properties:
        type:
          type: string
          enum:
            - article
            - recital
            - requirement
          example: article
        framework_slug:
          type: string
          example: cra
        framework_name:
          type: string
          example: CRA
        article_number:
          type: integer
          nullable: true
          example: 1
        title:
          type: string
          nullable: true
          example: Subject matter
        match_context:
          type: string
          description: Snippet of text surrounding the search match
          example: >-
            ...cybersecurity requirements for the design, development and
            production...
        url:
          type: string
          description: Relative URL to fetch the full resource
          example: /v1/frameworks/cra/articles/1
    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.

````