> ## 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 Risk Score

> getAddressRiskScore - This endpoint get risk score by given address.

### Risk Score Async Workflow

```mermaid theme={null}
sequenceDiagram
    HTTP Client->>+Bitrace AML API: Retrive the Risk Score(s)
    Bitrace AML API->>-HTTP Client: Response the requestId
    loop if the task status is 1000 or 1001
        HTTP Client-->>+Bitrace AML API: requestId
        Bitrace AML API-->>-HTTP Client: Corresponding Risk Score(s)
    end
```


## OpenAPI

````yaml GET /api/v1/tracker/kya/risk-scores
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/kya/risk-scores:
    get:
      tags:
        - KYA (Know Your Address)
      summary: Retrieve Risk Score
      description: getAddressRiskScore - This endpoint get risk score by given address.
      parameters:
        - name: Content-Type
          in: header
          required: false
          schema:
            type: string
            default: application/json
            enum:
              - application/json
        - name: Accept
          in: header
          required: false
          schema:
            type: string
            default: application/json
            enum:
              - application/json
        - name: address
          in: query
          required: true
          schema:
            type: string
            description: The address that you want to retrieve a entity for.
          description: The address that you want to retrieve a entity for.
        - name: network
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/NetworkCore'
            description: >-
              The supported chainns short name, ethereum tron btc bsc See at
              [Supported
              Chains](/api-reference/endpoints/supported-chains/kya-supported-chains)
          description: >-
            The supported chainns short name, ethereum tron btc bsc See at
            [Supported
            Chains](/api-reference/endpoints/supported-chains/kya-supported-chains)
        - name: customId
          in: query
          required: false
          schema:
            type: string
            description: >-
              The identifier by user-defined, it will be included in response if
              provided
          description: >-
            The identifier by user-defined, it will be included in response if
            provided
        - name: requestId
          in: query
          required: false
          schema:
            type: string
            description: The request idetifier to get the async result
          description: The request idetifier to get the async result
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/KyaRiskScoresResponse'
                    description: >-
                      The success response from create a task to get risk score
                      by given address.
                  - $ref: '#/components/schemas/KyaRiskScoresResponse2'
                    description: The success response from get risk score by given address.
              examples:
                createTask:
                  summary: create task
                  value:
                    success: true
                    code: 1
                    msg: SUCCESS
                    data:
                      requestId: '26784916292200597542974738410940'
                      status: 1001
                      customId: '1234567'
                retriveTask:
                  summary: retrive task result
                  value:
                    success: true
                    code: 1
                    status: SUCCESS
                    data:
                      scores:
                        - address: TBVygEu7doYmwi5ZnZpJSXFdks1pbD6rm5
                          score: '52'
                          riskBehavior:
                            - riskType: sanction
                              percent: '20'
                            - riskType: launder-money
                              percent: '5'
                          businessActivity: active
                      requestId: '43851108672460040661605061680184'
                      status: 1003
                    msg: SUCCESS
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimit'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    NetworkCore:
      type: string
      enum:
        - ethereum
        - eth
        - tron
        - btc
        - bsc
      description: Supported blockchain networks
    KyaRiskScoresResponse:
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
        - type: object
          properties:
            data:
              type: object
              properties:
                requestId:
                  type: string
                status:
                  $ref: '#/components/schemas/AsyncTaskStatus'
                customId:
                  type: string
    KyaRiskScoresResponse2:
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
        - type: object
          properties:
            data:
              type: object
              properties:
                requestId:
                  type: string
                status:
                  $ref: '#/components/schemas/AsyncTaskStatus'
                customId:
                  type: string
                scores:
                  type: array
                  items:
                    $ref: '#/components/schemas/KyaRiskScore'
    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
    AsyncTaskStatus:
      type: integer
      description: >-
        Asynchronous task status code.<ul><li>1000: Queueing</li><li>1001: In
        Progress</li><li>1002: Failed</li><li>1003: Completed</li><li>1006:
        Expired/Timeout</li></ul>
      enum:
        - 1000
        - 1001
        - 1002
        - 1003
        - 1006
    KyaRiskScore:
      type: object
      properties:
        address:
          type: string
          description: The address to calculate the risk score
        score:
          type: number
          description: The risk score of the address
        riskBehavior:
          type: array
          items:
            $ref: '#/components/schemas/RiskBehavior'
          nullable: true
        lifecycle:
          type: string
          description: The lifecycle of the address
        balanceLevel:
          type: string
          description: The balance level of the address
        volumeLevel:
          type: string
          description: The volume level of the address
        businessActivity:
          type: string
          description: The business activity of the address
    Error:
      type: object
      properties:
        success:
          type: boolean
          description: Request success or not
          default: false
        code:
          type: integer
        msg:
          type: string
        status:
          type: string
    RiskBehavior:
      type: object
      properties:
        riskType:
          $ref: '#/components/schemas/RiskType'
          description: The type of the risk
        percent:
          type: number
          description: The percentage of the risk trading funds. For example, 80 means 80%.
    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
  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

````