Falcao — National Labor-Justice Jurisprudence (CSJT)
FalcaoScraper queries the Jurisprudencia Nacional system of the Brazilian Labor Justice (Justica do Trabalho), hosted by the CSJT at https://jurisprudencia.jt.jus.br. A single search endpoint spans the TST and all 24 TRTs across five document collections.
Method
Description
listar_decisoes
Jurisprudence search — returns a DataFrame
listar_decisoes_download
Downloads the raw JSON pages to disk
listar_decisoes_parse
Parses a folder produced by listar_decisoes_download
Notes: the public (unauthenticated) endpoint only allows page sizes of 5 or 10 (tamanho_pagina) and caps results at 10,000 per query.
Basic search
This example requests two pages. Always select a bounded number of pages for exploratory queries. The backend can respond with HTTP 429 and a long wait. Increasing sleep_time does not cancel an active block.
On 2026-10-03, five successful probes, including three consecutive calls in one session, each reported x-rate-limit-remaining: 49. Later that day, HTTP 429 reported a wait of 27,720 seconds at 19:17:44 UTC, pointing to release at 23:59:44 in Brasilia. This is consistent with the earlier midnight-reset hypothesis, but the quota size and the meaning of the successful-response counter remain unverified. The client does not use that counter to reject larger searches in advance. See issue #350.
If listar_decisoes fails after receiving pages, it preserves their JSON files in their own folder under the system temporary directory; the scraper’s download_path is not used. The exception note gives the folder to pass to listar_decisoes_parse for a partial result. To continue an interrupted search instead, use checkpoint_dir (see Resume an interrupted collection below). Successful calls remove their temporary files.
The backend’s relevance order changes between calls of the same search, so the pages of one collection may repeat or omit documents. With explicit paginas and no ordenacao, as below, the search keeps that order and emits a UserWarning when it requests more than one page. Without ordenacao, a collection of every page (paginas=None) or with checkpoint_dir is sent as ordenacao="menos_recente" instead, except in precedentes, which has no filing date (see Resume an interrupted collection below).
/var/folders/rv/jfmtd5hx5kv11464k5s9yjg80000gn/T/ipykernel_16403/3884074537.py:4: UserWarning: A ordem padrão do Falcao (mais_relevante) varia entre chamadas da mesma busca: páginas requisitadas em momentos diferentes podem repetir ou omitir documentos. Para coleta de várias páginas, use ordenacao='menos_recente' com data_juntada_fim fechado no passado, ou confira duplicatas no resultado.
df = falcao.listar_decisoes("dano moral", paginas=2, tamanho_pagina=10)
The acordaos collection ships the ementa, returned as plain text (HTML stripped).
print(df["ementa"].iloc[0][:300])
DANO MORAL COLETIVO. CARACTERIZAÇÃO. Comprovado o ato ilícito praticado pela reclamada, com violação ao ordenamento jurídico e sonegação de direito trabalhista assegurado aos empregados (descanso semanal remunerado), é inegável a ofensa aos direitos fundamentais dos trabalhadores, sobretudo a dignid
Using filters
Filters are validated by the InputListarDecisoesFalcao pydantic schema. Multi-value filters accept a string or a list of strings.
Each listar_decisoes_download call creates its own subfolder and saves one raw JSON file per page (named {colecao}_{page}.json); listar_decisoes_parse reads a folder back into a DataFrame.
import tempfile, os, jsonwith tempfile.TemporaryDirectory() as tmp: pasta = falcao.listar_decisoes_download("dano moral", paginas=1, diretorio=tmp) arquivos = os.listdir(pasta)print("files:", arquivos) raw = json.load(open(os.path.join(pasta, arquivos[0])))print("quantidadeTotal:", raw["quantidadeTotal"])print("raw keys:", list(raw.keys())) df_parsed = falcao.listar_decisoes_parse(pasta)print("parsed:", df_parsed.shape)
The backend blocks the IP for hours after a small number of requests (HTTP 429, apparently a daily quota), so a large search may not fit in one day. Pass checkpoint_dir to listar_decisoes or listar_decisoes_download to keep the pages and a manifest.json in a directory of your choice, and repeat the call with resume=True to request only the pages that are still missing:
import requestsfiltros =dict(colecao="acordaos", tribunais="TST", ordenacao="menos_recente", data_juntada_fim="2024-12-31")try: df = falcao.listar_decisoes("dano moral", checkpoint_dir="coleta_dano_moral", **filtros)except requests.HTTPError:pass# quota exhausted: the pages received so far stay in the checkpoint# later, once the IP is releaseddf = falcao.listar_decisoes("dano moral", checkpoint_dir="coleta_dano_moral", resume=True, **filtros)
A new collection refuses an occupied checkpoint_dir; resume=True requires the checkpoint of the same search (term, collection, filters and tamanho_pagina) and fails before any request otherwise. paginas may change between sessions, and the order of the values in a list filter does not matter.
Pages already on disk are never requested again, and a checkpoint that is already complete costs no request: the total recorded in the manifest stands.
The returned DataFrame has every page in the checkpoint; listar_decisoes_parse(checkpoint_dir) reads it too.
The index can change between sessions. If the total changes, the pages already saved are kept and a UserWarning says they may repeat or omit documents relative to the new ones; a change that keeps the total (always the case above the 10,000 cap) goes unnoticed. A closed data_juntada_fim in the past with ordenacao="menos_recente" keeps new documents from shifting the pages.
The relevance order changes between calls of the same search: measured live on 2026-11-16, page 3 of “dano moral” came back in three versions within three minutes, while ordenacao="menos_recente" with a closed data_juntada_fim returned the same page in three calls. A collection with checkpoint_dir and no ordenacao is therefore sent as menos_recente; with ordenacao="mais_relevante" it emits a UserWarning, because pages requested at different moments may repeat or omit documents.
resume=True fails when the directory has no checkpoint, so a wrong path never starts from scratch. In a daily script with a single call, pass resume=(Path(checkpoint_dir) / "manifest.json").exists().
There is no directory lock: two simultaneous runs on the same checkpoint request the same pages twice.
TST coverage
The tribunais="TST" filter restricts any collection to the Superior Labor Court (TST). The cell below checks each collection with a broad term (dano moral): how many TST documents match, which courts the first page returns, and the oldest and newest dates when the first page is sorted each way (menos_recente / mais_recente). It sends up to 10 requests, which count toward the backend quota discussed above. The cell prints the day of the run.
How to read the table:
total_tst is capped at 10,000 by the backend, so 10000 means 10,000 or more. To count beyond the cap, split the search into data_juntada_inicio / data_juntada_fim windows.
tribunais should list only TST; anything else means the filter is not applied to that collection.
A zero total means the collection holds no TST document for the term. The TST does not issue first-instance rulings, so sentencas is expected to be empty.
campo_data names the date field used (data_juntada is the filing date). The dates bound the first page in each order, not the whole collection.
TST precedents are súmulas and orientações jurisprudenciais, keyed as TST-SUM-392 or TST-OJ-SBDI2-130; they are not decisions.
On 2026-11-15, the run below returned only TST in every collection with results. acordaos and decisoesmonocraticas reached the 10,000 cap, with first-page filing dates from 2016-01-08 to 2026-10-29 and from 2016-01-07 to 2026-09-24; precedentes held 32 TST documents, with first-page publication dates from 2012-09-27 to 2016-04-26. sentencas returned 0, as expected. recursorevista also returned 0 for the TST, which is a coverage gap rather than a filter failure: the same search returned only TRT22 documents unfiltered and only TRT2 documents with tribunais="TRT2".
Falcao covers jurisprudence only. For TST case metadata and procedural movements, use the datajud aggregator, which maps TST to its public index.
import jsonimport tempfileimport timefrom datetime import datefrom pathlib import Pathimport pandas as pdfalcao_tst = jus.scraper("falcao", verbose=0) # no progress bar per requestdef primeira_pagina_tst(colecao, ordenacao, diretorio):"""First page (5 documents) of a TST-only search: raw total and parsed rows.""" pasta = falcao_tst.listar_decisoes_download("dano moral", paginas=1, tamanho_pagina=5, colecao=colecao, tribunais="TST", ordenacao=ordenacao, diretorio=diretorio, ) bruto = json.loads(next(Path(pasta).glob("*.json")).read_text(encoding="utf-8")) time.sleep(falcao_tst.sleep_time)return bruto["quantidadeTotal"], falcao_tst.listar_decisoes_parse(pasta)def limites_de_data(df):"""First date field with values in ``df`` and its earliest and latest dates."""for campo in [c for c in ("data_juntada", "data_julgamento", "dataPublicacao") if c in df]: datas = pd.to_datetime(df[campo], format="%d/%m/%Y", errors="coerce").dropna()iflen(datas):return {"campo_data": campo, "mais_antigo": datas.min(), "mais_recente": datas.max()}return {}linhas = []with tempfile.TemporaryDirectory() as tmp:for colecao in falcao_tst.COLECOES: total, antigos = primeira_pagina_tst(colecao, "menos_recente", tmp) linha = {"colecao": colecao, "total_tst": total}if total:# With 5 or fewer hits, the first page already holds every document. recentes = antigos if total <=5else primeira_pagina_tst(colecao, "mais_recente", tmp)[1] paginas = pd.concat([antigos, recentes]) linha["tribunais"] =", ".join(sorted(paginas["tribunal"].dropna().unique())) linha.update(limites_de_data(paginas)) linhas.append(linha)print("Checked on", date.today().isoformat())pd.DataFrame(linhas)