# Legislation & Law Text API: Exact Statute Text (EU, UK, US) (`reliable_tools/legislation-text-api`) Actor

Get the exact current text of a law by citation: "Art. 6 GDPR", "26 U.S.C. § 162", "21 CFR 820.10", "Consumer Rights Act 2015 s. 9". Verbatim paragraphs, version date, official source URL and licence, plus the passages that answer your question.

- **URL**: https://apify.com/reliable_tools/legislation-text-api.md
- **Developed by:** [Reliable Tools](https://apify.com/reliable_tools) (community)
- **Categories:** Developer tools, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.25 / 1,000 provision returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Legislation & Law Text API: Exact Statute Text (EU, UK, US)

**Not legal advice.** This Actor returns the published text of laws for reference. Check the authentic published version
and ask a qualified professional before you rely on it. Every row carries this note in its `disclaimer` field.

This legislation API returns the exact current text of a law provision from its citation: "Art. 6 GDPR", "Art. 17 GDPR",
"26 U.S.C. § 162", "21 CFR 820.10" or "Consumer Rights Act 2015 s. 9". You get the official title, the verbatim text split
into its numbered paragraphs, the version date, the official source URL and the reuse licence. Ask a question with a
citation and you also get the passages of that provision that answer it, each with an AI evidence score. The text always
comes from the official publisher; nothing is paraphrased or written by AI.

### What does the Legislation & Law Text API do?

It reads citations the way lawyers, tax advisers and compliance teams write them, finds the act at the official source and
quotes the provision word for word.

| Jurisdiction | What you can cite | Official source |
|---|---|---|
| European Union | Regulations, directives and decisions: by common name ("GDPR", "AI Act", "DSA", "GPSR", "VAT Directive", "CRR", 50 acts in all), by number ("Regulation (EU) 2023/988", "Directive 2006/112/EC", "Regulation (EC) No 261/2004") or by CELEX number ("32016R0679"). Articles and annexes. | EUR-Lex via the CELLAR repository of the Publications Office |
| United Kingdom | Acts and statutory instruments by title and year, sections, regulations, articles and schedule paragraphs, plus retained EU law ("art. 6 UK GDPR") | legislation.gov.uk (The National Archives) |
| United States | U.S. Code sections ("26 U.S.C. § 162", "IRC § 199A") and Code of Federal Regulations sections ("21 CFR 820.10", "Treas. Reg. § 1.162-1") | uscode.house.gov (Office of the Law Revision Counsel) and the eCFR from govinfo.gov |

**German law is not offered.** The official German server (gesetze-im-internet.de) does not accept connections from the
Apify cloud, and we do not route around that. German citations such as "§ 13b UStG" are recognised, but they come back as
`source_unavailable` and are not charged.

Pinpoints work too: "Art. 6(1)(f) GDPR", "s. 172(1)(a) Companies Act 2006", "26 U.S.C. § 162(a)(2)", "16 CFR 310.4(b)(1)(iii)". The
full provision is returned and the pinpoint text is given on its own in `pinpointText`.

### Who uses it

- **Tax advisers and accountants** who quote the exact wording of a VAT or income tax provision in a memo or client letter.
- **Compliance and product teams** checking obligations in the GDPR, the AI Act, GPSR, MDR, the CFR or the Consumer Rights Act.
- **Legal tech and AI builders** who need citable, verbatim statute text with a version date for retrieval and grounding.
- **AI agents and retrieval pipelines** that need the verbatim source text with a version date (see Using it from an AI agent below).

### What data you get

| Field | What it is |
|---|---|
| `status` | `found`, `repealed`, `not_found`, `ambiguous`, `invalid_citation`, `unsupported` or `source_unavailable` |
| `citation` | The citation in a normalised form, for example `Art. 6(1)(f) Regulation (EU) 2016/679` |
| `jurisdiction` | `EU`, `UK` or `US` (`DE` only on rows marked `source_unavailable`) |
| `provision`, `heading` | The article, section or paragraph and its official heading |
| `actTitle`, `actShortName`, `actId` | Official title of the act, abbreviation or type, and its identifier (CELEX number, legislation.gov.uk path, U.S.C. title or CFR part) |
| `text` | The exact text of the provision, one block per line in the official order |
| `paragraphs` | The same text split into its numbered paragraphs (1, 2, 3 or (a), (b)) |
| `pinpoint`, `pinpointText` | The pinpoint you cited and only its text |
| `answer` | For a question: the passages that answer it, each with the line, its paragraph path and an evidence score from 0 to 1 |
| `versionDate`, `versionDateMeaning`, `versionNote` | The version date and what it means at that source (see below) |
| `inForce` | Whether the act or provision is in force at the source |
| `sourceUrl`, `dataUrl` | The official page of the provision and the machine-readable file that was read |
| `licence`, `sourceName` | The source and its reuse terms |
| `amendmentNotes` | Amendment, commencement, repeal or authority notes published with the provision |
| `eli` | European Legislation Identifier of the version (EU) |
| `parse` | How the citation was read: by rules, or by an AI pick among several matching acts, with the candidates |
| `note` | Plain-language notes, for example why a row was not found |
| `disclaimer` | The not-legal-advice note, on every row |

#### What the version date means

| Source | `versionDate` is |
|---|---|
| EU | The date of the consolidated version used (the latest one in force today), or the Official Journal date if the act has never been consolidated. If a later consolidated version with adopted future changes exists, `versionNote` says so. |
| UK | The date from which this version of the provision applies |
| U.S. Code | The enactment date of the last public law included in the current release point |
| CFR | The latest amendment date stated in the eCFR title file (`versionNote` also gives the date of the data file) |

### How to run it

1. Open the Actor and put citations into **Citations**, one per line.
2. To ask a question about a citation, write it after `|`, for example `Art. 17 GDPR | When must personal data be erased?`.
   Or use **Question for all citations** to ask the same question of every citation.
3. Pick the language for EU law if you want a language other than English.
4. Click **Start** and download the results as JSON, CSV or Excel, or read them through the API.

### Example output

Input `26 U.S.C. § 162 | Are travel expenses away from home deductible?` (text shortened here):

```json
{
  "status": "found",
  "jurisdiction": "US",
  "citation": "26 U.S.C. § 162",
  "heading": "Trade or business expenses",
  "actTitle": "Title 26 INTERNAL REVENUE CODE",
  "text": "(a) In general\nThere shall be allowed as a deduction all the ordinary and necessary expenses paid or incurred during the taxable year in carrying on any trade or business ...",
  "answer": {
    "question": "Are travel expenses away from home deductible?",
    "status": "answered",
    "answerInProvisionProbability": 0.98,
    "passages": [
      {"line": 4, "path": "(a)(2)", "evidenceScore": 1.0,
       "text": "(2) traveling expenses (including amounts expended for meals and lodging other than amounts which are lavish or extravagant under the circumstances) while away from home in the pursuit of a trade or business; and"}
    ]
  },
  "versionDate": "2026-10-22",
  "versionNote": "Text contains those laws in effect through Public Law 119-136 (October 22, 2026).",
  "sourceUrl": "https://uscode.house.gov/us/usc/119-136/t26/s162/",
  "licence": "Public domain (US government work, 17 U.S.C. § 105). Office of the Law Revision Counsel, uscode.house.gov."
}
```

### Statuses and edge cases

| Status | When | Charged |
|---|---|---|
| `found` | The provision exists and its current text is returned | Yes |
| `repealed` | The act or provision was repealed or deleted. You get the official record: the repeal note, the repealing act where the source gives it, and the last text if the source keeps it | Yes |
| `not_found` | The act exists but the provision does not (for example a CFR section that was removed), or the act number is unknown | No |
| `ambiguous` | An abbreviation matches several acts and the context does not decide it. The candidates are listed so you can add the act number | No |
| `invalid_citation` | The citation could not be read | No |
| `unsupported` | A citation type that is not covered, such as a whole CFR part | No |
| `source_unavailable` | The official source did not answer. Retry later | No |

Ambiguous abbreviations: "CRD" can mean the Capital Requirements Directive or the Consumer Rights Directive. When a citation
matches several acts, an AI pick chooses one only when it is confident (for example "Art. 21c CRD" points to the Capital
Requirements Directive, because Article 21c only exists there). Otherwise the row is `ambiguous` and free.

### How the question answering works

1. Code fetches the official provision and numbers every line of it.
2. An AI model answers two fixed questions: does any line of this provision answer the question, and which lines answer it
   most directly. It can only point at existing lines.
3. Code quotes those lines verbatim from the official text and returns their evidence scores. If the provision does not
   address the question, `answer.status` is `not_in_this_provision` and the passages are empty (and not charged).

The AI never writes or rewrites legal text and gives no legal assessment. It only selects lines of the provision that
relate to the question. Long provisions are read in overlapping windows. Questions are cut at 500 characters.

For this step the question and the provision text are sent to an external AI service, which only answers the fixed
questions above. To keep questions out of it, leave the question empty or turn off **Answer questions with passages**.
When a citation matches several acts, the citation and the question are also used for the AI pick described above.

### Using it from an AI agent

An agent or retrieval pipeline can call this Actor as a tool to fetch the verbatim text it quotes:

1. The agent collects the citations it needs ("Art. 6 GDPR", "26 U.S.C. § 162").
2. It calls the Actor with each citation, optionally with a short question to select the relevant lines.
3. It quotes `text` or `answer.passages` word for word and links `sourceUrl` with the `versionDate`.
4. If a row comes back `repealed`, `not_found` or `ambiguous`, the agent reports that instead of guessing.

The output is source text, not an answer to a legal question and not legal advice.

### API use

```bash
curl -X POST "https://api.apify.com/v2/acts/reliable_tools~legislation-text-api/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"requests": [{"citation": "Art. 17 GDPR", "question": "When must personal data be erased?"},
                    {"citation": "26 U.S.C. § 162"}]}'
```

The `requests` field takes objects with `citation`, an optional `question` and your own `reference`, which is returned
unchanged. The run summary (counts per status, requests per source) is in the key-value store under `SUMMARY`.

### Pricing

You pay per event, there is no subscription.

| Event | Price |
|---|---|
| Provision returned (`found` or `repealed`) | $0.005 |
| Question answered with passages | $0.005 extra |
| Actor start | $0.00005 per run |

Rows that are `not_found`, `ambiguous`, `invalid_citation`, `unsupported` or `source_unavailable` cost nothing. A question is
only charged when passages are found.

### Sources and licences

| Source | Licence |
|---|---|
| EUR-Lex / CELLAR, Publications Office of the EU | © European Union, EUR-Lex. Reuse allowed with acknowledgement of the source (Commission Decision 2011/833/EU). Consolidated texts are under CC BY 4.0; the amendment markers (such as ►B and ►M1) are removed by Reliable Tools. Only the Official Journal text is authentic; consolidated versions are documentation. |
| legislation.gov.uk | Open Government Licence v3.0, Crown copyright. Retained EU law on legislation.gov.uk also credits © European Union, EUR-Lex. |
| uscode.house.gov | Public domain (US government work) |
| eCFR bulk data on govinfo.gov | Public domain (US government work). The annual CFR edition is the official legal edition. |

The Actor reads only these official, public, keyless sources, follows their robots.txt rules and identifies itself with a
contact in its user agent. It waits 5 seconds between requests to legislation.gov.uk, as its crawl-delay asks, and keeps
that gap across runs as far as it can by storing the time of the last request in a shared store. It caches unchanged
files so it asks each source as little as possible.

This Actor is not affiliated with or endorsed by the Publications Office of the EU, The National Archives, the Office of
the Law Revision Counsel, the U.S. Government Publishing Office or the Office of the Federal Register.

### FAQ

**Is this the officially binding text?** It is the text as published by the official source at the time of the run. For the
EU, consolidated versions and for the UK, revised versions are documentation tools; the version published in the Official
Journal or as enacted is authentic. The `versionNote` says which one you got. This is not legal advice.

**Does it cover case law or court rulings?** Not yet. This version returns statutes and regulations.

**Does it cover German law?** No. The official server gesetze-im-internet.de refuses connections from the Apify cloud, so
German citations come back as `source_unavailable` and are not charged. EU, UK and US citations in the same run are not
affected.

**Does it cover US state law?** No. The US is the U.S. Code and the CFR.

**Can I cite the EU treaties (TFEU, TEU)?** Not yet. Regulations, directives and decisions are covered.

**Why did my UK citation take a few seconds?** legislation.gov.uk asks crawlers to wait 5 seconds between requests, and the
Actor respects that. Well-known acts (Companies Act 2006, Consumer Rights Act 2015, UK GDPR and others) skip the title search.

**How current is the text?** It is read live from the source on every run (with a short cache for large files). The UK updates
within days of an amendment, the eCFR daily, the U.S. Code with each release point and EU consolidations
usually some weeks after an amending act applies.

**Something broke or a citation is not read correctly?** Open an issue on the Issues tab and include the citation.

### About Reliable Tools

This Actor is made by [Reliable Tools](https://apify.com/reliable_tools). We build data tools that return clean, official
data plus an AI score where it helps, so you can filter and act on the results straight away.

If a citation does not parse the way you expect or a field is missing, open an issue on the Issues tab. We read every one and
usually reply within a day. You can find our other Actors on our [profile page](https://apify.com/reliable_tools).

# Actor input Schema

## `citations` (type: `array`):

One citation per line, written the way lawyers write them. EU: "Art. 6 GDPR", "Article 6(1)(f) GDPR", "Regulation (EU) 2023/988 Art. 9", "Directive 2006/112/EC Art. 196", "32016R0679 Art. 17". UK: "Consumer Rights Act 2015 s. 9", "s. 172 Companies Act 2006", "art. 6 UK GDPR". US: "26 U.S.C. § 162", "IRC § 162(a)", "21 CFR 820.10", "Treas. Reg. § 1.162-1". To ask a question about one citation, add it after " | ", for example: "Art. 17 GDPR | When must personal data be erased?"

## `requests` (type: `array`):

Optional, for API use. One object per citation: "citation" (required), "question" (optional, answered with passages from the official text) and "reference" (your own ID, returned unchanged).

## `question` (type: `string`):

Optional, up to 500 characters (longer questions are cut). Asked of every citation that has no question of its own. It only selects the lines of the provision that relate to it, each with an AI evidence score; no new text is written and nothing is legal advice.

## `answerQuestions` (type: `boolean`):

Finds the lines of the provision that answer each question and gives each an evidence score (0 to 1). Charged only when passages are found.

## `euLanguage` (type: `string`):

EU acts are published in all official languages. UK and US law is in English.

## `includeParagraphs` (type: `boolean`):

Adds the provision split into numbered paragraphs (for example 1, 2, 3 or (a), (b)) next to the full text.

## `maxCitations` (type: `integer`):

Stops after this many citations.

## Actor input object example

```json
{
  "citations": [
    "Art. 6 GDPR",
    "Art. 17 GDPR",
    "26 U.S.C. § 162 | Are travel expenses deductible?",
    "21 CFR 820.10",
    "Consumer Rights Act 2015 s. 9"
  ],
  "requests": [
    {
      "reference": "Q-1",
      "citation": "Art. 17 GDPR",
      "question": "When must a company erase personal data?"
    }
  ],
  "answerQuestions": true,
  "euLanguage": "en",
  "includeParagraphs": true,
  "maxCitations": 500
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset in the provisions view.

## `summary` (type: `string`):

Counts per status and requests per source.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "citations": [
        "Art. 6 GDPR",
        "Art. 17 GDPR",
        "26 U.S.C. § 162 | Are travel expenses deductible?",
        "21 CFR 820.10",
        "Consumer Rights Act 2015 s. 9"
    ],
    "requests": [
        {
            "reference": "Q-1",
            "citation": "Art. 17 GDPR",
            "question": "When must a company erase personal data?"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("reliable_tools/legislation-text-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "citations": [
        "Art. 6 GDPR",
        "Art. 17 GDPR",
        "26 U.S.C. § 162 | Are travel expenses deductible?",
        "21 CFR 820.10",
        "Consumer Rights Act 2015 s. 9",
    ],
    "requests": [{
            "reference": "Q-1",
            "citation": "Art. 17 GDPR",
            "question": "When must a company erase personal data?",
        }],
}

# Run the Actor and wait for it to finish
run = client.actor("reliable_tools/legislation-text-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "citations": [
    "Art. 6 GDPR",
    "Art. 17 GDPR",
    "26 U.S.C. § 162 | Are travel expenses deductible?",
    "21 CFR 820.10",
    "Consumer Rights Act 2015 s. 9"
  ],
  "requests": [
    {
      "reference": "Q-1",
      "citation": "Art. 17 GDPR",
      "question": "When must a company erase personal data?"
    }
  ]
}' |
apify call reliable_tools/legislation-text-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,reliable_tools/legislation-text-api"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/QZEEQShBgJeXQlfuV/builds/Lm2s9xkVtka7mSofz/openapi.json
