> ## 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 Entities, Risks and Scores

> getAddressTagsAndScores - This endpoint retrieves the address information 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 POST /api/v1/tracker/kya/tags-and-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/tags-and-scores:
    post:
      tags:
        - KYA (Know Your Address)
      summary: Retrieve Entities, Risks and Scores
      description: >-
        getAddressTagsAndScores - This endpoint retrieves the address
        information 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
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  required:
                    - address
                    - network
                  properties:
                    address:
                      type: string
                      description: The address that you want to retrieve a entity for
                    customId:
                      type: string
                      description: >-
                        The identifier by user-defined, it will be included in
                        response if provided
                    network:
                      $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)
                - type: object
                  required:
                    - requestId
                  properties:
                    requestId:
                      type: string
                      description: The request idetifier to get the async result
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/KyaTagsAndScoresResponse'
                    description: >-
                      The success response from create a task to get both system
                      and custom risk scores by given addresses.
                  - $ref: '#/components/schemas/KyaTagsAndScoresResponse2'
                    description: >-
                      The async response from create a task to get both system
                      and custom risk scores by given addresses.
              examples:
                createTask:
                  summary: create task
                  value:
                    success: true
                    code: 1
                    status: SUCCESS
                    data:
                      addressTags:
                        time: 1748516579866
                        address: '0x2c523bafccec0996335dfad5a1b4eca064f6ff91'
                        whitelist: false
                        network: eth
                        risks:
                          - riskLevel: high
                            riskType: launder-money
                            riskSource: Bitrace
                        intelligenceEntities:
                          - entityName: Community Disclosure
                            entityCode: community-disclosure
                            entityCategory: Community
                            entityCategoryCode: community
                        contract: false
                      requestId: '59039269460904823567863222465987'
                      status: 1000
                      customId: '123456'
                    msg: SUCCESS
                retriveTask:
                  summary: retrive task result
                  value:
                    success: true
                    code: 1
                    status: SUCCESS
                    data:
                      addressTags:
                        time: 1771078027304
                        address: TZ1noC2vbh8HRjt2icUbM1E6pKbSZ83Lfc
                        whitelist: false
                        network: tron
                        entity:
                          entityName: Bybit.User
                          entityCode: bybit-user
                          entityCategory: cex
                          entityCategoryCode: cex
                        contract: false
                      systemScores:
                        scores:
                          - address: TZ1noC2vbh8HRjt2icUbM1E6pKbSZ83Lfc
                            score: '1'
                            lifecycle: veryLong
                      customScores:
                        maxScore: '0'
                        dirData:
                          in: {}
                          out: {}
                        status: 1003
                      requestId: '76432691051573710327734207028998'
                      status: 1003
                      customId: '123456'
                    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
    KyaTagsAndScoresResponse:
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
        - type: object
          properties:
            data:
              type: object
              properties:
                requestId:
                  type: string
                status:
                  $ref: '#/components/schemas/AsyncTaskStatus'
                customId:
                  type: string
                addressTags:
                  $ref: '#/components/schemas/KyaEntitiesRisks'
    KyaTagsAndScoresResponse2:
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
        - type: object
          properties:
            data:
              type: object
              properties:
                requestId:
                  type: string
                status:
                  $ref: '#/components/schemas/AsyncTaskStatus'
                customId:
                  type: string
                addressTags:
                  $ref: '#/components/schemas/KyaEntitiesRisks'
                systemScores:
                  type: object
                  properties:
                    scores:
                      type: array
                      items:
                        $ref: '#/components/schemas/KyaRiskScore'
                customScores:
                  type: object
                  description: >-
                    Custom risk scores calculated based on your custom risk
                    strategy.<br>Note: Only available to users with custom
                    strategy permission.
                  properties:
                    maxScore:
                      type: string
                      description: the maximum possible risk score
                    dirData:
                      type: object
                      properties:
                        in:
                          $ref: '#/components/schemas/DirectionData'
                        out:
                          $ref: '#/components/schemas/DirectionData'
                    addressRisks:
                      type: array
                      items:
                        $ref: '#/components/schemas/AddressRisk'
                    txRisks:
                      type: array
                      items:
                        $ref: '#/components/schemas/TransactionRisk'
    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
    KyaEntitiesRisks:
      type: object
      properties:
        time:
          type: integer
          format: int64
        address:
          type: string
        network:
          type: string
        whitelist:
          type: boolean
        contract:
          type: boolean
        entity:
          $ref: '#/components/schemas/Entity'
        intelligenceEntities:
          type: array
          items:
            $ref: '#/components/schemas/Entity'
          nullable: true
        risks:
          type: array
          items:
            $ref: '#/components/schemas/Risk'
          nullable: true
    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
    DirectionData:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/StrategyData'
      example:
        default_37287890924998660_51146476853089016489590924639443:
          strategyNo: default_37287890924998660_51146476853089016489590924639443
          strategyName: '3 hop | Severe Risk Address | By Amount '
          details:
            - code: scam
              name: Fraud
              score: '64.91474'
          score: '64.91474'
    AddressRisk:
      type: object
      properties:
        address:
          type: string
          example: TGJQYJ7WGzfd8qsTyWwMz5pMQ4LiHkuGRd
        riskSortBos:
          type: array
          items:
            $ref: '#/components/schemas/RiskSortItem'
        layer:
          type: integer
          example: 1
        percentage:
          type: string
          example: '0.029644753301424447'
        sendAmount:
          type: string
          example: '383135'
        symbol:
          type: string
          example: usdt
    TransactionRisk:
      type: object
      properties:
        txId:
          type: string
          example: b9587f82703facdcfd25ab21b59de2c5cbef36e996db61703d16ef626d1f52ee
        txType:
          type: string
          example: contract
        txTime:
          type: integer
          format: int64
          example: 1710398796000
        sender:
          type: string
          example: TGJQYJ7WGzfd8qsTyWwMz5pMQ4LiHkuGRd
        receiver:
          type: string
          example: TFskN28dBDqv8tLKtM2GwroGx7bKDUSnBW
        amount:
          type: string
          example: '4200'
        coin:
          type: string
          example: usdt
        layer:
          type: integer
          example: 1
        percentage:
          type: string
          example: '0.0003249715219499786136444945'
        senderLabel:
          $ref: '#/components/schemas/SenderLabel'
    Error:
      type: object
      properties:
        success:
          type: boolean
          description: Request success or not
          default: false
        code:
          type: integer
        msg:
          type: string
        status:
          type: string
    Entity:
      type: object
      properties:
        entityName:
          type: string
          description: The name of the identified entity
        entityCode:
          type: string
          description: The code of the identified entity
        entityCategory:
          type: string
          description: The category of the identified entity
        entityCategoryCode:
          type: string
          description: The category code of the identified entity
    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
    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%.
    StrategyData:
      type: object
      properties:
        strategyNo:
          type: string
          example: default_37287890924998660_51146476853089016489590924639443
        strategyName:
          type: string
          example: '3 hop | Severe Risk Address | By Amount '
        details:
          type: array
          items:
            $ref: '#/components/schemas/RiskDetail'
        score:
          type: string
          example: '64.91474'
    RiskSortItem:
      type: object
      properties:
        risk:
          type: string
          example: Fraud
        riskLevel:
          type: string
          example: super-high
        riskType:
          type: string
          example: scam
    SenderLabel:
      type: object
      properties:
        mainRisk:
          $ref: '#/components/schemas/RiskSortItem'
        mainEntity:
          type: array
          items:
            $ref: '#/components/schemas/EntityItem'
    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
    RiskDetail:
      type: object
      properties:
        code:
          type: string
          example: scam
        name:
          type: string
          example: Fraud
        score:
          type: string
          example: '64.91474'
    EntityItem:
      type: object
      properties:
        code:
          type: string
          example: phishing1-5
        name:
          type: string
          example: Phishing Scam
  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

````