Skip to content

Quick Start

Build your first monetized data feed in minutes. Perfect for developers who want to sell API access, data subscriptions, or premium content.

Choose Your Method

Option 1: Using the SDK (Recommended)

The SDK handles authentication and payments automatically:

npm install @pinata/grapevine-sdk
import { GrapevineClient } from '@pinata/grapevine-sdk';
 
const grapevine = new GrapevineClient({
  network: 'testnet',
  privateKey: process.env.PRIVATE_KEY
});
 
// Create your data feed
const feed = await grapevine.feeds.create({
  name: 'My API Data Feed',
  description: 'Premium market data for developers'
});
 
// Add your first data entry
const entry = await grapevine.entries.create(feed.id, {
  content: JSON.stringify({
    data: 'your API response here',
    timestamp: Date.now()
  }),
  title: 'Latest Data Update',
  mime_type: 'application/json',
  is_free: false
});

Continue to SDK Documentation →

Option 2: Direct API Calls

For direct API integration without the SDK:

# Using Bun (recommended)
bun add viem @coinbase/x402 x402
 
# Using npm
npm install viem @coinbase/x402 x402

Continue to API Documentation →

Prerequisites

  • Bun or Node.js runtime
  • A wallet private key with:
    • ETH for gas fees (Base Sepolia for testing)
    • Test USDC for x402 payments (on Base Sepolia)

Configuration

Create a .env file with your credentials:

PRIVATE_KEY=0x_your_private_key_here
API_URL=https://api.grapevine.markets  # testnet
# API_URL=https://api.grapevine.fyi   # mainnet

The script automatically detects the network:

  • https://api.grapevine.markets → Base Sepolia (Chain ID: 84532)
  • https://api.grapevine.fyi → Base mainnet (Chain ID: 8453)

Getting Test Tokens

Base Sepolia ETH

Get test ETH from: Alchemy Faucet

Test USDC

You'll need test USDC on Base Sepolia for x402 payments. Options:

  1. Bridge from Ethereum Sepolia
  2. Use a test token faucet
  3. Contact Grapevine support

Next Steps

Troubleshooting

"Missing or invalid PRIVATE_KEY"

Make sure your private key in .env starts with 0x and is valid.

"Low ETH balance"

You need ETH for gas fees. Get test ETH from the faucet linked above.

"402 Payment Required" errors

This is normal - the script handles x402 payments automatically. Make sure you have test USDC.

Network mismatch

The network is auto-detected from your API_URL. Ensure you're using the correct endpoint.