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

# x402 Crypto Ads

Advertise on crypto sites with zero gas fees using x402

[Check out the x402 Ad Marketplace (UI)](https://explorer.b3.fun/apps/x402-ad-marketplace)

Buy advertising space on 100+ crypto content sites using USDC with **zero gas fees** thanks to x402 gasless payments.

**No Gas Fees**

Pay only the ad price - zero transaction fees
  **Instant Booking**

One signature and you're live
  **100+ Sites**

Choose from crypto news, DeFi, NFT sites
  **AI-Powered Content**

Submit articles with AI validation and generation
  **Real Analytics**

See traffic data before you buy
  **Track Everything**

Monitor your ads and article requests in real-time

## Quick Start

**Display Ads**

**Connect Wallet**

Visit [x402 Ad Marketplace](https://explorer.b3.fun/apps/x402-ad-marketplace) and connect your wallet on Base network
      **Browse Sites**

Explore sites with traffic stats, pick your target audience
      **Choose Format & Time**

Select ad format (Banner/Sidebar/Leaderboard) and time slot
      **Upload Ad**

Provide image URL and landing page
      **Sign & Pay**

One signature with USDC - zero gas fees - instant confirmation
  **Article Submissions**

**Connect Wallet**

Visit [x402 Ad Marketplace](https://explorer.b3.fun/apps/x402-ad-marketplace) and connect your wallet on Base network
      **Select Target Site**

Choose from crypto news sites that accept article submissions
      **Submit Your Idea**

Provide a tweet URL, topic, or complete article title
      **AI Validation**

Get instant AI feedback with score (0-100) and suggestions
      **Review & Submit**

If approved (score ≥70), submit with one x402 signature
      **Track Progress**

Monitor status and get notified when published

Need USDC on Base? Bridge from Ethereum using [Base Bridge](https://bridge.base.org)

## Ad Formats & Pricing

**Wide banner**

**970×250 pixels** - Wide banner format

    **Price:** 1 USDC/hour

    Best for cost-effective campaigns with good visibility
  **Sidebar**

**300×600 pixels** - Vertical side placement

    **Price:** 2 USDC/hour

    Best for persistent visibility as users scroll
  **Leaderboard**

**728×90 pixels** - Top banner position

    **Price:** 3 USDC/hour

    Best for maximum visibility and brand awareness

**Duration:** 1 hour minimum, 7 days (168 hours) maximum

## Article Submissions

Submit article ideas to crypto content sites. AI validates your topic and generates optimized titles and descriptions.

### How It Works

**Submit Topic or Tweet**

Provide a tweet URL, topic idea, or complete article title
  **AI Validation (Free)**

AI scores your content (0-100) and generates suggestions if needed
  **Get Approval**

- **Score ≥80:** Your input is perfect, accepted as-is
    - **Score 70-79:** Approved with AI-improved suggestions
    - **Score &lt;70:** Rejected - try a different topic
  **Submit & Pay**

One x402 signature to submit your article request
  **Publication**

Site publishes your article and you receive the live URL

### Pricing

Prices vary by site, typically **$3-50 USDC** per article. Each site sets their own rate based on traffic and audience.

Validation is free! You can validate as many ideas as you want before committing to payment.

## API Reference

### Network & Payment Details

Chain ID: 8453

6 decimals

ERC-20 Permit signatures

Maximum price per booking

### Purchase Ad Slot (x402 Payment)

```bash
POST https://x402.anyspend.com/ads/buy
```

Programmatically purchase ad slots using x402 gasless payments. This endpoint requires x402 payment authorization.

**Request Body:**

```json Request
{
  "productId": "slot_abc123",
  "buyerAddress": "0x742d35Cc6...",
  "startTime": "2025-01-15T14:00:00Z",
  "endTime": "2025-01-15T18:00:00Z",
  "adContent": {
    "imageUrl": "https://...",
    "linkUrl": "https://...",
    "altText": "Alt text",
    "title": "Ad title",
    "description": "Description"
  }
}
```

```json Success Response (200)
{
  "success": true,
  "data": {
    "purchaseId": "purch_123...",
    "bookingId": "booking_456...",
    "totalPrice": "5000000",
    "status": "confirmed"
  }
}
```

```json Error Response (400)
{
  "success": false,
  "error": "Slot already booked during this time"
}
```

**Parameters:**
- `productId` (required) - The ad slot ID from `/ads/slots`
- `buyerAddress` (required) - Your wallet address
- `startTime` (required) - Start time in ISO 8601 format
- `endTime` (required) - End time in ISO 8601 format
- `adContent.imageUrl` (required) - Direct URL to ad image
- `adContent.linkUrl` (required) - Landing page URL
- `adContent.altText` (required) - Image alt text
- `adContent.title` (optional) - Ad title
- `adContent.description` (optional) - Ad description

**JavaScript/TypeScript Example:**

```typescript
import { wrapFetchWithPayment } from '@b3dotfun/anyspend-x402-fetch';
import { createWalletClient, custom, publicActions } from 'viem';
import { base } from 'viem/chains';

// Create wallet client
const walletClient = createWalletClient({
  account: '0x742d35Cc6...',
  chain: base,
  transport: custom(window.ethereum),
}).extend(publicActions);

// Wrap fetch with x402 payment
const fetchWithPayment = wrapFetchWithPayment(
  fetch,
  walletClient,
  BigInt(1000 * 10 ** 6) // Max 1000 USDC
);

// Purchase ad slot
const response = await fetchWithPayment(
  'https://x402.anyspend.com/ads/buy',
  {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      productId: 'slot_abc123',
      buyerAddress: '0x742d35Cc6...',
      startTime: '2025-01-15T14:00:00Z',
      endTime: '2025-01-15T18:00:00Z',
      adContent: {
        imageUrl: 'https://example.com/ad.jpg',
        linkUrl: 'https://example.com',
        altText: 'My ad',
        title: 'Check out our product!',
        description: 'Limited offer'
      }
    })
  }
);

const result = await response.json();
console.log('Booking ID:', result.data.bookingId);
```

See [x402 SDK documentation](/anyspend/x402-overview) for more details on using `wrapFetchWithPayment`.

### Browse Sites (Free)

```bash
GET https://x402.anyspend.com/ads/sites
```

List all available sites with pagination. This endpoint is free to call.

Query parameters:
- `page` - Page number (default: 1)
- `limit` - Results per page (default: 20, max: 100)
- `search` - Search by name/domain/keywords

```bash cURL
curl "https://x402.anyspend.com/ads/sites?search=defi&limit=10"
```

```javascript JavaScript
const sites = await fetch('https://x402.anyspend.com/ads/sites?page=1&limit=20')
  .then(r => r.json());
```

```json Response
{
  "success": true,
  "data": [
    {
      "siteId": "abc123",
      "siteName": "Crypto News Daily",
      "siteUrl": "https://cryptonews.example.com",
      "siteDomain": "cryptonews.com",
      "description": "Daily crypto news and analysis",
      "keywords": ["crypto", "bitcoin", "defi"],
      "availableSlots": ["leaderboard", "sidebar", "banner"],
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 156,
    "hasNext": true
  }
}
```

### List All Slots (Free)

```bash
GET https://x402.anyspend.com/ads/slots
```

List all available ad slots across all sites. This endpoint is free to call.

```bash cURL
curl "https://x402.anyspend.com/ads/slots"
```

```javascript JavaScript
const slots = await fetch('https://x402.anyspend.com/ads/slots')
  .then(r => r.json());
```

```json Response
{
  "success": true,
  "data": [
    {
      "slotId": "slot_abc123",
      "siteId": "site_123",
      "slotType": "leaderboard",
      "pricePerHour": "5000000"
    }
  ]
}
```

### Get Slot Details (Free)

```bash
GET https://x402.anyspend.com/ads/slots/:slotId
```

Returns static slot information including pricing, format, and associated site details. This endpoint is free to call.

```bash cURL
curl "https://x402.anyspend.com/ads/slots/slot_banner_abc123"
```

```json Response
{
  "success": true,
  "data": {
    "slot": {
      "slotId": "slot_banner_abc123",
      "siteId": "abc123",
      "slotType": "banner",
      "pricePerHour": "1000000",
      "available": true
    },
    "site": {
      "siteName": "Crypto News Daily",
      "siteUrl": "https://cryptonews.example.com"
    }
  }
}
```

### Check Current Ad (Free)

```bash
GET https://x402.anyspend.com/ads/slots/:slotId/current-ad
```

Returns the ad currently running in this slot, or indicates if the slot is available. This endpoint is free to call.

```bash cURL
curl "https://x402.anyspend.com/ads/slots/slot_banner_abc123/current-ad"
```

```json Ad Running
{
  "success": true,
  "data": {
    "type": "paid",
    "ad": {
      "imageUrl": "https://example.com/ad.png",
      "linkUrl": "https://example.com/landing"
    },
    "booking": {
      "bookingId": "booking_xyz789",
      "startTime": "2024-02-01T10:00:00.000Z",
      "endTime": "2024-02-01T13:00:00.000Z"
    }
  }
}
```

```json Slot Available
{
  "success": true,
  "data": {
    "type": "empty"
  }
}
```

### View Your Campaigns (Free)

```bash
GET https://x402.anyspend.com/ads/bookings/buyer/:address
```

Track all your ad bookings - active, pending, and completed. This endpoint is free to call.

```bash cURL
curl "https://x402.anyspend.com/ads/bookings/buyer/0xYourAddress"
```

```json Response
{
  "success": true,
  "data": [
    {
      "bookingId": "booking_xyz789",
      "siteId": "abc123",
      "slotType": "banner",
      "startTime": "2024-02-01T10:00:00.000Z",
      "endTime": "2024-02-01T13:00:00.000Z",
      "adContent": {
        "imageUrl": "https://mysite.com/ad.png",
        "linkUrl": "https://mysite.com/landing"
      },
      "totalPrice": "3000000",
      "status": "active",
      "paymentTxHash": "0xabcdef...",
      "createdAt": "2024-01-22T16:30:00.000Z"
    }
  ]
}
```

**Status values:**
- `active` - Currently running
- `pending` - Scheduled for future
- `completed` - Campaign ended

Prices in API responses are in USDC wei (6 decimals). Divide by 1,000,000 to get USDC amount.

---

## Article Submission Endpoints

### Validate Article Idea (Free)

```bash
POST https://x402.anyspend.com/articles/validate
```

Validate an article idea and get AI-generated title and description. This endpoint is free to call - no payment required.

**Request Body:**

```json Request
{
  "siteDomain": "baseradar.com",
  "userInput": "How to Use Base Pay for Creators in Your DApp"
}
```

```json Approved Response (Score ≥70)
{
  "success": true,
  "data": {
    "approved": true,
    "score": 92,
    "reasoning": "Excellent topic match for Base ecosystem content",
    "estimatedPrice": "15000000",
    "suggestedTitle": "How to Use Base Pay for Creators in Your DApp",
    "suggestedDescription": "Learn how to integrate Base Pay...",
    "userProvidedTitle": true,
    "message": "Your input is approved as-is"
  }
}
```

```json Rejected Response (Score <70)
{
  "success": false,
  "data": {
    "approved": false,
    "score": 45,
    "reasoning": "Topic doesn't align with site's focus on Base ecosystem",
    "estimatedPrice": "15000000",
    "message": "Content doesn't fit the site's focus"
  }
}
```

**Parameters:**
- `siteDomain` (required) - Target site domain (e.g., "baseradar.com", "solanaecho.com")
- `userInput` (required) - Can be:
  - Complete article title (10-200 characters)
  - Tweet URL (e.g., "https://x.com/username/status/...")
  - Topic or idea (e.g., "base pay for creators")

**AI Scoring:**
- **Score ≥80:** Your input is perfect! Used as-is
- **Score 70-79:** Good content, AI provides improved suggestions
- **Score &lt;70:** Rejected - topic doesn't fit the site

**JavaScript Example:**

```javascript
const response = await fetch('https://x402.anyspend.com/articles/validate', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    siteDomain: 'baseradar.com',
    userInput: 'How to bridge assets to Base chain'
  })
});

const result = await response.json();
console.log('Approved:', result.data.approved);
console.log('Score:', result.data.score);
console.log('Title:', result.data.suggestedTitle);
```

### Submit Article Request (x402 Payment)

```bash
POST https://x402.anyspend.com/articles/buy
```

Submit an article request with x402 gasless payment. Requires prior validation approval.

**Request Body:**

```json Request
{
  "buyerAddress": "0x742d35Cc6...",
  "siteDomain": "baseradar.com",
  "title": "How to Use Base Pay for Creators in Your DApp",
  "description": "Learn how to integrate Base Pay into your decentralized application..."
}
```

```json Success Response (200)
{
  "success": true,
  "data": {
    "requestId": "req_abc123...",
    "productSpecificId": "req_abc123...",
    "totalPrice": "15000000",
    "status": "pending"
  }
}
```

```json Error Response (400)
{
  "success": false,
  "error": "Title is required and must be 10-200 characters"
}
```

**Parameters:**
- `buyerAddress` (required) - Your wallet address
- `siteDomain` (required) - Target site domain
- `title` (required) - Article title (10-200 characters)
- `description` (required) - Article description/summary

**JavaScript/TypeScript Example:**

```typescript
import { wrapFetchWithPayment } from '@b3dotfun/anyspend-x402-fetch';
import { createWalletClient, custom, publicActions } from 'viem';
import { base } from 'viem/chains';

// Create wallet client
const walletClient = createWalletClient({
  account: '0x742d35Cc6...',
  chain: base,
  transport: custom(window.ethereum),
}).extend(publicActions);

// Wrap fetch with x402 payment
const fetchWithPayment = wrapFetchWithPayment(
  fetch,
  walletClient,
  BigInt(1000 * 10 ** 6) // Max 1000 USDC
);

// Submit article request
const response = await fetchWithPayment(
  'https://x402.anyspend.com/articles/buy',
  {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      buyerAddress: '0x742d35Cc6...',
      siteDomain: 'baseradar.com',
      title: 'How to Use Base Pay for Creators in Your DApp',
      description: 'Learn how to integrate Base Pay into your decentralized application for seamless creator payments.'
    })
  }
);

const result = await response.json();
console.log('Request ID:', result.data.requestId);
```

### View Your Article Requests (Free)

```bash
GET https://x402.anyspend.com/articles/requests/buyer/:address
```

Track all your article requests - pending, in progress, and published. This endpoint is free to call.

```bash cURL
curl "https://x402.anyspend.com/articles/requests/buyer/0xYourAddress"
```

```json Response
{
  "success": true,
  "data": [
    {
      "requestId": "req_abc123",
      "siteName": "Base Radar",
      "siteDomain": "baseradar.com",
      "title": "How to Use Base Pay for Creators",
      "description": "Learn how to integrate Base Pay...",
      "totalPrice": "15000000",
      "status": "published",
      "publishedUrl": "https://baseradar.com/articles/base-pay-creators",
      "createdAt": "2025-01-15T10:00:00.000Z",
      "updatedAt": "2025-01-16T15:30:00.000Z"
    }
  ]
}
```

**Status values:**
- `pending` - Waiting for site to write article
- `in_progress` - Article is being written
- `published` - Article is live (includes `publishedUrl`)
- `rejected` - Article request was declined

---

## Zero Gas with x402

x402 is the payment protocol that makes crypto payments feel like web2.

**Traditional crypto payments:**
- ❌ Multiple transactions (approve + transfer)
- ❌ $5-15 in gas fees
- ❌ 30-60 second wait times
- ❌ Complex multi-step flows

**With x402:**
- ✅ One signature - no transactions
- ✅ Zero gas fees
- ✅ Instant settlement
- ✅ Simple one-click purchase

### How It Works

1. You sign a payment authorization message (not a transaction)
2. x402 facilitator submits the transaction for you
3. Facilitator pays the gas
4. You pay only the ad price

Always verify the amount and recipient before signing!

### Security

- ✅ You control the signature
- ✅ Signatures expire (can't be replayed)
- ✅ One-time use with unique nonce
- ✅ Amount is locked (can't charge more)

## Tips for Success

**Design Eye-Catching Ads**

- Use high contrast colors
    - Keep text large and readable
    - Include a clear call-to-action
    - Test image URL before booking

  **Target the Right Audience**

- Match sites to your target market
    - Check traffic stats before booking
    - Consider multiple smaller sites vs one large site

  **Track Performance**

Use UTM parameters in your landing page URL:
    ```
    https://yoursite.com?utm_source=sitename&utm_medium=banner
    ```

  **Start Small & Scale**

- Book 1-2 hours first to test
    - Monitor click-through rates
    - Scale up what works

  **Writing Effective Article Titles**

- Keep titles between 10-200 characters
    - Be specific and descriptive
    - Match the site's content focus
    - Use keywords relevant to the site's audience
    - If you have a great title, submit it directly (10+ chars)

  **Maximize Article Approval**

- Research the site before submitting
    - Check recent articles for tone and topics
    - Tweet URLs work great - AI extracts context
    - Validate multiple ideas before paying
    - Score ≥70 required for approval

  **Leverage AI Suggestions**

- If score is 70-89, review AI improvements
    - AI optimizes for SEO and engagement
    - Suggested descriptions enhance your submission
    - Use validation to refine your pitch

## Common Issues

**'Insufficient balance' error**

You need USDC on Base network. Check that:
    - You're connected to Base (Chain ID: 8453)
    - You have enough USDC for the total cost

  **'Time slot unavailable' error**

Someone just booked that slot. Refresh and choose a different time.

  **Can I cancel a booking?**

Currently, bookings cannot be cancelled or refunded. Make sure your ad is ready before booking.

  **Can I edit my ad after booking?**

No, ad content is locked at booking time. You'll need to make a new booking to change it.

**[Launch Your Campaign](https://explorer.b3.fun/apps/x402-ad-marketplace)**

Start advertising on crypto sites in 5 minutes

---

**Related:** [Article Submission Marketplace](/anyspend/marketplace-articles) • [x402 Overview](/anyspend/x402-overview) • [x402scan →](https://www.x402scan.com/server/ff37cb5f-7976-42bb-a161-e5e360d8cd42)