X402 Places API

Micropayment-enabled location data with gasless USDC payments

REST API
Gasless Payments
$0.01 per request

Base URL

https://places-api.x402hub.xyz

Payment & Authentication

No API keys required. The X402 protocol handles micropayments automatically with gasless transactions.

💰 Pay per request: Each API call costs $0.01 USDC. Payments are processed via EIP-712 signatures with the CDP facilitator handling gas fees on Base network.

🔧 For Claude Code Users

Use our MCP server for seamless integration with Claude Code:

1. Install the MCP server:git clone https://github.com/zkNexus/Places-x402-Mcp.git
2. Configure in Claude Code:Add to your MCP settings with your wallet private key
3. Use in conversations:Search for places directly in Claude Code conversations
View full setup guide on GitHub →

🌐 X402 Protocol: First API request returns 402 Payment Required with payment details. Your client automatically signs and retries with payment. Learn more at www.x402.org

Endpoints

POST
/api/places/text-search
$0.01

Search for places using natural language queries with optional location context

Parameters

query
string
required

Natural language search query (e.g., 'coffee shops near me')

location
string

Coordinates as 'latitude,longitude' (e.g., '37.7749,-122.4194')

radius
number

Search radius in meters (default: 5000)

cURL

curl -X POST https://places-api.x402hub.xyz/api/places/text-search \
  -H "Content-Type: application/json" \
  -d '{
    "query": "coffee shops",
    "location": "37.7749,-122.4194",
    "radius": 2000
  }'

Response

{
  "results": [
    {
      "place_id": "ChIJN1t_tDeuEmsRUsoyG83frY4",
      "name": "Blue Bottle Coffee",
      "formatted_address": "66 Mint St, San Francisco, CA 94103",
      "rating": 4.3,
      "geometry": {
        "location": {
          "lat": 37.7749,
          "lng": -122.4194
        }
      },
      "opening_hours": {
        "open_now": true
      }
    }
  ],
  "metadata": {
    "cost": "$0.01",
    "protocol": "x402 v1.0",
    "payment_method": "gasless_micropayment"
  }
}

402 Payment Required Response

HTTP/1.1 402 Payment Required

{
  "x402Version": "1.0",
  "accepts": [
    {
      "method": "eip712",
      "network": "base",
      "token": "USDC",
      "amount": "10000",
      "to": "0x[SERVICE_WALLET_ADDRESS]"
    }
  ]
}

Your X402-compatible client will automatically handle this response, create the payment signature, and retry with the X-Payment header.