Docs / ConvencionesConventionsMarkdown

Convenciones

URL base y formato#

Todas las rutas cuelgan de https://pricto.dev/v1. Las respuestas son JSON con data (el resultado), meta (costo, fuente, idioma, moneda, avisos) y, en las listas, pagination. Los campos nuevos se agregan sin aviso: ignora los que no conozcas.

Paginación#

Por cursor. Si pagination.has_more es true, pide la página siguiente con cursor=<pagination.next_cursor> y los mismos filtros. limit tiene un máximo por endpoint (20 en búsqueda).

json
{
  "pagination": {
    "has_more": true,
    "next_cursor": "eyJvIjoyfQ"
  }
}

Filtros comunes#

ParámetroQué filtraEjemplo
countryPaís, ISO 3166-1CL
retailerUna o más tiendas, separadas por comacl-jumbo,cl-unimarc
categoryCategoría, incluye subcategoríasfood.dairy
brandMarca, por id o nombrecolun
locationComuna, CL:<código CUT> o tienda, en tiendas que cambian precio por ubicaciónLas Condes
as_ofPrecios vigentes en una fecha pasada2026-10-01
from, to, intervalRango e intervalo del historialinterval=week
min_confidence, match_kindsQué ofertas se agrupan con el producto (ver Modelo de datos)identical,pack

Idioma#

lang=es o lang=en (o la cabecera Accept-Language) cambia el idioma de nombres, categorías, mensajes y errores. Un idioma sin soporte responde en inglés con un aviso, nunca con error. El título original de la tienda siempre viene sin traducir en title_original.

Moneda#

Los montos vienen en la moneda de la tienda (CLP, sin decimales). Con currency=USD (o EUR) cada precio trae además un bloque converted con el monto, la tasa, su fecha y su fuente. En el historial, cada punto se convierte con la tasa de su fecha (fx_policy: point_date), o con una sola tasa si pasas fx_date.

Fechas e identificadores#

  • Fechas y horas en ISO 8601 y UTC (observed_at); observed_local_date es la fecha en la zona de la tienda.
  • Los ids son opacos y llevan prefijo de tipo: prd_ producto, ofr_ oferta, str_ tienda, exp_ exportación. Tiendas y categorías usan nombres legibles: cl-jumbo, food.dairy.milk.
  • Donde se pide un producto se acepta también su código de barras (GTIN).

Cabeceras#

CabeceraQué trae
X-Request-IdId del pedido, para soporte
X-Credits-Charged, X-Credits-Deduplicated, X-Credits-Remaining, X-Credits-Period-ResetCosto y saldo
RateLimit-Limit, RateLimit-Remaining, RateLimit-ResetLímite de consultas
Retry-AfterEn 429 y 503: cuántos segundos esperar

Versionado#

La versión mayor va en la ruta (/v1). Dentro de ella solo hay cambios que agregan: campos, parámetros u operaciones nuevas. Un cambio incompatible crea /v2, y /v1 se mantiene al menos 12 meses, avisado con las cabeceras Deprecation y Sunset. En MCP, el nombre de una herramienta es parte del contrato: si cambia de forma incompatible, sale con otro nombre. Los cambios se publican en el changelog.

Estado#

GET /v1/status (sin key) dice si la API responde y la fecha de los datos. La página de estado muestra lo mismo para personas.

Conventions

Base URL and format#

Every path hangs from https://pricto.dev/v1. Responses are JSON with data (the result), meta (cost, source, language, currency, notices) and, for lists, pagination. New fields are added without notice: ignore the ones you don't know.

Pagination#

By cursor. If pagination.has_more is true, ask for the next page with cursor=<pagination.next_cursor> and the same filters. limit has a maximum per endpoint (20 for search).

json
{
  "pagination": {
    "has_more": true,
    "next_cursor": "eyJvIjoyfQ"
  }
}

Common filters#

ParameterFilters byExample
countryCountry, ISO 3166-1CL
retailerOne or more stores, comma separatedcl-jumbo,cl-unimarc
categoryCategory, including subcategoriesfood.dairy
brandBrand, by id or namecolun
locationComuna, CL:<CUT code> or store, for stores that price by locationLas Condes
as_ofPrices in effect on a past date2026-10-01
from, to, intervalHistory range and intervalinterval=week
min_confidence, match_kindsWhich offers are grouped with the product (see Data model)identical,pack

Language#

lang=es or lang=en (or the Accept-Language header) changes the language of names, categories, messages and errors. An unsupported language answers in English with a notice, never with an error. The store's original title always comes untranslated in title_original.

Currency#

Amounts come in the store's currency (CLP, no decimals). With currency=USD (or EUR) every price also carries a converted block with the amount, the rate, its date and its source. In history, each point is converted at its own date's rate (fx_policy: point_date), or with a single rate if you pass fx_date.

Dates and identifiers#

  • Dates and times in ISO 8601, UTC (observed_at); observed_local_date is the date in the store's time zone.
  • Ids are opaque and carry a type prefix: prd_ product, ofr_ offer, str_ store, exp_ export. Stores and categories use readable names: cl-jumbo, food.dairy.milk.
  • Wherever a product is asked for, its barcode (GTIN) is accepted too.

Headers#

HeaderWhat it carries
X-Request-IdRequest id, for support
X-Credits-Charged, X-Credits-Deduplicated, X-Credits-Remaining, X-Credits-Period-ResetCost and balance
RateLimit-Limit, RateLimit-Remaining, RateLimit-ResetRequest limit
Retry-AfterOn 429 and 503: how many seconds to wait

Versioning#

The major version is in the path (/v1). Within it there are only additive changes: new fields, parameters or operations. An incompatible change creates /v2, and /v1 stays for at least 12 months, announced with the Deprecation and Sunset headers. In MCP, a tool's name is part of the contract: if it changes incompatibly, it ships under another name. Changes are published in the changelog.

Status#

GET /v1/status (no key) says whether the API is up and the date of the data. The status page shows the same for people.