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

# Lookup user

> Resolve a user tag or ID to their public profile

## Overview

Look up a user by their tag (username) or user ID to get their public profile info. Provide either `tag` or `userId`, not both.

<Note>
  Requires [read authentication](/authentication). Include your `X-Public-Key` header.
</Note>

## Query parameters

<ParamField query="tag" type="string">
  The user's tag (username). Case-insensitive.
</ParamField>

<ParamField query="userId" type="string">
  The user's ID (UUID).
</ParamField>

## Example request

<CodeGroup>
  ```bash cURL (by tag) theme={null}
  curl https://relay.bayse.markets/v1/user/lookup?tag=mulumba \
    -H "X-Public-Key: YOUR_PUBLIC_KEY"
  ```

  ```bash cURL (by ID) theme={null}
  curl https://relay.bayse.markets/v1/user/lookup?userId=68eea9d8-a0fe-4534-ae88-b71e2f4f5c8f \
    -H "X-Public-Key: YOUR_PUBLIC_KEY"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://relay.bayse.markets/v1/user/lookup?tag=mulumba', {
    headers: { 'X-Public-Key': 'YOUR_PUBLIC_KEY' },
  });
  const user = await response.json();
  ```

  ```python Python theme={null}
  import requests

  resp = requests.get(
      'https://relay.bayse.markets/v1/user/lookup',
      params={'tag': 'mulumba'},
      headers={'X-Public-Key': 'YOUR_PUBLIC_KEY'},
  )
  user = resp.json()
  ```

  ```go Go theme={null}
  req, _ := http.NewRequest("GET", "https://relay.bayse.markets/v1/user/lookup?tag=mulumba", nil)
  req.Header.Set("X-Public-Key", "YOUR_PUBLIC_KEY")
  resp, _ := http.DefaultClient.Do(req)
  ```
</CodeGroup>

## Response

<ResponseField name="id" type="string">
  The user's unique ID (UUID).
</ResponseField>

<ResponseField name="tag" type="string">
  The user's tag (username).
</ResponseField>

<ResponseField name="imageUrl" type="string">
  URL of the user's profile image. May be empty if no image is set.
</ResponseField>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "id": "68eea9d8-a0fe-4534-ae88-b71e2f4f5c8f",
    "tag": "mulumba",
    "imageUrl": "https://cdn.bayse.markets/profile-images/mulumba.jpg"
  }
  ```
</ResponseExample>

## Errors

| Status | Description                                            |
| ------ | ------------------------------------------------------ |
| 400    | Neither `tag` nor `userId` provided, or both provided. |
| 401    | Missing or invalid API key.                            |
| 404    | No user found with the given tag or ID.                |
