Skip to main content

Prerequisites

A NearNode account — sign up free
An API key from Developers → API Keys in the dashboard

1. Get Your API Key

Navigate to the NearNode ConsoleDevelopersAPI KeysGenerate. Copy the key immediately — it’s shown only once.
sk_live_a1b2c3d4e5f6g7h8i9j0...
Store your API key securely. Never commit it to version control or expose it in client-side code.

2. Create Your First Node

curl -X POST https://nearnode.io/api/v1/nodes \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "label": "Office Front Door",
    "function_type": "redirect",
    "payload": {
      "url": "https://yourcompany.com/welcome"
    }
  }'
{
  "data": {
    "id": "node_abc123...",
    "slug": "k9m2xp4q",
    "url": "https://nearnode.io/v/k9m2xp4q",
    "function_type": "redirect",
    "status": "active"
  }
}

3. Generate a QR Code

Use any QR library to encode the scan URL. The URL is permanent — only the destination behind it changes.
qrencode -o office-door.png "https://nearnode.io/v/k9m2xp4q"

4. Update the Destination

Change where the QR code points — without reprinting:
curl -X PATCH https://nearnode.io/api/v1/nodes/k9m2xp4q \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "payload": {
      "url": "https://yourcompany.com/new-page"
    }
  }'

5. Try Other Payload Types

The same node API supports multiple function types. Swap function_type and payload to serve different content:
{
  "label": "James Page",
  "function_type": "vcard",
  "payload": {
    "first_name": "James",
    "last_name": "Page",
    "organization": "VidiAI",
    "phone": "+41791234567",
    "email": "james@vidiai.ch"
  }
}

6. Track Scans

Every scan is logged with device type, location, and timestamp. You can:

View in Dashboard

Real-time scan analytics with geo breakdown and device stats.

Receive via Webhook

Push scan events to your server in real time. Set up webhooks →

What’s Next?

Node Types

vCard, WiFi, Microsite, Actions — not just redirects.

Routing Rules

A/B tests, time-based, geo-targeting, device routing.

Batch API

Generate thousands of nodes at once for fleet operations.