Skip to content

SoyLic Platform

AssistantLibraryCase lawDeadlinesWorkflows and templatesLab

Developer API

APIDocumentation

SoyLic

PricingBlog

About

About usNewsroomContact Sign in ↗ ES EN

Developer API

API documentation.

Query Mexican laws, articles, theses and rulings from your applications, with the same data you see in SoyLic. Server to server only. The content is in Spanish.

Base URL: https://api.soylic.mx/v1 · OpenAPI

Getting started

  1. Create a key in Configuraciones → Desarrolladores (Settings → Developers). Your first key comes with free credits to try it.
  2. Store it on your server. It is shown only once.
  3. Make your first request:
curl -H "Authorization: Bearer lic_live_…" \
  "https://api.soylic.mx/v1/articulos/buscar?q=pension%20alimenticia&entidad=Jalisco"

Authentication

Send your key on every request with the header Authorization: Bearer lic_live_…. Do not put it in a web page or in an app that runs on a phone: anyone who sees it can spend your credits. If it leaks, revoke it and create another one.

Credits

The API is paid with credit packages you buy in Configuraciones → Desarrolladores. Credits never expire. Each endpoint shows how many credits it uses, also when it responds 404. With a balance of 0, the API responds 402 no_credits. Your balance comes in X-Lic-Credits-Remaining and in GET /v1/uso. Packages and prices are on Pricing.

Limits

There are requests per minute (per key and per account), a daily unit quota (per key) and a monthly safety cap (per account). Check yours in GET /v1/uso. Searches return 20 results per page and only the first 100 can be paged: to find something, refine the search.

The API is for integrating SoyLic into your system, not for copying the content. Bulk downloads (walking records in order, paging through every search, a continuous automated pace) are detected: first your limits go down, then the key is suspended.

Response headers

HeaderWhat it shows
X-Lic-Credits-RemainingCredits left in your account.
X-Lic-Units-RemainingUnits left in your account before the monthly safety cap.
RateLimit-LimitRequests allowed per minute.
RateLimit-RemainingRequests left in this minute.
RateLimit-ResetSeconds until the minute resets.
Retry-AfterOn a 429, seconds you must wait.

Errors

Always in the form {"error":{"code":"…","message":"…"}}. The message is in Spanish and can be shown to your users.

HTTPcodeWhen
400validation, pagination_too_deepInvalid parameters, or a page beyond the first 100 results.
401unauthorized, key_revokedThe key is missing, invalid or revoked.
402no_creditsYour account has no credits.
403forbidden, key_suspended, plan_requiredMissing permission, suspended key, or the API is turned off for your account.
404not_foundThe record or the endpoint does not exist.
429rate_limited, quota_exceededPer-minute limit, daily quota or monthly cap. Respect Retry-After.

Endpoints

All are GET and all need a key, except /v1/openapi.json. Paths and parameter names are in Spanish.

GET /v1/leyes/buscar 1 credit

Search laws

Permission leyes:read.

ParameterInDescription
q requiredquerySearch text (3 to 200 characters)
entidadquery«Federal» or the name of a Mexican state
paginaqueryPage of 20 results. Only the first 100 results of each search can be paged.
GET /v1/leyes/{id} 1 credit

One law: details and table of contents

Permission leyes:read. Does not include the full text.

ParameterInDescription
id requiredpathLaw id
GET /v1/leyes/{id}/articulos/{clave} 1 credit

One article of a law

Permission leyes:read. The key is the one in the table of contents («27», «27-bis», «transitorio-1»).

ParameterInDescription
id requiredpathLaw id
clave requiredpathArticle key
GET /v1/articulos/buscar 1 credit

Search articles

Permission leyes:read. Search by text and by meaning.

ParameterInDescription
q requiredquerySearch text (3 to 200 characters)
entidadquery«Federal» or the name of a Mexican state
paginaqueryPage of 20 results. Only the first 100 results of each search can be paged.
GET /v1/tesis/buscar 1 credit

Search theses

Permission tesis:read.

ParameterInDescription
q requiredquerySearch text (3 to 200 characters)
paginaqueryPage of 20 results. Only the first 100 results of each search can be paged.
GET /v1/tesis/{registro} 1 credit

One thesis

Permission tesis:read.

ParameterInDescription
registro requiredpathDigital registry number
GET /v1/sentencias/buscar 2 credits

Search rulings

Permission sentencias:read (enabled per account).

ParameterInDescription
q requiredquerySearch text (3 to 200 characters)
paginaqueryPage of 20 results. Only the first 100 results of each search can be paged.
GET /v1/sentencias/{id} 2 credits

One ruling

Permission sentencias:read (enabled per account).

ParameterInDescription
id requiredpathRuling id
GET /v1/uso No cost

Usage, limits and credits of your key

Uses no credits.