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

# Get yield risk

> Get third-party risk ratings for a yield, keyed by rating provider.

The response has `updatedAt` plus one optional block per rating provider: `credora` (`rating`, `score`, `psl`, `publishDate`, `curator`) and `stakingRewards` (`rating`, `score`, potential rating and score, rating dates, profile URL). A block is absent when that provider has not rated the yield. Ratings and scores come from the provider and are not normalized across providers.

The yield must be enabled for your project, otherwise the call returns `400`. A yield with no risk data returns `404`.


## OpenAPI

````yaml openapi.json GET /v1/yields/{yieldId}/risk
openapi: 3.0.0
info:
  title: 'Yield API: Earn'
  description: API Documentation
  version: '1.0'
  contact: {}
servers:
  - url: https://api.yield.xyz
    description: Production
security: []
tags:
  - name: Discovery
    description: >-
      Browse and discover yield opportunities, networks, and providers, plus
      yield-level risk, reward rate, and TVL data
  - name: Portfolio
    description: User-specific balances and KYC status
  - name: Actions
    description: Generate transactions to enter, exit, and manage yields
externalDocs:
  description: For more information
  url: https://docs.yield.xyz
paths:
  /v1/yields/{yieldId}/risk:
    get:
      tags:
        - Discovery
      summary: Get risk ratings for a yield
      description: >-
        Retrieve consolidated risk ratings from third-party providers for a
        yield.
      operationId: YieldsController_getYieldRisk_v1
      parameters:
        - name: yieldId
          required: true
          in: path
          description: The unique identifier of the yield
          schema:
            example: ethereum-eth-lido-staking
            type: string
      responses:
        '200':
          description: Risk ratings retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/YieldRiskDto'
        '400':
          description: >-
            Invalid request parameters, or the yield is not enabled for your
            project
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Validation failed
                  error:
                    type: string
                    example: Bad Request
                  statusCode:
                    type: number
                    example: 400
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Invalid API key
                  error:
                    type: string
                    example: Unauthorized
                  statusCode:
                    type: number
                    example: 401
        '404':
          description: >-
            Yield not found, or risk data has not yet been collected for this
            yield
        '429':
          description: Rate limit exceeded
          headers:
            x-ratelimit-limit:
              description: Request limit per window
              schema:
                type: string
            x-ratelimit-remaining:
              description: Remaining requests (will be 0)
              schema:
                type: string
            x-ratelimit-reset:
              description: Unix timestamp when window resets
              schema:
                type: string
            retry-after:
              description: Seconds to wait before retrying
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Rate limit exceeded
                  error:
                    type: string
                    example: Too Many Requests
                  statusCode:
                    type: number
                    example: 429
                  retryAfter:
                    type: number
                    example: 30
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Internal server error
                  error:
                    type: string
                    example: Internal Server Error
                  statusCode:
                    type: number
                    example: 500
      security:
        - ApiKey: []
components:
  schemas:
    YieldRiskDto:
      type: object
      properties:
        updatedAt:
          type: string
          description: >-
            Timestamp of when yield.xyz last computed risk data for this yield
            (ISO 8601)
        credora:
          $ref: '#/components/schemas/YieldRiskCredoraDto'
        stakingRewards:
          $ref: '#/components/schemas/YieldRiskStakingRewardsDto'
      required:
        - updatedAt
    YieldRiskCredoraDto:
      type: object
      properties:
        rating:
          type: object
          description: Credora rating
        score:
          type: object
          description: Credora score (1-5)
        psl:
          type: object
          description: Probability of Significant Loss (annualized)
        publishDate:
          type: object
          description: Credora publish date
        curator:
          type: object
          description: Credora curator name
    YieldRiskStakingRewardsDto:
      type: object
      properties:
        rating:
          type: object
          description: Staking Rewards rating
        score:
          type: object
          description: Staking Rewards score (1-5)
        potentialRating:
          type: object
          description: Staking Rewards potential rating
        potentialScore:
          type: object
          description: Staking Rewards potential score (1-5)
        ratedAt:
          type: object
          description: Date when rating was assessed
        ratedSince:
          type: object
          description: Date since product has been rated
        profileUrl:
          type: object
          description: Staking Rewards product profile URL
        reportUrl:
          type: object
          description: Staking Rewards full report URL
        providerName:
          type: object
          description: Staking Rewards provider name
        version:
          type: object
          description: Staking Rewards methodology version
        type:
          type: object
          description: Staking Rewards product type
        chain:
          type: object
          description: Chain label returned by Staking Rewards
        contractAddress:
          type: object
          description: Contract address returned by Staking Rewards
        riskMetrics:
          $ref: '#/components/schemas/YieldRiskStakingRewardsMetricsDto'
    YieldRiskStakingRewardsMetricsDto:
      type: object
      properties:
        users:
          type: object
          description: Users count from Staking Rewards risk metrics
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.