Pacífico Python Client

The Pacífico Python Client is the Python interface to Pacifico Research's financial-data API. It turns one call—pacifico.request(...)—into an authenticated value, report, metadata, or hosted-application request, waits for asynchronous delivery, and returns JSON, a Python dictionary, or a pandas.DataFrame.

This site documents package version 0.0.9.42 as represented by the current source tree.

API access is separate from package installation

The package can be installed from PyPI, but successful requests require a token issued by Pacifico Research. The data universe, hosted applications, and permitted operations can vary by token.

First request

Install the package:

python -m pip install pacifico

For the fastest interactive availability check, open this template, replace YOUR_API_TOKEN in the browser address bar with your token, and reload:

https://api.pacificoindices.com/?token=<YOUR_API_TOKEN>&ticker=BTP0610456

The production edge accepts this query-token form for a quick browser check. A successful request returns the current JSON available for BTP0610456.

Use the browser URL only for a quick check

Query-string tokens can remain in browser history, proxy logs, and copied URLs. Use a trusted browser, never share the completed URL, and prefer the Python client or an x-api-key header for normal integrations.

For the recommended Python workflow, place the token supplied by Pacifico Research in a local file named token.key, then request the same instrument:

import pacifico

values = pacifico.request("token.key", ticker="BTP0610456")
print(values.head())

The default return value is a DataFrame. The client sends the token as an x-api-key header, receives a temporary result location, polls it until processing finishes, converts the response, and returns it.

Choose a workflow

Goal Start here
Install in a script, notebook, or virtual environment Installation
Store and load a token safely Authentication
Retrieve prices, yields, or other instrument fields Values
Retrieve entity or instrument reports Reports
Discover available tickers, documents, and authors Metadata discovery
Run a server-hosted financial model Hosted applications
Understand every argument and default pacifico.request reference
Diagnose timeouts, parsing rows, or type failures Errors and troubleshooting

One function, three routes

pacifico.request(...) chooses a route from the arguments:

  1. A non-empty app selects a hosted application.
  2. Otherwise, any non-empty report selector—document, item, chapter, section, subsection, or paragraph—selects reports.
  3. Otherwise, the request selects values. With no value selectors and no author, this becomes value-metadata discovery.

The order matters. An application request takes precedence over report and value selectors. See Request routing before building wrappers that assemble arguments dynamically.

Data models at a glance

Value data follows the instrument hierarchy:

Country → Market → Group → Family → Ticker → field values

Report data follows a document hierarchy:

Document → Chapter → Section → Subsection → Paragraph → Item → typed value

Both models carry publication, effective, and optional tenor dates. See Formats and schemas for exact JSON nesting and DataFrame columns.

Operational expectations

  • Requests are synchronous from the caller's perspective but asynchronously delivered by the API.
  • Default polling allows up to 300 seconds and checks every 0.5 seconds.
  • DataFrame conversion is convenient, but raw json is the best diagnostic format because conversion can turn malformed responses into an error row.
  • Historical access has selector-dependent normalization rules. Read Dates and history before assuming a requested range was honored.
  • The source spelling timeFrecuency is part of the public API and must be used exactly.

Where to go next

New users should follow Installation, Authentication, and the Quickstart in order. Production integrations should also review Delivery and polling, Security, and the complete request reference.