<!-- https://pricto.dev/docs/api/get-offer-history · versión en inglés: https://pricto.dev/docs/api/get-offer-history.en.md -->

# Observaciones de una oferta

`GET https://pricto.dev/v1/offers/{offer_id}/history`

Observations of a single offer

| Créditos | MCP |
|---|---|
| 1 per 30 points (minimum 1) | — |

## Parámetros

| Parámetro | En | Tipo | Descripción |
|---|---|---|---|
| `offer_id` **requerido** | path | `string` |  |
| `fx_date` | query | `string (date)` | Convert every amount with the rate of this date instead of the rate of each observation's own date. |
| `max_credits` | query | `number` | Spend at most this many credits on this call. Results are cut to fit and `meta.usage.truncated` is true. |
| `dry_run` | query | `boolean` | Return the quote in `meta.usage` with `data` set to null, without charging. Default: `false`. |
| `from` | query | `string (date)` | Start date, inclusive. Defaults to 90 days before `to`. |
| `to` | query | `string (date)` | End date, inclusive. Defaults to today. |
| `interval` | query | `string` |  Valores / values: `raw`, `day`, `week`, `month`. Default: `day`. |
| `currency` | query | `string` | Add converted amounts in this ISO 4217 currency. `local` (default) returns source currency only. Default: `local`. |

## Respuesta

`200` History of one offer.

| Campo | Tipo | Descripción |
|---|---|---|
| `data` **requerido** | `object` |  |
| `data.product_id` | `string \| null` |  |
| `data.interval` **requerido** | `string` |  |
| `data.from` **requerido** | `string (date)` |  |
| `data.to` **requerido** | `string (date)` |  |
| `data.currency` **requerido** | `string` | Currency of points (always the local currency). |
| `data.converted_currency` | `string \| null` |  |
| `data.fx_policy` | `string \| null` | Valores / values: `point_date`, `fixed`. |
| `data.series` **requerido** | `object[]` |  |
| `data.series[].retailer` **requerido** | `RetailerRef` |  |
| `data.series[].retailer.id` **requerido** | `string` |  |
| `data.series[].retailer.name` **requerido** | `string` |  |
| `data.series[].offer_id` **requerido** | `string` |  |
| `data.series[].match` **requerido** | `object` | Same offers as /prices (default identical, confidence >= 0.85). With match_kinds=identical,pack a pack series has kind pack and pack_ratio: points are the pack price, divide by pack_ratio for the unit price. null only in the history of an offer not linked to a product. |
| `data.series[].points` **requerido** | `HistoryPoint[]` |  |
| `data.series[].points[].t` **requerido** | `string` | Date (`day`, `week`, `month` start) or timestamp (`raw`). |
| `data.series[].points[].price` **requerido** | `number` |  |
| `data.series[].points[].list_price` **requerido** | `number` |  |
| `data.series[].points[].sale_price` | `number \| null` |  |
| `data.series[].points[].card_price` | `number \| null` |  |
| `data.series[].points[].availability` **requerido** | `string` | Valores / values: `in_stock`, `out_of_stock`, `limited`, `unknown`. |
| `data.series[].points[].converted` | `object` | Present when `currency` is set. Converted with the rate of the point date (or fx_date). |
| `data.series[].summary` **requerido** | `SeriesSummary` |  |
| `data.series[].summary.first` **requerido** | `number \| null` |  |
| `data.series[].summary.last` **requerido** | `number \| null` |  |
| `data.series[].summary.min` **requerido** | `number \| null` |  |
| `data.series[].summary.max` **requerido** | `number \| null` |  |
| `data.series[].summary.change_pct` **requerido** | `number \| null` | (last - first) / first × 100 in local currency, rounded to 1 decimal. |
| `data.series[].summary.converted` | `object` | Summary in the requested currency, each point at its own rate, so the change includes FX. |
| `data.series[].summary.changes` **requerido** | `integer` | Number of times `price` changed in the period. |
| `data.series[].summary.days_on_promotion` | `integer` |  |
| `meta` **requerido** | `Meta` |  |

`meta` trae el costo, la fuente para citar, el idioma, la moneda y los avisos (ver [Convenciones](/docs/convenciones)).

## Errores

- [`unauthorized`](/docs/errores#unauthorized)
- [`not_found`](/docs/errores#not_found)

## Ejemplo

```bash
curl "https://pricto.dev/v1/offers/ofr_01nuni/history?interval=month" \
  -H "Authorization: Bearer sk_test_sandbox"
```
```python
import requests

API_KEY = "sk_test_sandbox"

r = requests.get(
    "https://pricto.dev/v1/offers/ofr_01nuni/history",
    params={"interval": "month"},
    headers={"Authorization": f"Bearer {API_KEY}"},
)
print(r.status_code, r.json())
```
```js
const API_KEY = "sk_test_sandbox";

const res = await fetch(`https://pricto.dev/v1/offers/ofr_01nuni/history?${new URLSearchParams({"interval":"month"})}`, {
  headers: { Authorization: `Bearer ${API_KEY}` },
});
console.log(res.status, await res.json());
```

```json
{
  "data": {
    "product_id": "prd_01colu",
    "interval": "month",
    "from": "2026-07-26",
    "to": "2026-10-23",
    "currency": "CLP",
    "converted_currency": null,
    "fx_policy": null,
    "series": [
      {
        "retailer": {
          "id": "cl-unimarc",
          "name": "Unimarc"
        },
        "offer_id": "ofr_01nuni",
        "points": [
          {
            "t": "2026-07-01",
            "price": 1090,
            "list_price": 1090,
            "sale_price": null,
            "card_price": null,
            "availability": "in_stock"
          },
          {
            "t": "2026-08-01",
            "price": 1090,
            "list_price": 1090,
            "sale_price": null,
            "card_price": null,
            "availability": "in_stock"
          },
          "… 2 más / more"
        ],
        "summary": {
          "first": 1090,
          "last": 1090,
          "min": 1090,
          "max": 1090,
          "change_pct": 0,
          "changes": 0,
          "days_on_promotion": 20
        },
        "match": {
          "method": "gtin",
          "confidence": 0.99,
          "kind": "identical",
          "pack_ratio": null
        }
      }
    ]
  },
  "meta": {
    "request_id": "req_954f1356418a4bd485bb",
    "attribution": {
      "text": "Fuente: Pricto · Unimarc, página pública, 23-10-2026 08:00 CLST · example.com/… · ofr_01nuni",
      "source": "Pricto",
      "as_of": "2026-10-23T11:00:00Z",
      "resource_id": "ofr_01nuni",
      "url": null,
      "capture_method": "public_page",
      "source_url": "https://example.com/cl-unimarc/leche-entera-colun-1-l"
    },
    "credits_charged": 0,
    "credits_deduplicated": 1,
    "credits_remaining": 14988,
    "period_resets_at": "2026-11-01T00:00:00.000Z",
    "usage": {
      "credits_charged": 0,
      "credits_deduplicated": 1,
      "truncated": false,
      "truncated_reason": null,
      "dry_run": false,
      "units": {
        "history_points": 4
      }
    },
    "lang": "es",
    "currency": "local",
    "data_as_of": "2026-10-23T11:00:00Z",
    "fx_policy": null,
    "warnings": [
      "synthetic_data: datos sintéticos de ejemplo / synthetic sample data"
    ]
  }
}
```
