> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cbpayapp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Qscore Index

> Read the public quarterly Qscore Index with anonymous country, industry and risk-band buckets.

export const EnvUrls = ({lang = "en"}) => {
  const T = {
    en: {
      test: "Test",
      live: "Live",
      hint: "Same API on both environments — build against test first, then go live by swapping the base URL and the key.",
      guide: "Environments and testing",
      href: "/en/environment-testing"
    },
    es: {
      test: "Test",
      live: "Live",
      hint: "La misma API en ambos ambientes — construye primero contra test y pasa a live cambiando la URL base y la key.",
      guide: "Entorno y pruebas",
      href: "/es/entorno-y-pruebas"
    },
    zh: {
      test: "Test",
      live: "Live",
      hint: "两个环境的 API 完全一致——先在 test 环境构建，再通过切换基础 URL 和密钥上线。",
      guide: "环境与测试",
      href: "/zh/environment-testing"
    }
  };
  const t = T[lang] || T.en;
  const row = (label, url, keyPattern, badgeCls) => <div className="flex flex-wrap items-center gap-2 px-3 py-2">
      <span className={"rounded px-1.5 py-0.5 text-xs font-semibold uppercase tracking-wide " + badgeCls}>
        {label}
      </span>
      <code className="text-xs">{url}</code>
      <span className="text-xs text-gray-400 dark:text-zinc-500">·</span>
      <code className="text-xs">{keyPattern}</code>
    </div>;
  return <div className="my-4 rounded-xl border border-gray-200 dark:border-zinc-700 divide-y divide-gray-200 dark:divide-zinc-700 text-sm not-prose">
      {row(t.test, "https://cryptobank.qbank.cl/platform", "pk_test_...", "bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300")}
      {row(t.live, "https://api.qbank.cl/platform", "pk_...", "bg-emerald-100 text-emerald-800 dark:bg-emerald-900/40 dark:text-emerald-300")}
      <p className="px-3 py-2 text-xs text-gray-500 dark:text-zinc-400 m-0">
        {t.hint} <a href={t.href}>{t.guide} →</a>
      </p>
    </div>;
};

<EnvUrls lang="en" />

The Qscore Index is a public, aggregate view of quarterly score
distributions. It is an informational index, not a lookup of a person or
company. It never exposes RUTs, account IDs or a population smaller than the
minimum bucket size.

```mermaid theme={"theme":{"light":"github-light","dark":"github-dark"}}
flowchart LR
    C[Your system] --> I[GET /v1/qscore/index]
    I --> F[period + country + industry filters]
    F --> B[Anonymous buckets with at least 5 subjects]
```

## Read the index

`GET /v1/qscore/index` is public and requires no credential. If `period` is
omitted, the API selects the most recently closed UTC quarter. Optional
filters are:

| Query           | Description                                             |
| --------------- | ------------------------------------------------------- |
| `period`        | Closed quarter in the exact `YYYY-Q1`…`YYYY-Q4` format. |
| `country`       | ISO 3166-1 alpha-2 country filter.                      |
| `industry_code` | Industry/ISIC code filter.                              |

```bash Public index theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl "https://api.qbank.cl/platform/v1/qscore/index?period=2026-Q2&country=CL&industry_code=6499"
```

```json 200 OK theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "period": "2026-Q2",
  "country": "CL",
  "industry_code": "6499",
  "items": [
    {
      "period": "2026-Q2",
      "country": "CL",
      "industry_code": "6499",
      "band": "B",
      "subject_count": 12,
      "avg_score": 742,
      "created_at": "2026-07-01T00:00:00Z"
    }
  ],
  "methodology": "quarterly anonymous buckets; each bucket requires at least five subjects"
}
```

`items` is ordered by country, industry code and band. There is no pagination:
the endpoint returns the filtered snapshot.

## Methodology and privacy

At the end of each quarter, the index takes the latest score of each subject
whose score existed before the quarter closed. It groups by country, industry
code and score band (`A`, `B`, `C`, `D`, `E` or `SC`). A bucket is published
only when it contains at least **five subjects**. `avg_score` is the rounded
integer average of the scores in that bucket.

The index is append-only by period and bucket. It is not a live score for any
individual, and the API does not expose a subject-level drill-down.

## Response states and period validation

|                 HTTP | Meaning                                                 | Action                        |
| -------------------: | ------------------------------------------------------- | ----------------------------- |
|                `200` | Filtered quarterly snapshot                             | Read the anonymous `items`    |
| `400 invalid_period` | The period is malformed or outside the supported format | Send a closed `YYYY-Qn` value |

Valid values are `YYYY-Q1`, `YYYY-Q2`, `YYYY-Q3` and `YYYY-Q4`. The year must
be between 2020 and 9999. An invalid value returns `400 invalid_period`.
See the [error catalog](/en/errors).

## Authenticated equivalent

`GET /v1/qscore/index/account` returns the same snapshot and filters for an
authenticated account or organization read scope. Account-level callers must
have the `risk` service enabled; administrative read scopes are not tied to a
single account flag.

The index does not charge a fee, emit a webhook or send an email.

## FAQ

<AccordionGroup>
  <Accordion title="Can I identify a subject from a bucket?">
    No. Buckets with fewer than five subjects are omitted and the response
    never contains document or account identifiers.
  </Accordion>

  <Accordion title="Does an omitted period mean the current quarter?">
    No. It means the most recently closed UTC quarter, so a partially completed
    quarter is never presented as final.
  </Accordion>

  <Accordion title="Can I request only one industry?">
    Yes. Send `industry_code` together with `country` and `period`.
  </Accordion>
</AccordionGroup>
