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

# Velge en data- eller analyserute

> Hvordan velge riktig Credit Benchmark API-rute for rå enhetsdata, beregnede analyser, oppdagelse av metadata, porteføljetrender, ratingendringer eller ratingfordelinger.

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

API-et skiller mellom uttrekking av rådata, beregnet analyse og oppdagelse av metadata. Velg den ruten hvis utdataform samsvarer med det du trenger: rå enhetsrader, en trendlinje, et vurderingshistogram, en sektortabell, en liste over selskaper med stor kursendring eller referansemetadata.

De fire analyserutene beregner sammendrag på serversiden fra `scope`. Bruk `getdata` når du trenger én rad per enhet og dato. Bruk metadataruter før du bygger et brukergrensesnitt eller en integrasjon, spesielt `metadata/columns` for tilgjengelige feltnavn, datatyper, filtre, fasetter og rettigheter.

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

## Data- og analyseruter

| Rute                 | Nødvendig inndata       | Når skal den brukes                                                           |
| -------------------- | ----------------------- | ----------------------------------------------------------------------------- |
| `getdata`            | `scope`                 | Eksporter, tidsserier eller nedstrømsmodeller fra rå felt på enhetsnivå       |
| `aggregatetrend`     | `scope`                 | Porteføljens kredittkvalitet over tid                                         |
| `creditbreakdown`    | `scope`, `facet_column` | Siste sammendrag etter sektor, land eller tilpasset porteføljekolonne         |
| `entityratingchange` | `scope`                 | Oppgraderinger, nedgraderinger eller PD-endringer over et tilbakeskuingsvindu |
| `ratingdistribution` | `scope`                 | Sammensetning av en portefølje etter ratingklasse                             |

## Metadataruter

| Rute                        | Nødvendig inndata | Når skal den brukes                                                                            |
| --------------------------- | ----------------- | ---------------------------------------------------------------------------------------------- |
| `metadata/columns`          | Ingen             | Bekreft feltnavn, datatyper, omfangsfiltre, fasetter og autorisasjonskrav på forespørselssiden |
| `metadata/rating-scales`    | Ingen             | Last inn CB21, CB7 og klientside-metadata for etiketter, rekkefølge og båndtilordninger        |
| `metadata/industry-schema`  | Ingen             | Bygg bransjehierarkifiltre eller kartlegg bransjenivåer                                        |
| `metadata/geography-schema` | Ingen             | Bygg geografiske hierarkifiltre eller tilordne land til regioner                               |
| `metadata/available-dates`  | Ingen             | Finn de nyeste tilgjengelige og endelige ikrafttredelsesdatoene                                |

Dersom du allerede planlegger å aggregere, dele inn i kategorier, sortere eller gruppere dataene selv, bør du velge den analytiske ruten i stedet for å trekke ut rader og `getdata` og omforme dem på klientsiden.

## Forespørselsrekkefølge

Hver analytisk rute følger samme rekkefølge:

1. **`scope`** velger inndatauniverset.
2. Ruten beregner resultatet for dette universet.
3. «**`result_filter`**» omformer de returnerte radene.

`scope.filters` bestemmer hvilke enheter som skal inngå i analysen. `result_filter.filters` Filtrerer kun de radene som returneres. Se «[Omfang og tomme resultater](/api-reference/analytics-scope-and-empty-results)» for mønstre og spesielle tilfeller.

For `metric` og `rating_scale`, se [Metrikker og skalaer](/api-reference/metrics-and-rating-scales). For kopier-og-lim-nyttelaster, se [Eksempler på nyttelast](/api-reference/analytics-payload-examples).
