Quick Start

Get up and running with Redcent APIs in under 5 minutes.

1. Install dependencies

npm install @x402/fetch @x402/evm viem

2. Set up your wallet

You'll need a wallet with USDC on Base. For testing, use Base Sepolia and get testnet USDC from Circle's faucet.

3. Make your first request

import { x402Client, wrapFetchWithPayment } from '@x402/fetch';
import { registerExactEvmScheme } from '@x402/evm/exact/client';
import { privateKeyToAccount } from 'viem/accounts';

// Set up wallet signer
const signer = privateKeyToAccount(process.env.PRIVATE_KEY);

// Create x402 client
const client = new x402Client();
registerExactEvmScheme(client, { signer });

// Wrap fetch with automatic payments
const fetch402 = wrapFetchWithPayment(fetch, client);

// Make a request - payment is handled automatically
const response = await fetch402('https://api.redcent.io/companies/AAPL');
const company = await response.json();

console.log(company.name); // "Apple Inc."

Next steps

Now that you're set up, explore the available APIs:

SEC EDGAR API →