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

# Planalto (federal legislation)

> Search Brazil's federal legislation as the Presidência da República publishes it (the Constitution and its amendments, and every lei complementar, lei ordinária, lei delegada, decreto-lei, decreto and medida provisória), and read any act's current text, whole or one article at a time, with the later acts that amended it.

The Presidência da República publishes Brazil's federal legislation on the
Planalto site: every act as it was signed and, for the ones amended since, a
consolidated text with the superseded wording taken out and each change noted
where it was made. About 55,000 acts are here, updated daily: the Constitution
of 1988 and its amendments, and every lei complementar, lei ordinária, lei
delegada, decreto-lei, decreto and medida provisória back to the 19th century.

Search by kind, number, year, date or any words in the text, then read one act
in full or a single article. Each act comes with the later acts its notes record
as having amended, added to or revoked it, article by article, and the lookup
lists the earlier acts it changed in turn. A medida provisória also carries its
standing: pending before Congress, converted into a law (and which), lapsed,
rejected or revoked.

<Note>
  The whole source, organized and ready to query: every endpoint on this page answers in milliseconds. Every response carries `as_of`: how current the data is. [How datasets work](/datasets).
</Note>

## Search federal acts

`POST /br/planalto/laws-search/v1` <a className="dataset-pill" href="/datasets">Dataset</a>

Finds acts by kind, number, year, date or words in the text.

| Field            | Type    | Notes                                                                                                                                                                                 |
| ---------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `query`          | string  | Optional. Words matched against the act's name, its ementa and its full text, e.g. `usucapião extrajudicial`.                                                                         |
| `type`           | enum    | Optional. `constitution`, `constitutional_amendment`, `complementary_law`, `ordinary_law`, `delegated_law`, `decree_law`, `decree` or `provisional_measure`.                          |
| `measure_status` | enum    | Optional. Only medidas provisórias standing this way: `pending`, `converted`, `lapsed`, `rejected`, `prejudiced` or `revoked`.                                                        |
| `number`         | string  | Optional. The act's number, with or without the thousands dot: `13105` and `13.105` are the same act.                                                                                 |
| `year`           | integer | Optional. The year the act was signed. Two acts of one kind can share a number (the oldest leis were numbered again from 1 in the 1940s), and the year tells them apart. Default `0`. |
| `from_date`      | string  | Optional. Only acts signed on or after this date, `yyyy-mm-dd`.                                                                                                                       |
| `to_date`        | string  | Optional. Only acts signed on or before this date, `yyyy-mm-dd`.                                                                                                                      |
| `page`           | integer | Optional. 1-based page. Default `1`.                                                                                                                                                  |
| `per_page`       | integer | Optional. Results per page, 1-50. Default `20`.                                                                                                                                       |

```bash theme={"dark"}
curl https://api.croma.run/br/planalto/laws-search/v1 \
  -H "Authorization: Bearer $CROMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "type": "ordinary_law", "number": "13105" }'
```

Returns `as_of` (how current the data is), the applied filters, `total`, `page`, `per_page`, `total_pages`, `count` and `results[]`, most recently signed first. Every act carries `id`, `type` and `type_label` (the kind, as Brazilian law names it), `number`, `year`, `name` (its full citation), `summary` (the ementa, the act's own statement of what it does), `signed_on`, `published_on` (in the Diário Oficial da União), `revoked` and `revoked_by`, `amended_by[]` (the later acts whose changes its text records, each with `law_id`, `name`, `changes[]` and the `articles[]` it touched), `official_url`, `consolidated_url`, `veto_message_url`, and for a medida provisória `measure_status` (`pending`, `converted`, `lapsed`, `rejected`, `prejudiced` or `revoked`), `measure_status_note` (the Presidência's own wording) and `converted_into` (the law it became).

<Note>
  Results leave out the text: the codes and the Constitution run to hundreds of
  thousands of characters. `query` still matches inside it, so a phrase from an
  article finds the act. To go straight to one act, filter by `type` and
  `number` instead: a text search for a code's name also finds every later act
  that cites it, newest first.
</Note>

## One act, in full

`POST /br/planalto/law/v1` <a className="dataset-pill" href="/datasets">Dataset</a>

Returns one act by its id, or one of its articles.

| Field     | Type    | Notes                                                                                                                                                                                                                  |
| --------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `law_id`  | string  | **Required.** The act's `id`, as the search returns it, e.g. `lei-13105-2015` for the Código de Processo Civil or `cf-1988` for the Constitution. The `law_id` in another act's `amended_by[]` is the same identifier. |
| `article` | string  | Optional. One article's number, e.g. `12`, `1.029` or `8-A`: `content` then carries that article alone, up to the next article or heading.                                                                             |
| `offset`  | integer | Optional. First character of the text to return. Pass the previous response's `next_offset` to read on. Default `0`.                                                                                                   |
| `limit`   | integer | Optional. How many characters to return. Most acts fit in one response; the Constitution and the codes do not. Default `200000`.                                                                                       |

```bash theme={"dark"}
curl https://api.croma.run/br/planalto/law/v1 \
  -H "Authorization: Bearer $CROMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "law_id": "lei-13105-2015", "article": "1.029" }'
```

Returns `as_of`, `found`, `law_id`, `article` and `article_found` (when one was asked for) and `law`, which carries everything the search returns plus `amends[]` (the earlier acts this one changed, with the `articles[]` it touched in each) and `content`: a window onto the text, with `text`, `offset`, `total_length`, `has_more` and `next_offset`. Every act carries `id`, `type` and `type_label` (the kind, as Brazilian law names it), `number`, `year`, `name` (its full citation), `summary` (the ementa, the act's own statement of what it does), `signed_on`, `published_on` (in the Diário Oficial da União), `revoked` and `revoked_by`, `amended_by[]` (the later acts whose changes its text records, each with `law_id`, `name`, `changes[]` and the `articles[]` it touched), `official_url`, `consolidated_url`, `veto_message_url`, and for a medida provisória `measure_status` (`pending`, `converted`, `lapsed`, `rejected`, `prejudiced` or `revoked`), `measure_status_note` (the Presidência's own wording) and `converted_into` (the law it became).

<Note>
  The text is the act as in force today: superseded wording is left out, and
  each changed provision keeps its note, e.g. "(Redação dada pela Lei nº
  13.256, de 2016)". It is the Presidência's consolidation; the official text
  is the one published in the Diário Oficial da União. The longest acts run past
  a million characters, so send `article` for one article, or read the text a
  range at a time: pass `next_offset` back as `offset` until `has_more` is
  false.
</Note>

<Note>
  A revoked act's text is what is left of it in force, often only its title and
  the note that revoked it. The Código de Processo Civil of 1973, revoked in
  2015, keeps just the articles on insolvency the new code left standing. A
  medida provisória is the exception: once it lapses or becomes a law the
  Presidência strikes the whole of it, so its text is kept as it was issued.
</Note>

<Note>
  An id Croma does not hold returns `found: false` with HTTP 200, not an error.
  That includes an id in another act's `amended_by[]` for an act this source
  does not hold: an earlier edition of a medida provisória from before 2001
  (only the last edition is kept) or a decreto without a number.
</Note>

<Card title="Full reference" icon="code" href="/api-reference/overview">
  Schemas, all response fields, and an interactive playground.
</Card>
