Buscar reglas

GET
/v1/search

Searches the SAT's rules in force on asOf by meaning and by exact code, and returns the matching passages verbatim with their source; format=brief returns each one's heading path and an excerpt instead.

Autorización

headerAuthorizationBearer <token>

An API key from the dashboard (/keys), cdc_….

Parámetros de consulta

q*string

The question or code, in Spanish or English, such as CFDI40149 or código postal del receptor con RFC genérico.

Longitud1 <= length <= 1000
asOf?string

Only rules in force on this date, YYYY-MM-DD. Defaults to today in Mexico City.

Formato^\d{4}-\d{2}-\d{2}$
source?array<string>

Only these sources: repeat it for several (?source=anexo-20-guia-de-llenado&source=matriz-de-errores-cfdi-40). The ids are the ones /v1/sources lists, such as rmf-2026.

Elementositems <= 10
kind?string

Only one kind of passage: guia for the filling guides, which define each field (ask what a field means with guia); anexo for the validation matrix; regla for the RMF reglas; ley for the CFF's articles.

Value in"ley""reglamento""regla""anexo""guia""criterio"
limit?integer

How many passages to return; 5 by default.

Rango1 <= value <= 50
format?string

full (the default) quotes each passage's matched text; brief gives its heading path and an excerpt of at most 320 characters around the question's words, cut from the text verbatim, for /v1/passages/{id} to read the one that answers.

Value in"full""brief"

Respuesta

The matching passages, best first.

application/json
  1. response
data*|
meta*
Petición de ejemplo
curl -X GET 'https://codice.io/v1/search?q=string'
Respuesta de ejemplo
{
  "data": {
    "query": "string",
    "asOf": "string",
    "source": [
      "string"
    ],
    "kind": "string",
    "format": "full",
    "results": [
      {
        "passageId": "string",
        "source": "string",
        "quote": "string",
        "authority": "string",
        "kind": "string",
        "validFrom": "string",
        "validUntil": "string",
        "score": 0,
        "scoring": {
          "keywordScore": 0,
          "vectorScore": 0,
          "rerankingScore": 0
        },
        "sourceTitle": "string",
        "sourceUrl": "string",
        "sourcePublishedAt": "string"
      }
    ]
  },
  "meta": {
    "requestId": "string"
  }
}