Skip to content

Commit 6f38ca5

Browse files
committed
Merge branch 'main' of github.com:getformo/docs.formo.so
2 parents fac760e + 7a6d045 commit 6f38ca5

2 files changed

Lines changed: 94 additions & 12 deletions

File tree

api/overview.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ You can use the Profiles API for real-time personalization. Once you fetch a pro
2323
- Fetch wallet profile properties including net worth and wallet labels
2424
- Segment and target users based on location, device, and referrer
2525
- Real-time activation API for personalized user experiences
26-
27-
> Available on [x402](https://formo.x402.paysponge.com) on [MPP](https://formo.mpp.paysponge.com).
26+
- Also accessible by AI agents via [x402](https://www.x402.org/) (`formo.x402.paysponge.com`) and [MPP](https://mpp.dev/) (`formo.mpp.paysponge.com`) — pay per request, no API key required
2827

2928
## Query API
3029

api/profiles/get.mdx

Lines changed: 93 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,110 @@ description: 'Retrieve a comprehensive wallet profile by address, including onch
44
openapi: 'GET /v0/profiles/{address}'
55
---
66

7-
Retrieves wallet profile information for a given address. Returns comprehensive profile data including wallet properties, labels, tokens, and apps.
7+
Retrieves wallet profile information for a given address. Returns comprehensive profile data including wallet properties, labels, tokens, and apps.
88

99
If you have Formo installed on your website and app, you will also get the user's web demographics (country, device, browser, operating system), lifecycle, volume, and revenue.
1010

11-
> Available on [x402](https://formo.x402.paysponge.com) on [MPP](https://formo.mpp.paysponge.com).
12-
1311
<Frame>
1412
<img src="/images/profile-api-diagram.png" alt="Profiles API architecture diagram showing user device, Profiles API, and Wallet Profiles interaction" />
1513
</Frame>
1614

1715
## Authentication
1816

19-
This endpoint requires authentication using a **Workspace API Key** with `profiles:read` permission. Include the API key in your request headers:
17+
<Tabs>
18+
<Tab title="Workspace API Key">
19+
This endpoint requires a **Workspace API Key** with `profiles:read` permission. Include the API key in your request headers:
2020

21-
```bash
22-
Authorization: Bearer <your_workspace_api_key>
23-
```
21+
```bash
22+
Authorization: Bearer <your_workspace_api_key>
23+
```
2424

25-
<Note>
26-
The API key needs to have the **read permission for profiles** in the API settings. You can configure this in your workspace API key settings.
27-
</Note>
25+
```bash
26+
curl -sS \
27+
-H "Authorization: Bearer <your_workspace_api_key>" \
28+
"https://api.formo.so/v0/profiles/<address>"
29+
```
30+
31+
<Note>
32+
Create a key with **profiles:read** scope in **Team Settings > API Keys**.
33+
</Note>
34+
</Tab>
35+
<Tab title="x402">
36+
AI agents can access this endpoint through the **x402 gateway** with no Formo API key required. The agent pays per request using the [x402 protocol](https://www.x402.org/).
37+
38+
**Gateway URL:**
39+
```
40+
https://formo.x402.paysponge.com/v0/profiles/{address}
41+
```
42+
43+
**Price:** 0.05 USDC per request (Base network)
44+
45+
The gateway issues a `402 Payment Required` challenge on the first request. A compliant x402 client handles the payment automatically.
46+
47+
**Using the Sponge wallet SDK:**
48+
49+
```typescript
50+
import { SpongeWallet } from '@paysponge/sdk';
51+
52+
const wallet = await SpongeWallet.connect({ apiKey: process.env.SPONGE_API_KEY });
53+
54+
const response = await wallet.x402Fetch({
55+
url: 'https://formo.x402.paysponge.com/v0/profiles/<address>',
56+
method: 'GET',
57+
});
58+
59+
console.log(response.data); // wallet profile object
60+
```
61+
62+
**Raw HTTP (after payment):**
63+
64+
```http
65+
GET /v0/profiles/<address> HTTP/1.1
66+
Host: formo.x402.paysponge.com
67+
PAYMENT-SIGNATURE: <x402 payment payload>
68+
```
69+
70+
The response shape is identical to the standard endpoint. The `expand` query parameter works the same way.
71+
</Tab>
72+
<Tab title="MPP">
73+
AI agents can also access this endpoint through the **MPP gateway** using the [MPP protocol](https://mpp.dev/).
74+
75+
**Gateway URL:**
76+
```
77+
https://formo.mpp.paysponge.com/v0/profiles/{address}
78+
```
79+
80+
**Price:** 0.05 USDC.e per request (Tempo network)
81+
82+
The gateway issues a `402 Payment Required` challenge. A compliant MPP client handles the payment authorization automatically.
83+
84+
**Using the mppx SDK:**
85+
86+
```typescript
87+
import { createTempoClient } from 'mppx';
88+
89+
const client = createTempoClient({
90+
privateKey: process.env.TEMPO_PRIVATE_KEY,
91+
});
92+
93+
const response = await client.fetch(
94+
'https://formo.mpp.paysponge.com/v0/profiles/<address>',
95+
);
96+
97+
const profile = await response.json();
98+
```
99+
100+
**Raw HTTP (after payment):**
101+
102+
```http
103+
GET /v0/profiles/<address> HTTP/1.1
104+
Host: formo.mpp.paysponge.com
105+
Authorization: Payment <mpp payment payload>
106+
```
107+
108+
The response shape is identical to the standard endpoint. The `expand` query parameter works the same way.
109+
</Tab>
110+
</Tabs>
28111

29112
## Path parameters
30113

0 commit comments

Comments
 (0)