Dates and historical requests

Pacífico distinguishes publication time, effective time, and optional tenor time. dateStart and dateEnd filter effective dates; they do not mean “when this client downloaded the data.”

Accepted inputs

Pass datetime.date values:

from datetime import date

data = pacifico.request(
    "token.key",
    ticker="CHILE",
    dateStart=date(2026, 7, 1),
    dateEnd=date(2026, 7, 31),
)

datetime.datetime is also date-compatible in the current validators, but use matching date objects unless time-of-day input is explicitly required. The request contract is day-based and the fixing is carried separately.

Strings such as "2026-07-31" are not accepted by the public Python request path.

Validation

  • dateStart and dateEnd must be datetime.date-compatible objects.
  • dateEnd must be greater than or equal to dateStart.
  • A reversed interval raises ValueError in the client before the request is posted.
  • The server treats a historical end day as inclusive through 23:59.

Default and latest behavior

Both date parameters default to the date on which pacifico.core.main.pacifico was imported. When that date equals the server's current date, the service uses its latest-data path rather than requiring an observation dated today.

For values, latest-response formatting suppresses observations whose effective timestamp is older than 500 days. Reports do not apply the same latest-result freshness filter.

Long-running process

Python evaluates these default arguments at module import. A worker that remains alive across midnight can keep yesterday's default dates. Pass dateStart=date.today() and dateEnd=date.today() explicitly for each scheduled snapshot.

Value history rules

For dependable multi-day value history:

  1. include a non-empty ticker (one or a list);
  2. use VersionType.Version_Pricing or another non-prediction path;
  3. pass an ordered date interval.

Current server normalization behaves as follows:

Value request Date range Resulting time selection
At least one ticker, non-prediction Multi-day Requested range retained
Broad selector or prediction version 10 days or less Requested range retained
Broad selector or prediction version More than 10 days Reset to default latest/today interval
Any selector One date Requested date retained

The 10-day check uses the absolute calendar-day difference between start and end. Client validation already prevents a reversed range.

The original values tutorial gives the conservative rule that history requires a ticker. Follow that rule for stable integrations even though the current server permits short broad intervals.

Report history rules

For a multi-day report interval, all of these must hold:

  • document is non-empty;
  • item is non-empty;
  • the version type is not prediction.

Otherwise, the current server resets a multi-day report interval to its default latest/today interval. A single-date request is retained when at least document or item makes the report itself valid.

from datetime import date, timedelta

end = date.today()
start = end - timedelta(days=30)

reports = pacifico.request(
    "token.key",
    document="<DOCUMENT>",
    item="<ITEM>",
    dateStart=start,
    dateEnd=end,
)

Fixing

fixing filters the publication fixing:

from pacifico import Fixing

intraday = pacifico.request(
    "token.key",
    ticker="CHILE",
    dateStart=date.today(),
    dateEnd=date.today(),
    fixing=Fixing.F_1200,
    format="dictionary",
)

Fixing.EOD is the default and represents end of day. Intraday members are half-hour slots. Pass the enum itself; strings and integers fail the field type check for value and report routes.

For non-EOD values, prefer JSON or dictionary output. The server includes the fixing in the publication key (such as 31/07/2026-F_1200), but this package version's value DataFrame converter parses only a plain publication date and may return a synthetic error row.

Date meanings in results

Field Meaning
Date Publication Day on which the source published the fact; fixing can distinguish an intraday publication
Date Effective Time for which the value or fact applies; it may differ from publication
Date Tenor Maturity/tenor date when relevant, otherwise blank

The DataFrame converter parses the canonical API date strings:

  • publication: DD/MM/YYYY;
  • effective and tenor: DD/MM/YYYY HH:MM:SS.

Large report responses can instead contain ISO-format timestamps, which the converter also parses. Date objects are naive and carry no timezone information in the client schema. Normalize timezone and business-calendar assumptions in the consuming application.

There is no dedicated “streaming date” column in the current client DataFrames.

Confirm that a range was honored

Because some disallowed ranges are normalized rather than rejected, validate the result:

requested_start = start
requested_end = end

effective = reports["Date Effective"]
if not effective.empty:
    observed_start = effective.min().date()
    observed_end = effective.max().date()
    print(requested_start, requested_end, observed_start, observed_end)

An empty result is not proof of normalization; the requested period may simply contain no data. For audit-sensitive jobs, retain the request parameters and verify expected boundaries against the returned dates.