Skip to main content

Lex API MX — cliente Python

Cliente mínimo de Lex API MX para consultar la legislación federal mexicana vigente. Cada respuesta trae la fuente oficial, el checksum SHA-256 del texto y su periodo de vigencia.

pip install lex-api-mx-client
from lex_api_mx import LexApiClient, LexApiError

with LexApiClient(base_url="https://api.lexapi.mx", api_key="tu_clave") as lex:
    paquete = lex.resolve(query="Artículo 47 LFT", as_of="2026-10-08")
    articulos = lex.search_articles(query="aguinaldo", norm="lft", jurisdiction="federal")
    arbol = lex.norm_structure("lft")
Método Endpoint
resolve(query, norm=None, jurisdiction="federal", as_of=None, limit=10) POST /api/v1/resolve
search_articles(query, norm=None, matter=None, jurisdiction=None, as_of=None, limit=20) GET /api/v1/articulos/search
norm_structure(norm, as_of=None, include_text=False, page=1, page_size=None) GET /api/v1/normas/{slug}/estructura (texto solo en planes de la API, por páginas de nodos: revisa text_page.has_more)
map(query, jurisdiction=None, as_of=None) POST /api/v1/map (requiere el permiso map:read)

resolve y map aceptan idempotency_key: un reintento con la misma clave no se cobra dos veces. Los errores HTTP se lanzan como LexApiError con status_code, detail, request_id y body; 402 significa saldo agotado.

Para obtener una clave, crea tu cuenta en lexapi.mx/#cuenta. Referencia de la API: lexapi.mx/docs.

Para usar Lex API MX desde Claude, Cursor u otro agente, instala el servidor MCP lex-api-mx-mcp.

Código fuente: github.com/Julio-Patron/lexapi-mx. Licencia MIT.

Metadata

Release files for lex-api-mx-client 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lex-api-mx-client 0.2.1
File Size Uploaded
lex_api_mx_client-0.2.1.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lex-api-mx-client 0.2.1
File Interpreter ABI Platform
lex_api_mx_client-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.3 kB

Release files / lex_api_mx_client-0.2.1.tar.gz

Download URL lex_api_mx_client-0.2.1.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3227fae53171c4847e5a9f31f042331c69bbd5d5b6fa3b4ce73dfa2b633f973f
BLAKE2b-256 checksum
How to use checksums
d31b2a1921a283b2d32a50be29cdcb1b9f189887af1e1d97cd07162c24591f9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Release files / lex_api_mx_client-0.2.1-py3-none-any.whl

Download URL lex_api_mx_client-0.2.1-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
48123ef8f38463afb7c06b5f3bff53befee6f9960f5ab68ef9423cbc17be748a
BLAKE2b-256 checksum
How to use checksums
2e5648ad525b0d35280c0b272b797f2178485faa08e17cfc56f1b5223d020150
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page