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

# B3 Profiles API

Free unified onchain identity aggregation service with social identity data from B3, Basement, ENS, Lens, and Farcaster

![B3 Profiles API](/images/profiles-banner.jpg)

**[Free Social Profiles API](/data/profiles/index)**

Check out the profiles API reference

## Overview

The B3 Profiles service serves as a data API for resolving decentralized user identities across the EVM ecosystem. It aggregates profile data from multiple sources and protocols, providing developers with a single API endpoint to access comprehensive user information and social context.

## Key Features

**Multi-Source Aggregation**

Combines data from Basement, ENS, Thirdweb Social, and other Web3 identity providers
  **Social Identity Integration**

Fetches social profiles from ENS, Lens Protocol, and Farcaster networks
  **Intelligent Caching**

Uses Cloudflare KV storage for efficient data caching with configurable TTL
  **User Preferences**

Allows users to set preferred profile sources via cryptographic signatures

## Supported Data Sources

- ENS (Ethereum Name Service)
- Lens Protocol
- Farcaster
- B3.ID
- Basement profiles

## API Endpoints

[Check out the API reference](/data/profiles/index) for more details.

### Profile Lookup
Retrieve aggregated profile information for any wallet address or username.

```bash
GET https://profiles.b3.fun/?address=0x1234567890abcdef1234567890abcdef12345678
GET https://profiles.b3.fun/?name=vitalik.eth
GET https://profiles.b3.fun/?name=sean.b3.fun
```

### Set Profile Preferences
Allow users to specify their preferred profile source through cryptographic signatures.

```bash
POST /preference
```

### Custom Display Names
Enable users to set custom display names that override all other sources.

```bash
POST /display-name
```

## Response Format

The service returns a unified profile object that combines data from all sources:

```json
{
  "name": "vitalik.eth",
  "address": "0x1234567890abcdef1234567890abcdef12345678",
  "avatar": "https://example.com/avatar.jpg",
  "bio": "Ethereum co-founder",
  "displayName": "Vitalik Buterin",
  "profiles": [
    {
      "type": "ensdata",
      "address": "0x123...",
      "name": "vitalik.eth",
      "avatar": "https://...",
      "bio": null,
      "displayName": null
    },
    {
      "type": "thirdweb-farcaster",
      "address": "0x123...",
      "name": "vitalik",
      "avatar": "https://...",
      "bio": "Ethereum co-founder",
      "displayName": "Vitalik Buterin"
    }
  ]
}
```

## Use Cases

**Enhanced Wallet Authentication**

Provide rich context about users during wallet connection, showing their social identity and Web3 reputation across platforms.
  **Social Gaming Integration**

Display comprehensive player profiles in games, including ENS names, social handles, and cross-platform identities.
  **DeFi User Experience**

Enhance trading interfaces by showing trader identities from Lens, Farcaster, and ENS instead of just wallet addresses.
  **Community Management**

Build better community tools by aggregating user identities from multiple Web3 social platforms.


## Example Usage

### Basic Profile Lookup

```javascript
// Fetch profile by address
const response = await fetch('https://profiles.b3.fun/?address=0x123...');
const profile = await response.json();

console.log(profile.displayName); // "Vitalik Buterin"
console.log(profile.profiles.length); // Number of sources found
```

### ENS Name Resolution

```javascript
// Fetch profile by ENS name
const response = await fetch('https://profiles.b3.fun/?name=vitalik.eth');
const profile = await response.json();

console.log(profile.address); // Resolved wallet address
console.log(profile.avatar); // ENS avatar URL
```

### Setting User Preferences

```javascript
// Set preferred profile source with signature
const message = `SetProfilePreference:${address}:thirdweb-farcaster:${timestamp}`;
const signature = await wallet.signMessage(message);

await fetch('https://profiles.b3.fun/preference', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    key: address,
    preferredType: 'thirdweb-farcaster',
    signature,
    signer: address,
    timestamp
  })
});
```

## Performance & Caching

- **Cache Duration**: 1 hour for profile data
- **Fresh Data**: Use `?fresh=true` to bypass cache
- **Global CDN**: Powered by Cloudflare's edge network
- **KV Storage**: Efficient key-value storage for preferences

## Rate Limits

The service inherits Cloudflare's built-in DDoS protection and rate limiting. For high-volume applications, consider implementing client-side caching or contact the B3 team for enterprise access.

## Building onchain made easy
[Check out the API reference](/data/profiles/index) for more details.

**[B3 Data API](/data/api-reference/introduction)**

Comprehensive blockchain data and analytics
  **[B3 SDK](/sdk/introduction)**

B3 SDK for cross-chain operations and global account authentication