Getting started
- Create a key in Configuraciones → Desarrolladores (Settings → Developers). Your first key comes with free credits to try it.
- Store it on your server. It is shown only once.
- 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.
Errors
Always in the form {"error":{"code":"…","message":"…"}}. The message is in Spanish and can be shown to your users.
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.
| Parameter | In | Description |
q required | query | Search text (3 to 200 characters) |
entidad | query | «Federal» or the name of a Mexican state |
pagina | query | Page 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.
| Parameter | In | Description |
id required | path | Law 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»).
| Parameter | In | Description |
id required | path | Law id |
clave required | path | Article key |
GET /v1/articulos/buscar 1 credit
Search articles
Permission leyes:read. Search by text and by meaning.
| Parameter | In | Description |
q required | query | Search text (3 to 200 characters) |
entidad | query | «Federal» or the name of a Mexican state |
pagina | query | Page 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.
| Parameter | In | Description |
q required | query | Search text (3 to 200 characters) |
pagina | query | Page 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.
| Parameter | In | Description |
registro required | path | Digital registry number |
GET /v1/sentencias/buscar 2 credits
Search rulings
Permission sentencias:read (enabled per account).
| Parameter | In | Description |
q required | query | Search text (3 to 200 characters) |
pagina | query | Page 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).
| Parameter | In | Description |
id required | path | Ruling id |
GET /v1/uso No cost
Usage, limits and credits of your key
Uses no credits.