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.Search the norms
POST /cl/leychile/norms-search/v1 Dataset
One search over every law, code, DFL, DL, auto acordado, treaty and supreme decree Croma keeps from Ley Chile.
as_of (how current the data is), the applied filters, total and total_is_exact, page, per_page, total_pages, count and results[]: best matches first when there is a query, otherwise the most recently published first. Every result carries norm_id (BCN’s permanent id, e.g. 1176603), name (e.g. Ley 21450), type, number, title, common_names, issuing_bodies, publication_date, promulgation_date, year, current_version_date (when the text in force today took effect) and version_kind, repealed and repeal_date, treaty, subjects, summary, categories, gazette, gazette_number and cve (the Diario Oficial’s verification code), version_count, article_count, official_url (the norm’s page at Ley Chile), source_document_url, and document_url and xml_url (Croma’s copies of BCN’s PDF and XML of the current version). Fields BCN does not state are null.
Search results leave out the text, the versions and the document history; the Ley Chile Norm endpoint returns them.
Croma reads new norms every day and the norms they modify until BCN publishes their new consolidated text, and checks the whole collection again once a month.
One norm, in full
POST /cl/leychile/norm/v1 Dataset
as_of, found, norm_id and norm, which carries everything the search returns plus versions (every version of the text, newest first, each with its kind, from_date, to_date, url and modified_by: the norms whose changes produced the next version, with their norm_id, type, number, title, change, publication_date and effective_date), modified_by_ids, document_versions (every PDF and XML Croma has kept, with version_date, document_url, xml_url and bytes), modifies (the norms whose version history lists it as modifying them), and articles, a run of the parts of the current text with offset, has_more and next_offset. Every result carries norm_id (BCN’s permanent id, e.g. 1176603), name (e.g. Ley 21450), type, number, title, common_names, issuing_bodies, publication_date, promulgation_date, year, current_version_date (when the text in force today took effect) and version_kind, repealed and repeal_date, treaty, subjects, summary, categories, gazette, gazette_number and cve (the Diario Oficial’s verification code), version_count, article_count, official_url (the norm’s page at Ley Chile), source_document_url, and document_url and xml_url (Croma’s copies of BCN’s PDF and XML of the current version). Fields BCN does not state are null. Each part carries norm_id, norm_name, norm_type, part_id (BCN’s id for the part, stable across versions), position (its place in the text, 0 for the heading), level and parent_part_id (the chapter or title it sits in), kind (Artículo, Capítulo, Título, Disposición Transitoria, Anexo, Encabezado, Promulgación…), name (e.g. 1 for Artículo 1), heading, text, transitory, repealed and version_date (the version its text comes from).
Long norms are read a run of parts at a time: send
offset and limit, then pass next_offset back as offset until has_more is false.A norm Croma does not hold returns
found: false with HTTP 200, not an error.Search inside the articles
POST /cl/leychile/articles-search/v1 Dataset
Find the article that says something, across every norm or within one.
as_of, query, norm_id, total and total_is_exact, page, per_page, total_pages, count and results[]: best matches first when there is a query, otherwise in the order of the text. Each part carries norm_id, norm_name, norm_type, part_id (BCN’s id for the part, stable across versions), position (its place in the text, 0 for the heading), level and parent_part_id (the chapter or title it sits in), kind (Artículo, Capítulo, Título, Disposición Transitoria, Anexo, Encabezado, Promulgación…), name (e.g. 1 for Artículo 1), heading, text, transitory, repealed and version_date (the version its text comes from).
Full reference
Schemas, all response fields, and an interactive playground.