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

# Scelta di un percorso dati o analitico

> Come scegliere il percorso API di Credit Benchmark più adatto per dati grezzi delle entità, analisi calcolate, individuazione dei metadati, andamenti del portafoglio, variazioni dei rating o distribuzioni dei rating.

export const AnalyticsRouteMatrix = () => <div style={{
  display: 'grid',
  gridTemplateColumns: 'repeat(2, minmax(0, 1fr))',
  border: '2px solid #64748b',
  borderRadius: '6px',
  overflow: 'hidden',
  background: '#ffffff',
  fontFamily: 'inherit'
}}>

    <div style={{
  borderRight: '1px solid #94a3b8',
  borderBottom: '1px solid #94a3b8',
  display: 'flex',
  flexDirection: 'column'
}}>
      <div style={{
  padding: '10px 14px',
  background: '#e2e8f0',
  borderBottom: '1px solid #94a3b8',
  fontSize: '12px',
  fontWeight: 700,
  color: '#0f172a',
  letterSpacing: '0.01em'
}}>Portfolio trend</div>
      <div style={{
  padding: '14px'
}}>
        <div style={{
  display: 'flex',
  gap: '8px',
  alignItems: 'stretch'
}}>
          <div style={{
  fontSize: '11px',
  fontWeight: 700,
  color: '#334155',
  writingMode: 'vertical-rl',
  transform: 'rotate(180deg)',
  textAlign: 'center',
  paddingBottom: '4px'
}}>PD</div>

          <div style={{
  flex: 1,
  minWidth: 0
}}>
            <div style={{
  display: 'flex',
  gap: '6px'
}}>
              <div style={{
  width: '34px',
  height: '152px',
  display: 'flex',
  flexDirection: 'column',
  justifyContent: 'space-between',
  fontSize: '10px',
  color: '#475569',
  textAlign: 'right',
  paddingTop: '2px',
  paddingBottom: '18px'
}}>
                <span>0.50%</span>
                <span>0.40%</span>
                <span>0.30%</span>
              </div>

              <div style={{
  position: 'relative',
  flex: 1,
  height: '152px',
  borderLeft: '2px solid #334155',
  borderBottom: '2px solid #334155',
  background: '#f8fafc',
  overflow: 'visible'
}}>
                <div style={{
  position: 'absolute',
  left: 0,
  right: 0,
  top: '2px',
  borderTop: '1px dashed #dbe4ee'
}} />
                <div style={{
  position: 'absolute',
  left: 0,
  right: 0,
  top: '50%',
  borderTop: '1px dashed #dbe4ee'
}} />

                <svg viewBox="0 0 100 100" preserveAspectRatio="none" style={{
  position: 'absolute',
  left: 0,
  top: 0,
  width: '100%',
  height: 'calc(100% - 2px)'
}} aria-hidden="true">
                  <path d="M 0 18 L 9.09 20 L 18.18 22 L 27.27 25 L 36.36 28 L 45.45 31 L 54.55 35 L 63.64 39 L 72.73 43 L 81.82 48 L 90.91 53 L 100 58" fill="none" stroke="#1e40af" strokeWidth="2.5" vectorEffect="non-scaling-stroke" />
                </svg>

                <div style={{
  position: 'absolute',
  left: '0%',
  top: '18%',
  width: '7px',
  height: '7px',
  marginLeft: '-3.5px',
  marginTop: '-3.5px',
  borderRadius: '50%',
  background: '#1e40af'
}} />
                <div style={{
  position: 'absolute',
  left: '9.09%',
  top: '20%',
  width: '7px',
  height: '7px',
  marginLeft: '-3.5px',
  marginTop: '-3.5px',
  borderRadius: '50%',
  background: '#1e40af'
}} />
                <div style={{
  position: 'absolute',
  left: '18.18%',
  top: '22%',
  width: '7px',
  height: '7px',
  marginLeft: '-3.5px',
  marginTop: '-3.5px',
  borderRadius: '50%',
  background: '#1e40af'
}} />
                <div style={{
  position: 'absolute',
  left: '27.27%',
  top: '25%',
  width: '7px',
  height: '7px',
  marginLeft: '-3.5px',
  marginTop: '-3.5px',
  borderRadius: '50%',
  background: '#1e40af'
}} />
                <div style={{
  position: 'absolute',
  left: '36.36%',
  top: '28%',
  width: '7px',
  height: '7px',
  marginLeft: '-3.5px',
  marginTop: '-3.5px',
  borderRadius: '50%',
  background: '#1e40af'
}} />
                <div style={{
  position: 'absolute',
  left: '45.45%',
  top: '31%',
  width: '7px',
  height: '7px',
  marginLeft: '-3.5px',
  marginTop: '-3.5px',
  borderRadius: '50%',
  background: '#1e40af'
}} />
                <div style={{
  position: 'absolute',
  left: '54.55%',
  top: '35%',
  width: '7px',
  height: '7px',
  marginLeft: '-3.5px',
  marginTop: '-3.5px',
  borderRadius: '50%',
  background: '#1e40af'
}} />
                <div style={{
  position: 'absolute',
  left: '63.64%',
  top: '39%',
  width: '7px',
  height: '7px',
  marginLeft: '-3.5px',
  marginTop: '-3.5px',
  borderRadius: '50%',
  background: '#1e40af'
}} />
                <div style={{
  position: 'absolute',
  left: '72.73%',
  top: '43%',
  width: '7px',
  height: '7px',
  marginLeft: '-3.5px',
  marginTop: '-3.5px',
  borderRadius: '50%',
  background: '#1e40af'
}} />
                <div style={{
  position: 'absolute',
  left: '81.82%',
  top: '48%',
  width: '7px',
  height: '7px',
  marginLeft: '-3.5px',
  marginTop: '-3.5px',
  borderRadius: '50%',
  background: '#1e40af'
}} />
                <div style={{
  position: 'absolute',
  left: '90.91%',
  top: '53%',
  width: '7px',
  height: '7px',
  marginLeft: '-3.5px',
  marginTop: '-3.5px',
  borderRadius: '50%',
  background: '#1e40af'
}} />
                <div style={{
  position: 'absolute',
  left: '100%',
  top: '58%',
  width: '8px',
  height: '8px',
  marginLeft: '-4px',
  marginTop: '-4px',
  borderRadius: '50%',
  background: '#1e3a8a',
  border: '2px solid #ffffff'
}} />

                <div style={{
  position: 'absolute',
  left: '0%',
  bottom: '-8px',
  width: '1px',
  height: '6px',
  background: '#334155',
  marginLeft: '-0.5px'
}} />
                <div style={{
  position: 'absolute',
  left: '9.09%',
  bottom: '-8px',
  width: '1px',
  height: '6px',
  background: '#334155',
  marginLeft: '-0.5px'
}} />
                <div style={{
  position: 'absolute',
  left: '18.18%',
  bottom: '-8px',
  width: '1px',
  height: '6px',
  background: '#334155',
  marginLeft: '-0.5px'
}} />
                <div style={{
  position: 'absolute',
  left: '27.27%',
  bottom: '-8px',
  width: '1px',
  height: '6px',
  background: '#334155',
  marginLeft: '-0.5px'
}} />
                <div style={{
  position: 'absolute',
  left: '36.36%',
  bottom: '-8px',
  width: '1px',
  height: '6px',
  background: '#334155',
  marginLeft: '-0.5px'
}} />
                <div style={{
  position: 'absolute',
  left: '45.45%',
  bottom: '-8px',
  width: '1px',
  height: '6px',
  background: '#334155',
  marginLeft: '-0.5px'
}} />
                <div style={{
  position: 'absolute',
  left: '54.55%',
  bottom: '-8px',
  width: '1px',
  height: '6px',
  background: '#334155',
  marginLeft: '-0.5px'
}} />
                <div style={{
  position: 'absolute',
  left: '63.64%',
  bottom: '-8px',
  width: '1px',
  height: '6px',
  background: '#334155',
  marginLeft: '-0.5px'
}} />
                <div style={{
  position: 'absolute',
  left: '72.73%',
  bottom: '-8px',
  width: '1px',
  height: '6px',
  background: '#334155',
  marginLeft: '-0.5px'
}} />
                <div style={{
  position: 'absolute',
  left: '81.82%',
  bottom: '-8px',
  width: '1px',
  height: '6px',
  background: '#334155',
  marginLeft: '-0.5px'
}} />
                <div style={{
  position: 'absolute',
  left: '90.91%',
  bottom: '-8px',
  width: '1px',
  height: '6px',
  background: '#334155',
  marginLeft: '-0.5px'
}} />
                <div style={{
  position: 'absolute',
  left: '100%',
  bottom: '-8px',
  width: '1px',
  height: '6px',
  background: '#334155',
  marginLeft: '-0.5px'
}} />

                <div style={{
  position: 'absolute',
  left: '-6px',
  bottom: '0%',
  width: '6px',
  height: '1px',
  background: '#334155',
  marginBottom: '-0.5px'
}} />
                <div style={{
  position: 'absolute',
  left: '-6px',
  bottom: '50%',
  width: '6px',
  height: '1px',
  background: '#334155',
  marginBottom: '-0.5px'
}} />
                <div style={{
  position: 'absolute',
  left: '-6px',
  top: '2px',
  width: '6px',
  height: '1px',
  background: '#334155',
  marginTop: '-0.5px'
}} />
              </div>
            </div>

            <div style={{
  display: 'flex',
  justifyContent: 'space-between',
  marginLeft: '40px',
  marginTop: '10px',
  paddingRight: '2px',
  fontSize: '10px',
  color: '#475569'
}}>
              <span>Jan</span>
              <span>Apr</span>
              <span>Jul</span>
              <span>Oct</span>
            </div>
            <div style={{
  textAlign: 'center',
  marginTop: '6px',
  fontSize: '11px',
  fontWeight: 700,
  color: '#334155'
}}>Month</div>
          </div>
        </div>
      </div>
    </div>

    <div style={{
  borderBottom: '1px solid #94a3b8',
  display: 'flex',
  flexDirection: 'column'
}}>
      <div style={{
  padding: '10px 14px',
  background: '#e2e8f0',
  borderBottom: '1px solid #94a3b8',
  fontSize: '12px',
  fontWeight: 700,
  color: '#0f172a',
  letterSpacing: '0.01em'
}}>Rating distribution</div>
      <div style={{
  padding: '14px'
}}>
        <div style={{
  display: 'flex',
  gap: '8px',
  alignItems: 'stretch'
}}>
          <div style={{
  fontSize: '11px',
  fontWeight: 700,
  color: '#334155',
  writingMode: 'vertical-rl',
  transform: 'rotate(180deg)',
  textAlign: 'center',
  paddingBottom: '4px'
}}>Share</div>

          <div style={{
  flex: 1,
  minWidth: 0
}}>
            <div style={{
  display: 'flex',
  gap: '6px'
}}>
              <div style={{
  width: '34px',
  height: '152px',
  display: 'flex',
  flexDirection: 'column',
  justifyContent: 'space-between',
  fontSize: '10px',
  color: '#475569',
  textAlign: 'right',
  paddingTop: '2px',
  paddingBottom: '18px'
}}>
                <span>40%</span>
                <span>20%</span>
                <span>0%</span>
              </div>

              <div style={{
  position: 'relative',
  flex: 1,
  height: '152px',
  borderLeft: '2px solid #334155',
  borderBottom: '2px solid #334155',
  background: '#f8fafc'
}}>
                <div style={{
  position: 'absolute',
  left: 0,
  right: 0,
  top: '2px',
  borderTop: '1px dashed #dbe4ee'
}} />
                <div style={{
  position: 'absolute',
  left: 0,
  right: 0,
  top: '50%',
  borderTop: '1px dashed #dbe4ee'
}} />

                <div style={{
  position: 'absolute',
  left: '6px',
  right: '6px',
  bottom: 0,
  top: 0,
  display: 'flex',
  alignItems: 'flex-end',
  justifyContent: 'space-between',
  gap: '6px',
  padding: '0 2px'
}}>
                  <div style={{
  flex: 1,
  height: '34%',
  background: '#7c3aed',
  opacity: 0.85
}} />
                  <div style={{
  flex: 1,
  height: '52%',
  background: '#7c3aed',
  opacity: 0.85
}} />
                  <div style={{
  flex: 1,
  height: '68%',
  background: '#6d28d9'
}} />
                  <div style={{
  flex: 1,
  height: '78%',
  background: '#5b21b6'
}} />
                  <div style={{
  flex: 1,
  height: '58%',
  background: '#7c3aed',
  opacity: 0.85
}} />
                  <div style={{
  flex: 1,
  height: '42%',
  background: '#7c3aed',
  opacity: 0.85
}} />
                  <div style={{
  flex: 1,
  height: '26%',
  background: '#7c3aed',
  opacity: 0.65
}} />
                </div>

                <div style={{
  position: 'absolute',
  left: '-6px',
  bottom: '0%',
  width: '6px',
  height: '1px',
  background: '#334155',
  marginBottom: '-0.5px'
}} />
                <div style={{
  position: 'absolute',
  left: '-6px',
  bottom: '50%',
  width: '6px',
  height: '1px',
  background: '#334155',
  marginBottom: '-0.5px'
}} />
                <div style={{
  position: 'absolute',
  left: '-6px',
  top: '2px',
  width: '6px',
  height: '1px',
  background: '#334155',
  marginTop: '-0.5px'
}} />
              </div>
            </div>

            <div style={{
  display: 'flex',
  justifyContent: 'space-between',
  marginLeft: '40px',
  marginTop: '10px',
  paddingLeft: '4px',
  paddingRight: '2px',
  fontSize: '10px',
  color: '#475569'
}}>
              <span>a-</span>
              <span>bbb+</span>
              <span>bbb</span>
              <span>bbb-</span>
              <span>bb+</span>
              <span>bb</span>
              <span>bb-</span>
            </div>
            <div style={{
  textAlign: 'center',
  marginTop: '6px',
  fontSize: '11px',
  fontWeight: 700,
  color: '#334155'
}}>Rating</div>
          </div>
        </div>
      </div>
    </div>

    <div style={{
  borderRight: '1px solid #94a3b8',
  display: 'flex',
  flexDirection: 'column'
}}>
      <div style={{
  padding: '10px 14px',
  background: '#e2e8f0',
  borderBottom: '1px solid #94a3b8',
  fontSize: '12px',
  fontWeight: 700,
  color: '#0f172a',
  letterSpacing: '0.01em'
}}>Sector breakdown</div>
      <div style={{
  padding: '10px 14px 12px'
}}>
        <div style={{
  display: 'grid',
  gridTemplateColumns: '1fr 56px 56px',
  gap: '8px',
  padding: '0 0 6px',
  borderBottom: '1px solid #cbd5e1',
  fontSize: '10px',
  fontWeight: 700,
  color: '#334155',
  textTransform: 'uppercase',
  letterSpacing: '0.04em'
}}>
          <span>Sector</span>
          <span style={{
  textAlign: 'right'
}}>Rating</span>
          <span style={{
  textAlign: 'right'
}}>PD</span>
        </div>

        <div style={{
  display: 'flex',
  flexDirection: 'column'
}}>
          <div style={{
  display: 'grid',
  gridTemplateColumns: '1fr 56px 56px',
  gap: '8px',
  padding: '8px 0',
  fontSize: '10px',
  color: '#334155',
  borderBottom: '1px solid #f1f5f9'
}}>
            <span>Financials</span>
            <span style={{
  textAlign: 'right',
  fontWeight: 600
}}>bbb</span>
            <span style={{
  textAlign: 'right'
}}>0.42%</span>
          </div>
          <div style={{
  display: 'grid',
  gridTemplateColumns: '1fr 56px 56px',
  gap: '8px',
  padding: '8px 0',
  fontSize: '10px',
  color: '#334155',
  borderBottom: '1px solid #f1f5f9'
}}>
            <span>Utilities</span>
            <span style={{
  textAlign: 'right',
  fontWeight: 600
}}>bbb+</span>
            <span style={{
  textAlign: 'right'
}}>0.35%</span>
          </div>
          <div style={{
  display: 'grid',
  gridTemplateColumns: '1fr 56px 56px',
  gap: '8px',
  padding: '8px 0',
  fontSize: '10px',
  color: '#334155'
}}>
            <span>Industrials</span>
            <span style={{
  textAlign: 'right',
  fontWeight: 600
}}>bb+</span>
            <span style={{
  textAlign: 'right'
}}>0.58%</span>
          </div>
        </div>
      </div>
    </div>

    <div style={{
  display: 'flex',
  flexDirection: 'column'
}}>
      <div style={{
  padding: '10px 14px',
  background: '#e2e8f0',
  borderBottom: '1px solid #94a3b8',
  fontSize: '12px',
  fontWeight: 700,
  color: '#0f172a',
  letterSpacing: '0.01em'
}}>Rating changes</div>
      <div style={{
  padding: '10px 14px 12px'
}}>
        <div style={{
  display: 'grid',
  gridTemplateColumns: '1fr 44px 44px 52px',
  gap: '6px',
  padding: '0 0 6px',
  borderBottom: '1px solid #cbd5e1',
  fontSize: '10px',
  fontWeight: 700,
  color: '#334155',
  textTransform: 'uppercase',
  letterSpacing: '0.04em'
}}>
          <span>Entity</span>
          <span style={{
  textAlign: 'right'
}}>Prior</span>
          <span style={{
  textAlign: 'right'
}}>Now</span>
          <span style={{
  textAlign: 'right'
}}>Move</span>
        </div>

        <div style={{
  display: 'flex',
  flexDirection: 'column'
}}>
          <div style={{
  display: 'grid',
  gridTemplateColumns: '1fr 44px 44px 52px',
  gap: '6px',
  padding: '8px 0',
  fontSize: '10px',
  color: '#334155',
  borderBottom: '1px solid #f1f5f9'
}}>
            <span>Ford Motor Co.</span>
            <span style={{
  textAlign: 'right'
}}>bb+</span>
            <span style={{
  textAlign: 'right',
  fontWeight: 600
}}>bb</span>
            <span style={{
  textAlign: 'right',
  color: '#dc2626',
  fontWeight: 600
}}>↓ 1</span>
          </div>
          <div style={{
  display: 'grid',
  gridTemplateColumns: '1fr 44px 44px 52px',
  gap: '6px',
  padding: '8px 0',
  fontSize: '10px',
  color: '#334155',
  borderBottom: '1px solid #f1f5f9'
}}>
            <span>Vodafone Group</span>
            <span style={{
  textAlign: 'right'
}}>bbb-</span>
            <span style={{
  textAlign: 'right',
  fontWeight: 600
}}>bbb</span>
            <span style={{
  textAlign: 'right',
  color: '#059669',
  fontWeight: 600
}}>↑ 1</span>
          </div>
          <div style={{
  display: 'grid',
  gridTemplateColumns: '1fr 44px 44px 52px',
  gap: '6px',
  padding: '8px 0',
  fontSize: '10px',
  color: '#334155'
}}>
            <span>Unilever PLC</span>
            <span style={{
  textAlign: 'right'
}}>a-</span>
            <span style={{
  textAlign: 'right',
  fontWeight: 600
}}>a-</span>
            <span style={{
  textAlign: 'right',
  color: '#94a3b8'
}}>—</span>
          </div>
        </div>
      </div>
    </div>

  </div>;

