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

# Retrieve Transaction Risks

> getTransactionRisks - This endpoint retrieves risk informations for the specific transaction.

### Request cases

```mermaid theme={null}
flowchart TD
    A[Retrieve Transaction Risks] --> B{depth}
    B -->|depth == 0| C((Risk Result))
    B -->|depth == 1| C
    B -->|depth > 1| D([ID Result])
    D --> |externalId| C((Risk Result))
```

<Note>Supports below transactions on risk screening</Note>

* ETH USDT (ERC-20) transfer
* TRON USDT (TRC-20) transfer
* ETH transfer
* TRX transfer
* BTC transfer


## OpenAPI

````yaml POST /api/v1/tracker/kyt/transfers/risk-screening
openapi: 3.0.3
info:
  title: Bitrace AML API
  description: >-
    Bitrace AML API provides comprehensive blockchain and crypto compliance
    tools for real-time risk detection capabilities. The API enables scrutiny of
    crypto transactions, wallet addresses, and crypto tokens with precision and
    efficiency.
  version: 1.0.0
  contact:
    name: Bitrace Support
    email: support@bitrace.io
servers:
  - url: https://api.bitrace.io
    description: Production server
security:
  - apiKeyAuth: []
tags:
  - name: KYA (Know Your Address)
    description: Address risk assessment and entity identification
  - name: KYT (Know Your Transaction)
    description: Transaction monitoring and compliance
  - name: Account API
    description: Account usage and management APIs
  - name: Address Management
    description: Address management on the blacklist and whitelist
paths:
  /api/v1/tracker/kyt/transfers/risk-screening:
    post:
      tags:
        - KYT (Know Your Transaction)
      summary: Retrieve Transaction Risks
      description: >-
        getTransactionRisks - This endpoint retrieves risk informations for the
        specific transaction.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  required:
                    - network
                    - hash
                    - outputAddress
                    - direction
                  properties:
                    network:
                      type: string
                      enum:
                        - ethereum
                        - eth
                        - tron
                        - btc
                      description: >-
                        The supported chainns short name. Values can be, eth
                        tron btc
                    hash:
                      type: string
                      description: The transaction for detect the risks
                    outputAddress:
                      type: string
                      description: The destination address in the transaction
                    tokenContractAddress:
                      type: string
                      description: >-
                        The token contract address, for USDT,<ul><li>eth:
                        `0xdac17f958d2ee523a2206206994597c13d831ec7`</li><li>tron:
                        `TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t`</li></ul>Note: it
                        should not be empty if inquiring token transaction
                    index:
                      type: integer
                      description: >-
                        The position of the output address in the
                        transaction.<br>Note: it is only available in the UTXO
                        model
                    direction:
                      type: string
                      enum:
                        - sent
                        - received
                      description: >-
                        This value defines whether the transfer is `sent` or
                        `received`.<ul><li>sent: retrieve the risks for
                        `toAddress`</li><li>received: retrieve the risks for
                        `fromAddress`</li></ul>This value is case insensitive
                    depth:
                      type: integer
                      description: >-
                        default is 0, and also you can also set the depth
                        between 1-5 to the risks of screening within the
                        transaction propagation path
                - type: object
                  required:
                    - network
                    - externalId
                  properties:
                    network:
                      type: string
                      enum:
                        - ethereum
                        - eth
                        - tron
                        - btc
                      description: >-
                        The supported chainns short name. Values can be, eth
                        tron btc
                    externalId:
                      type: string
                      description: The risk screening ID to query the final result
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KytTransfersRiskScreeningResponse'
              examples:
                default:
                  summary: Successful response
                  value:
                    success: true
                    code: 1
                    status: SUCCESS
                    data:
                      risks:
                        - riskLevel: high
                          riskType: launder-money
                        - riskLevel: high
                          riskType: online-gambling
                      externalId: '53557224252615249342456087557349'
                      resultTime: 1771059455295
                      analyseStatus: true
                      hash: >-
                        0xddeb5d1e29a88ac9e0a304f415628ff45f53c7278127de7f47c75b43bebcce8f
                      value: '1902.31608'
                      blockTime: 1718669807000
                      address: '0x974caa59e49682cda0ad2bbe82983419a2ecc400'
                    msg: SUCCESS
                async:
                  summary: Successful response with screening ID
                  value:
                    success: true
                    code: 1
                    status: SUCCESS
                    data:
                      externalId: '68301093716602343109371538675812'
                      hash: >-
                        0xddeb5d1e29a88ac9e0a304f415628ff45f53c7278127de7f47c75b43bebcce8f
                      value: '1902.31608'
                      blockTime: 1718669807000
                      address: '0x974caa59e49682cda0ad2bbe82983419a2ecc400'
                    msg: SUCCESS
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimit'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    KytTransfersRiskScreeningResponse:
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
        - type: object
          properties:
            data:
              type: object
              properties:
                risks:
                  type: array
                  items:
                    $ref: '#/components/schemas/Risk'
                  nullable: true
                externalId:
                  type: string
                  description: The generated identifier ID of this request
                resultTime:
                  type: integer
                  format: int64
                  description: The timestamp when the query result response is returned
                analyseStatus:
                  type: boolean
                  description: >-
                    The status of the risk analysis, true: success, false:
                    failed
                  nullable: true
                hash:
                  type: string
                  description: The hash of the transaction
                value:
                  type: number
                  description: The token value of the transaction
                blockTime:
                  type: integer
                  format: int64
                  description: The block timestamp of the transaction
                address:
                  type: string
                  description: The blockchain target address for risk screening
    BaseResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Request success or not
        code:
          type: integer
          description: Response code (1 for success, other numbers for errors)
        msg:
          type: string
          description: SUCCESS or error message
    Risk:
      type: object
      properties:
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
          description: The level of the risk
        riskType:
          $ref: '#/components/schemas/RiskType'
          description: The type of the risk
        riskSource:
          $ref: '#/components/schemas/riskSource'
          description: The source of the risk
    Error:
      type: object
      properties:
        success:
          type: boolean
          description: Request success or not
          default: false
        code:
          type: integer
        msg:
          type: string
        status:
          type: string
    RiskLevel:
      type: string
      enum:
        - high
        - generally-high
        - low
        - whitelist
      description: The level of the risk
    RiskType:
      type: string
      enum:
        - black-gray-goods
        - online-gambling
        - scam
        - hack
        - launder-money
        - sanction
        - frozen
        - politics
        - drug
        - gun
        - terrorist
        - porn
        - controlled-substance
        - bloodiness
        - religion
        - csam
      description: The type of the risk
    riskSource:
      type: string
      enum:
        - Bitrace
        - Community
        - User-Defined
  responses:
    BadRequest:
      description: Bad Request - Your request is invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized - Incorrect API key provided
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimit:
      description: Too Many Requests - Rate limit reached or quota exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: Internal Server Error - We had a problem with our server
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Access-Key
      description: API key authentication

````