# Bolsa de Santiago – IPSA, Acciones y Renta Fija (Brain Data) (`better-llama/bolsa-santiago-brain-data`) Actor

Bolsa de Santiago API Brain Data as clean JSON: IPSA/IGPA indices, stock instruments, quotes, trades, dividends, fixed income, financial intermediation and clearing data, using your own key (free trial or paid plan). Read-only. Not affiliated with Bolsa de Santiago.

- **URL**: https://apify.com/better-llama/bolsa-santiago-brain-data.md
- **Developed by:** [Francisco Rubio](https://apify.com/better-llama) (community)
- **Categories:** Developer tools, AI
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 resultado entregado / delivered results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Bolsa de Santiago – IPSA, Acciones y Renta Fija (Brain Data)

**ES** · La **API Brain Data de la Bolsa de Comercio de Santiago** como JSON limpio para agentes de IA, analistas y desarrolladores: **índices (IPSA, IGPA…)**, **instrumentos**, **precios de cierre**, **puntas**, **transacciones**, **resumen por acción**, **dividendos y variaciones de capital**, además de **renta fija**, **intermediación financiera** y **compensación y garantías** según tu plan. Solo lectura.
**EN** · Bolsa de Santiago's official API Brain Data as clean JSON: IPSA/IGPA indices, instruments, closing prices, order-book tops, trades, per-stock summary, dividends/capital changes, plus fixed income, money-market and clearing data depending on your plan. Read-only.

> 🔑 **API Key opcional / Optional key.** Funciona sin key cuando el operador del Actor tiene configurada su clave compartida (solo operaciones del plan gratuito, con tope de 25 solicitudes y 2.000 filas por ejecución para repartir la cuota). Opcionalmente usa la tuya para mayor cuota y para planes pagados: regístrate en <https://api-braindata.bolsadesantiago.com>, suscríbete al plan **«API Free trial» (gratis**, fin de día y set limitado de instrumentos) o a un plan pagado («API Mercado de Valores», «Compensación y Garantías») y copia tu **API Key** desde tu perfil. Si la clave compartida no está disponible, el Actor te lo indica y te pide la tuya.
>
> ⚠️ **No afiliado / Not affiliated.** Proyecto independiente. **No está afiliado, patrocinado ni aprobado por la Bolsa de Comercio de Santiago.** El nombre se usa solo para describir la fuente. No es asesoría financiera.

### Uso con agentes de IA (MCP)

```
https://mcp.apify.com/?tools=better-llama/bolsa-santiago-brain-data
```

Ejemplos: *«¿Cómo cerró el IPSA ayer?»*, *«Transacciones de SQM-B esta semana»*, *«Dividendos y aumentos de capital de CHILE»*, *«Mejores puntas de COPEC»*.

### Operaciones / Operations

| `operation` | Productos | Requeridos |
|---|---|---|
| `indices` (defecto) | free_trial, mercado_valores | (pagado: `indice`, `periodo`, `fecha`) |
| `instrumentos` | free_trial, mercado_valores | (pagado: `mercado`) |
| `precios` | mercado_valores | `nemos` |
| `puntas` | free_trial, mercado_valores | — (`nemos` opcional en plan pagado) |
| `transacciones` | free_trial, mercado_valores | `nemos`, rango de fechas |
| `resumen_accion` | free_trial, mercado_valores | `nemos`, `periodo` |
| `variaciones_capital` | free_trial, mercado_valores | `nemos` |
| `rf_instrumentos`, `rf_indices`, `rf_transacciones`, `rf_resumen_transacciones`, `rf_benchmark` | mercado_valores | según la operación (`familia`, `indice`, `periodo`, fechas) |
| `if_instrumentos`, `if_transacciones`, `if_resumen_transacciones` | mercado_valores | `emisor`, `periodo`, fechas |
| `cg_saldo_neto`, `cg_posicion_neta`, `cg_garantia` | compensacion | `camara` / `grupo`, `fecha` |

`product` se elige automáticamente (plan gratuito si la operación existe en él). Si tu plan no incluye la operación, la API responde 404 y el Actor te lo explica.

### Comportamiento

- Clave (propia o compartida) enviada solo por cabecera `Ocp-Apim-Subscription-Key`, en un campo **secreto** (cifrado por Apify), nunca escrita en logs.
- Paginación automática (`TOTAL_PAGINAS`, `numeroFilas` hasta 500), un nemotécnico a la vez, pausa de 1 s entre solicitudes y reintentos con espera exponencial ante 429/5xx.
- Errores claros: clave inválida o suscripción inactiva (401), cuota agotada (403/429), operación fuera de tu plan (404), parámetros rechazados (400).
- Salida normalizada: `operation`, `product`, `nemo`, `market`, `date` (AAAA-MM-DD) y `fields` con los campos originales en camelCase y números ya convertidos (coma decimal incluida).

### Precio / Pricing

Pago por resultado (*pay per event*): evento `result` por cada fila entregada. Puedes fijar un gasto máximo por ejecución. El costo de tu plan en la Bolsa es aparte.

### Input

```json
{ "operation": "indices" }
```

```json
{ "apiKey": "TU-API-KEY", "operation": "transacciones", "nemos": ["SQM-B", "CHILE"], "fechaDesde": "2026-11-02", "fechaHasta": "2026-11-06" }
```

```json
{ "apiKey": "TU-API-KEY", "product": "mercado_valores", "operation": "rf_benchmark", "indice": "BCU", "fecha": "2026-11-10" }
```

### Output

```json
{
  "operation": "transacciones",
  "product": "free_trial",
  "nemo": "SQM-B",
  "market": "ACC",
  "date": "2026-11-10",
  "fields": { "nemo": "SQM-B", "mercado": "ACC", "precio": 40010, "cantidad": 100, "monto": 4000000, "fecha": "20261110", "hora": "10:30" },
  "officialUrl": "https://www.bolsadesantiago.com",
  "dataSource": "Bolsa de Comercio de Santiago – API Brain Data",
  "retrievedAt": "2026-11-12T19:00:00.000Z"
}
```

Los nombres exactos de `fields` son los que define la API para cada operación.

### English

Works without a key when the operator's shared key is configured (free-trial operations only, capped per run); optionally pass your own API Brain Data key (`apiKey`, stored as a secret) for higher quota and paid plans. Pick an `operation`, and get one normalized row per item. The free "API Free trial" plan covers end-of-day equity indices, instruments, order-book tops, trades, per-stock summaries and capital changes; paid plans add closing prices, fixed income, money market and clearing. Errors for invalid keys, exhausted quotas and operations outside your plan are explicit. Not affiliated with Bolsa de Santiago; not investment advice.

### Más conectores de Chile / More Chilean data connectors

Este Actor es parte de **Better Llama**, una colección de conectores de datos públicos y empresariales de Chile (licitaciones, UF y dólar, energía, bencina, envíos, bolsa y más) con JSON limpio y pago por resultado. Catálogo completo: <https://betterllama.com>.

Part of **Better Llama**, a collection of Chilean data connectors for developers and AI agents. Full catalog: <https://betterllama.com/en/>.

# Changelog

This Actor's version history is a separate document: https://apify.com/better-llama/bolsa-santiago-brain-data/changelog.md

# Actor input Schema

## `apiKey` (type: `string`):

Opcional. Sin clave, el Actor usa una clave compartida del operador cuando está configurada (solo plan gratuito, con tope de 25 solicitudes y 2.000 filas por ejecución). Ingresa tu propia API Key (https://api-braindata.bolsadesantiago.com → plan «API Free trial» gratis o un plan pagado) para mayor cuota y planes pagados. Cifrada; nunca se registra en logs. / Optional: your own key for higher quota.

## `operation` (type: `string`):

Qué consultar. El plan gratuito incluye índices, instrumentos, puntas, transacciones, resumen de acción y variaciones de capital (renta variable, fin de día).

## `product` (type: `string`):

Producto de tu suscripción. Por defecto: «free_trial» si la operación lo ofrece; si no, «mercado_valores» (renta variable, renta fija e intermediación financiera) o «compensacion».

## `nemos` (type: `array`):

Ej. SQM-B, CHILE, COPEC. Requerido en transacciones, resumen_accion, variaciones_capital, precios y rf_transacciones; se consulta uno por uno.

## `fechaDesde` (type: `string`):

AAAA-MM-DD. Por defecto: 7 días antes de «Hasta».

## `fechaHasta` (type: `string`):

AAAA-MM-DD. Por defecto: hoy (Chile).

## `fecha` (type: `string`):

AAAA-MM-DD. Para índices (plan pagado), rf_benchmark y cg_garantia.

## `indice` (type: `string`):

Código del índice (p. ej. IPSA) para índices del plan pagado, rf_indices y rf_benchmark.

## `periodo` (type: `string`):

Período tal como lo define la API (resumen_accion, índices, resúmenes).

## `mercado` (type: `string`):

Mercado para instrumentos del plan pagado (p. ej. ACC, CFI).

## `dividendo` (type: `boolean`):

Solo índices del plan pagado.

## `condicionLiquidacion` (type: `string`):

Opcional para puntas (plan pagado).

## `familia` (type: `string`):

Requerida en rf_instrumentos y rf_resumen_transacciones.

## `emisor` (type: `string`):

Requerido en if_transacciones e if_resumen_transacciones.

## `camara` (type: `string`):

Requerida en cg_saldo_neto y cg_posicion_neta.

## `codigoCorredor` (type: `string`):

Opcional en compensación.

## `grupo` (type: `string`):

Requerido en cg_garantia.

## `maxItems` (type: `integer`):

Tope de filas a entregar (se cobra por fila).

## `pageSize` (type: `integer`):

numeroFilas (máx. 500) en planes pagados.

## `maxPages` (type: `integer`):

Tope de páginas por consulta.

## `requestIntervalMs` (type: `integer`):

Pausa mínima entre llamadas para respetar la cuota de tu plan.

## `maxRetries` (type: `integer`):

Reintentos con espera exponencial ante 429/5xx.

## `includeRaw` (type: `boolean`):

Agrega «raw» con la fila tal como la entrega la API.

## Actor input object example

```json
{
  "operation": "indices",
  "nemos": [
    "SQM-B"
  ],
  "dividendo": false,
  "maxItems": 1000,
  "pageSize": 500,
  "maxPages": 20,
  "requestIntervalMs": 1000,
  "maxRetries": 4,
  "includeRaw": false
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "nemos": [
        "SQM-B"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("better-llama/bolsa-santiago-brain-data").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "nemos": ["SQM-B"] }

# Run the Actor and wait for it to finish
run = client.actor("better-llama/bolsa-santiago-brain-data").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "nemos": [
    "SQM-B"
  ]
}' |
apify call better-llama/bolsa-santiago-brain-data --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,better-llama/bolsa-santiago-brain-data"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/in57TOutrtLkKlzwN/builds/NYbfD8s30V1RiAXee/openapi.json
