> ## 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.

# Elección de una ruta de datos o de análisis

> Cómo elegir la ruta adecuada de la API de Credit Benchmark para datos de entidades sin procesar, análisis calculados, descubrimiento de metadatos, tendencias de carteras, variaciones de calificación o distribuciones de calificación.

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>;

La API separa la extracción de datos sin procesar, los análisis calculados y la obtención de metadatos. Elija la ruta cuyo formato de salida se ajuste a lo que necesita: filas de entidades sin procesar, una línea de tendencia, un histograma de valoración, una tabla sectorial, una lista de valores con mayor variación o metadatos de referencia.

Las cuatro rutas analíticas calculan resúmenes en el lado del servidor a partir de su `scope`. Utilice `getdata` cuando requiera una fila por entidad y fecha. Utilice las rutas de metadatos antes de desarrollar una interfaz de usuario o una integración, especialmente `metadata/columns` para conocer los nombres de campos, tipos de datos, filtros, facetas y derechos disponibles.

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

## Rutas de datos y de análisis

| Ruta                 | Entrada requerida       | Cuándo utilizarla                                                                                         |
| -------------------- | ----------------------- | --------------------------------------------------------------------------------------------------------- |
| `getdata`            | `scope`                 | Exportaciones, series temporales o modelos posteriores a partir de campos sin procesar a nivel de entidad |
| `aggregatetrend`     | `scope`                 | Calidad crediticia de la cartera a lo largo del tiempo                                                    |
| `creditbreakdown`    | `scope`, `facet_column` | Resumen más reciente por sector, país o columna de cartera personalizada                                  |
| `entityratingchange` | `scope`                 | Actualizaciones, rebajas o cambios de Consensus PD durante un periodo de referencia                       |
| `ratingdistribution` | `scope`                 | Composición de una cartera por grado de calificación                                                      |

## Rutas de metadatos

| Ruta                        | Entrada requerida | Cuándo utilizarla                                                                                                                                    |
| --------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `metadata/columns`          | Ninguno           | Confirme los nombres de los campos del lado de la solicitud, los tipos de datos, los filtros de ámbito, las facetas y los requisitos de autorización |
| `metadata/rating-scales`    | Ninguno           | Cargue CB21, CB7 y los metadatos a escala del cliente para las etiquetas, el orden y las asignaciones de bandas                                      |
| `metadata/industry-schema`  | Ninguno           | Crear filtros de jerarquía sectorial o asignar niveles sectoriales                                                                                   |
| `metadata/geography-schema` | Ninguno           | Crear filtros de jerarquía geográfica o asignar países a regiones                                                                                    |
| `metadata/available-dates`  | Ninguno           | Consulte las últimas fechas de entrada en vigor disponibles y definitivas.                                                                           |

Si ya tiene previsto agregar, clasificar por categorías, ordenar o agrupar los datos por su cuenta, opte por la ruta analítica en lugar de extraer filas y `getdata` y reformatearlas en el lado del cliente.

## Orden de la solicitud

Cada ruta analítica sigue el mismo orden:

1. **`scope`** selecciona el universo de entrada.
2. La ruta calcula su resultado para ese universo.
3. **`result_filter`** reestructura las filas devueltas.

`scope.filters` Decide qué entidades se incluyen en el análisis. `result_filter.filters` Solo filtra las filas que se devuelven. Consulte «[Ámbito y resultados vacíos](/api-reference/analytics-scope-and-empty-results)» para conocer los patrones y los casos extremos.

Para `metric` y `rating_scale`, consulte «[Métricas y escalas](/api-reference/metrics-and-rating-scales)». Para cargas útiles de «copiar y pegar», consulte «[Ejemplos de carga útil](/api-reference/analytics-payload-examples)».
