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

# Get User Profile

> Get on-chain Profile

<ResponseExample>
  ```json 200 theme={null}
  {
    "user_id": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
    "xp_balance": "10",
    "collected_badges": [
      {
        "id": "0x073bacb2b25973aecfb718e47fc92cccdd895dcc",
        "name": "ACCESS_KEY",
        "metadataURI": null,
        "metadata": null
      },
      {
        "id": "0x30216dd54591950d175f14b84eee95620000c38f",
        "name": "Novice Forager",
        "metadataURI": "ipfs://TokenURI",
        "metadata": null
      }
    ],
    "completed_actions": [
      {
        "name": "collected berry",
        "createdAt": "1728053671",
        "xp_rewarded": "1"
      }
    ],
    "credit_balances": [
      {
        "token_id": "0x645065e4e95be7c4a94d57c00d4bbe8e79efc47f",
        "token_name": "My Credit Token",
        "token_balance": "9999999999999999999",
        "token_balance_formatted": "9.999999999999999999",
        "token_symbol": "MCT",
        "token_decimals": 18
      }
    ]
  }
  ```
</ResponseExample>


## OpenAPI

````yaml get /profile
openapi: 3.0.0
info:
  version: 0.1.0
  title: Openformat API
servers:
  - url: https://api.openformat.tech/v1
    description: Live server
security:
  - ApiKeyAuth: []
paths:
  /profile:
    get:
      tags:
        - Profile
      description: Get on-chain Profile
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 255
            description: Blockchain network to use
            example: arbitrum-sepolia
          required: true
          name: chain
          in: query
        - schema:
            type: string
            pattern: ^(0x)?[0-9a-fA-F]{40}$
            description: >-
              Ethereum address of the user we are insterested,     if not
              present then the address of the logged user will be used
            example: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266'
          required: false
          name: user_id
          in: query
        - schema:
            type: string
            pattern: ^(0x)?[0-9a-fA-F]{40}$
            description: >-
              Ethereum addres of the application we are interested,     if not
              present then results will not contain token balances
            example: '0x9716fb655f2a72b1fc1b4db02b8ad20b6747442a'
          required: false
          name: app_id
          in: query
      responses:
        '200':
          description: Displays the on-chain profile for a user
          content:
            application/json:
              schema:
                type: object
                properties:
                  user_id:
                    type: string
                    pattern: ^(0x)?[0-9a-fA-F]{40}$
                  xp_balance:
                    type: string
                    description: XP token balabce
                    example: '123'
                  collected_badges:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: Ethereum address of the Badge
                          example: '0x97b2bcc72b19c7387ca89dc0a5e0ff5a1a149d35'
                        name:
                          type: string
                          description: Badge name
                          example: THE GOAT
                      required:
                        - id
                        - name
                    description: List of badges received by this user
                  completed_actions:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          description: Action name
                          example: First combat won
                        xp_rewarded:
                          type: string
                          description: Amount XP rewarded for completing this action
                          example: '2'
                        createdAt:
                          type: string
                          description: Creation timestamp
                          example: '1709190660'
                      required:
                        - name
                        - xp_rewarded
                        - createdAt
                    description: List of actions completed by this user
                required:
                  - user_id
                  - xp_balance
                  - collected_badges
                  - completed_actions
                description: User profile
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      issues:
                        type: array
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                              description: Error code for the field
                              example: invalid_type
                            path:
                              type: array
                              items:
                                type: string
                              description: Field with error
                              example:
                                - some_field
                            message:
                              type: string
                              description: Error message
                              example: Required
                          required:
                            - code
                            - path
                            - message
                        description: Error object with all validation issues
                    required:
                      - issues
                required:
                  - error
        '404':
          description: App not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - failed
                    description: Failed reponse status
                    example: failed
                  error:
                    type: string
                    description: Error message
                    example: App not found
                required:
                  - status
                  - error
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````