L’API separa l’estrazione dei dati grezzi, le analisi calcolate e l’individuazione dei metadati. Scegliete il percorso la cui struttura di output corrisponda a ciò di cui avete bisogno: righe di entità grezze, una linea di tendenza, un istogramma di rating, una tabella settoriale, un elenco dei titoli in movimento o metadati di riferimento.

I quattro percorsi analitici calcolano i riepiloghi lato server a partire dal vostro `scope`. Utilizzi `getdata` quando è necessaria una riga per entità e data. Utilizzi i percorsi dei metadati prima di sviluppare un’interfaccia utente o un’integrazione, in particolare `metadata/columns` per i nomi dei campi disponibili, i tipi di dati, i filtri, le sfaccettature e le autorizzazioni.

<Frame caption="Output shape by route: portfolio trend, rating distribution, sector breakdown, and rating changes.">
  <AnalyticsRouteMatrix />
</Frame>

## Percorsi relativi a dati e analisi

| Percorso             | Input richiesto         | Quando utilizzarlo                                                                        |
| -------------------- | ----------------------- | ----------------------------------------------------------------------------------------- |
| `getdata`            | `scope`                 | Esportazioni, serie storiche o modelli a valle basati su campi grezzi a livello di entità |
| `aggregatetrend`     | `scope`                 | Qualità creditizia del portafoglio nel tempo                                              |
| `creditbreakdown`    | `scope`, `facet_column` | Riepilogo più recente per settore, paese o colonna personalizzata del portafoglio         |
| `entityratingchange` | `scope`                 | Aggiornamenti, downgrade o variazioni di PD in una finestra di lookback                   |
| `ratingdistribution` | `scope`                 | Composizione di un portafoglio per livello di rating                                      |

