Skip to main content

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.

Overview

The search endpoint lets you query across all frameworks simultaneously. Results include articles, recitals, and requirements that match your query. Use $client->search->query() to search.

Methods

query()

Search across all frameworks (or a specific one).
// Search everything
$results = $client->search->query('incident notification 72 hours');

printf("Found %d results\n", $results->meta->total);
foreach ($results->data as $result) {
    printf("  [%s] %s — %s\n",
        strtoupper($result->frameworkSlug),
        $result->type,
        $result->title ?? $result->matchContext,
    );
}
Parameters
ParameterTypeDefaultDescription
$qstringrequiredSearch query
$frameworkstring|nullnullLimit to one framework slug
$resultTypestring|nullnullFilter by type: 'article', 'recital', 'requirement'
$pageint|nullnullPage number
$perPageint|nullnullItems per page
Returns Page<SearchResult>

Model

SearchResult

FieldTypeDescription
typestring'article', 'recital', or 'requirement'
frameworkSlugstringFramework the result belongs to
frameworkNamestringHuman-readable framework name
articleNumberint|nullFor article results
recitalNumberint|nullFor recital results
paragraphRefstring|nullSpecific paragraph reference
titlestring|nullResult heading, if any
requirementTypestring|nullFor requirement results
matchContextstringSnippet showing the match in context
urlstringDirect API URL to the full resource

Examples

Search across specific frameworks

$results = $client->search->query(
    q:         'breach notification',
    framework: 'gdpr',
);

foreach ($results->data as $r) {
    echo $r->frameworkSlug . ' — ' . ($r->title ?? $r->matchContext) . "\n";
}

Filter by result type

$results = $client->search->query(
    q:          'encryption at rest',
    resultType: 'requirement',
);

foreach ($results->data as $r) {
    echo '- ' . $r->matchContext . "\n";
}
$frameworks = ['nis2', 'dora', 'cra'];
foreach ($frameworks as $fw) {
    $results = $client->search->query('incident notification', framework: $fw);
    printf("%-6s %d results\n", $fw, $results->meta->total);
}
Use the $framework parameter to narrow results when you know which regulation you’re working with. Cross-framework search (without a filter) is great for discovering related obligations across different laws.