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

Articles are the primary normative units of each EU regulation. Each article belongs to one framework and may contain multiple numbered paragraphs. Articles can also be tagged and cross-referenced to related articles.

Methods

list()

Returns a page of article summaries for a framework.
const page = await client.articles.list('gdpr', { page: 1, perPage: 20 });

console.log(`GDPR has ${page.meta.total} articles`);

for (const article of page.data) {
  console.log(`Art. ${article.articleNumber}: ${article.title} (${article.paragraphCount} paragraphs)`);
}
Parameters
ParameterTypeDefaultDescription
frameworkSlugstringrequiredFramework slug, e.g. "gdpr"
pagenumber1Page number
perPagenumber20Items per page (1–100)
Returns Promise<Page<ArticleSummary>>

get()

Fetch the full content of a single article including all paragraphs.
const article = await client.articles.get('gdpr', 5);

console.log(`Art. ${article.articleNumber}: ${article.title}`);
console.log(article.content);

for (const para of article.paragraphs) {
  console.log(`  [${para.paragraphRef}] ${para.content}`);
}
Parameters
ParameterTypeDescription
frameworkSlugstringFramework slug
articleNumbernumberArticle number
Returns Promise<Article>
Fetch articles related to a given article (cross-references and thematic links).
const related = await client.articles.related('gdpr', 5);

console.log(`${related.meta.total} articles related to GDPR Art. 5`);
for (const article of related.data) {
  console.log(`  Art. ${article.articleNumber}: ${article.title}`);
}
Parameters
ParameterTypeDescription
frameworkSlugstringFramework slug
articleNumbernumberArticle number
Returns Promise<Page<ArticleSummary>>

iter()

Iterate over all articles in a framework without managing pagination.
for await (const article of client.articles.iter('gdpr')) {
  const tagList = article.tags.map(t => t.slug).join(', ');
  console.log(`Art. ${article.articleNumber}: ${article.title} [${tagList}]`);
}
Parameters — same options as list() (except frameworkSlug is the first positional argument and page is managed internally). Returns AsyncGenerator<ArticleSummary>

Models

ArticleSummary

Returned by list(), related(), and iter().
FieldTypeDescription
idnumberInternal numeric ID
frameworkSlugstringParent framework slug
articleNumbernumberArticle number
titlestring | nullArticle title
positionnumberDisplay order within the framework
paragraphCountnumberNumber of paragraphs
tagsTag[]Tags applied to the article

Article

Returned by get(). Extends ArticleSummary with:
FieldTypeDescription
contentstring | nullFull article text
paragraphsArticleParagraph[]Structured paragraph list

ArticleParagraph

FieldTypeDescription
paragraphRefstringParagraph reference, e.g. "1", "2a"
contentstringParagraph text
positionnumberDisplay order within the article

Example: find all articles tagged “data-breach”

const breachArticles: string[] = [];

for await (const article of client.articles.iter('gdpr')) {
  const hasTag = article.tags.some(t => t.slug === 'data-breach');
  if (hasTag) {
    breachArticles.push(`Art. ${article.articleNumber}: ${article.title}`);
  }
}

console.log('Data-breach articles:', breachArticles);