## Percorsi dei metadati

| Percorso                    | Input richiesto | Quando utilizzarlo                                                                                                                       |
| --------------------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `metadata/columns`          | Nessuno         | Verifica i nomi dei campi, i tipi di dati, i filtri di ambito, le sfaccettature e i requisiti di autorizzazione sul lato della richiesta |
| `metadata/rating-scales`    | Nessuno         | Caricare CB21, CB7 e i metadati a livello di client relativi a etichette, ordine e mappature di bande                                    |
| `metadata/industry-schema`  | Nessuno         | Creare filtri per la gerarchia dei settori o mappare i livelli settoriali                                                                |
| `metadata/geography-schema` | Nessuno         | Creare filtri per la gerarchia geografica o mappare i paesi alle regioni                                                                 |
| `metadata/available-dates`  | Nessuno         | Trovare le date di entrata in vigore più recenti disponibili e definitive                                                                |

Se intendete già aggregare, suddividere in bucket, ordinare o raggruppare i dati autonomamente, preferite il percorso analitico anziché estrarre le righe `getdata` e rimodellarle sul lato client.

## Ordine della richiesta

Ogni percorso analitico segue lo stesso ordine:

1. **`scope`** seleziona l’universo di input.
2. Il percorso calcola il proprio risultato per quell’universo.
3. **`result_filter`** rimodella le righe restituite.

`scope.filters` Decide quali entità includere nell’analisi. `result_filter.filters` Filtra esclusivamente le righe restituite. Per modelli e casi limite, si veda «[Ambito e risultati vuoti](/api-reference/analytics-scope-and-empty-results)».

Per `metric` e `rating_scale`, consultare [Metriche e scale](/api-reference/metrics-and-rating-scales). Per i payload “copia-incolla”, consultare [Esempi di payload](/api-reference/analytics-payload-examples).
