Node.js 20+ · Next.js · Edge Workers · Bun Zero-Dependency Typed fetch Client ~80% Token Savings (mode="summary") GDPR 0-PII · 0 Credits on 504/429

TypeScript & Node.js SDK Quickstart
Zero-Dep fetch Client & 67-Endpoint Types

Drop a single zero-dependency TypeScript client into Node.js 20+, Next.js App Router, Cloudflare Workers, or Bun to query all 67 REST endpoints (https://api.upp3.com) and 56 native Hosted MCP tools (https://mcp.upp3.com/mcp) across 16 global platforms. Built-in EdgeDataMode = "summary" | "raw" cuts LLM token spend by ~80% while exponential backoff retries handle upstream 504/429 at 0 Credits Charged.

0 Dependencies
Pure Web Standard fetch runs across Node 20+, Next.js Edge, Bun & Deno
67 Typed Routes
One openapi-typescript command generates types for all 16 platforms
~80% Less Tokens
Typed mode: "summary" trims JSON before feeding Vercel AI / OpenAI
0 Credits on 504/429
Built-in jittered backoff retries upstream hiccups with strict zero-charge safety
Step 1 · OpenAPI 3.1 Codegen & Zero-Dependency Client

Generate All 67 Endpoint Types & Drop In edgedata-client.ts

Use openapi-typescript against our live OpenAPI 3.1 schema for compile-time autocomplete across all 16 platforms, then drop the production EdgeDataClient below into your project. Claim a free key in the wizard below and snippets sync automatically.

Optional · Generate Strict TypeScript Definitions for All 67 Endpoints
# Generate typed paths & schemas for all 67 EdgeData REST endpoints (16 platforms)
npx openapi-typescript https://api.upp3.com/v1/openapi-rapidapi.json -o src/edgedata.d.ts

# Optional: install official MCP SDK if you also want Streamable HTTP MCP in TypeScript
npm install @modelcontextprotocol/sdk
src/edgedata-client.ts Zero Deps · 504/429 Zero-Charge Retry
Node 20+ / Next.js / Edge / Bun
// src/edgedata-client.ts — Zero-dependency typed fetch client for EdgeData (67 REST endpoints)
export type EdgeDataMode = "summary" | "raw";

export interface EdgeDataMeta {
  channel?: string;
  plan?: string;
  items_returned?: number;
  credits_charged: number;
  credits_remaining?: number;
  elapsed_ms?: number;
}

export interface EdgeDataResponse<T = Record<string, unknown>> {
  ok: boolean;
  source: string;
  mode: EdgeDataMode;
  data: T;
  meta: EdgeDataMeta;
}

export interface EdgeDataClientOptions {
  apiKey?: string;
  baseUrl?: string;
  authHeader?: "X-API-Key" | "Authorization";
  maxRetries?: number;
  timeoutMs?: number;
}

const RETRYABLE_STATUS = new Set([429, 504]); // Strictly 0 Credits Charged on EdgeData

export class EdgeDataError extends Error {
  constructor(
    message: string,
    public readonly status: number,
    public readonly body: unknown,
  ) {
    super(message);
    this.name = "EdgeDataError";
  }
}

export class EdgeDataClient {
  private readonly apiKey: string;
  private readonly baseUrl: string;
  private readonly authHeader: "X-API-Key" | "Authorization";
  private readonly maxRetries: number;
  private readonly timeoutMs: number;

  constructor(options: EdgeDataClientOptions = {}) {
    const key = options.apiKey ?? process.env.EDGEDATA_API_KEY ?? "YOUR_EDGEDATA_API_KEY";
    this.apiKey = key.trim();
    this.baseUrl = (options.baseUrl ?? "https://api.upp3.com").replace(/\/+$/, "");
    this.authHeader = options.authHeader ?? "X-API-Key";
    this.maxRetries = options.maxRetries ?? 3;
    this.timeoutMs = options.timeoutMs ?? 45_000;
  }

  private headers(extra?: Record<string, string>): Record<string, string> {
    const auth =
      this.authHeader === "Authorization"
        ? { Authorization: `Bearer ${this.apiKey}` }
        : { "X-API-Key": this.apiKey };
    return { Accept: "application/json", ...auth, ...extra };
  }

  private async request<T>(
    method: "GET" | "POST",
    path: string,
    opts?: {
      query?: Record<string, string | number | boolean | undefined>;
      body?: Record<string, unknown>;
    },
  ): Promise<EdgeDataResponse<T>> {
    const url = new URL(path, this.baseUrl);
    if (opts?.query) {
      for (const [k, v] of Object.entries(opts.query)) {
        if (v !== undefined) url.searchParams.set(k, String(v));
      }
    }

    for (let attempt = 0; attempt <= this.maxRetries; attempt++) {
      const controller = new AbortController();
      const timer = setTimeout(() => controller.abort(), this.timeoutMs);
      try {
        const res = await fetch(url, {
          method,
          headers: this.headers(
            opts?.body ? { "Content-Type": "application/json" } : undefined,
          ),
          body: opts?.body ? JSON.stringify(opts.body) : undefined,
          signal: controller.signal,
        });

        if (RETRYABLE_STATUS.has(res.status) && attempt < this.maxRetries) {
          const retryAfter = Number(res.headers.get("retry-after")) || 0;
          const backoffMs = Math.max(retryAfter * 1000, 500 * 2 ** attempt);
          await new Promise((r) => setTimeout(r, backoffMs));
          continue; // HTTP 504/429 strictly incur 0 Credits Charged
        }

        const payload = await res.json().catch(() => ({}));
        if (!res.ok) {
          throw new EdgeDataError(`EdgeData HTTP ${res.status} on ${path}`, res.status, payload);
        }
        return payload as EdgeDataResponse<T>;
      } finally {
        clearTimeout(timer);
      }
    }
    throw new EdgeDataError(`Exhausted ${this.maxRetries} retries on ${path}`, 504, null);
  }

  get<T = Record<string, unknown>>(
    path: string,
    query?: Record<string, string | number | boolean | undefined>,
  ): Promise<EdgeDataResponse<T>> {
    return this.request<T>("GET", path, { query });
  }

  post<T = Record<string, unknown>>(
    path: string,
    body: Record<string, unknown>,
  ): Promise<EdgeDataResponse<T>> {
    return this.request<T>("POST", path, { body });
  }
}
Step 01 · Dual Auth

X-API-Key or Bearer

Set EDGEDATA_API_KEY in .env.local. Switch authHeader between X-API-Key and Authorization anytime.

Step 02 · ~80% Token Savings

Default to mode: "summary"

Pass mode: "summary" on GET query strings or POST JSON bodies to cut LLM input tokens by ~80% at the exact same credit price.

Step 03 · Zero-Charge Retry

Safe 504/429 Backoff

Because upstream HTTP 504 and HTTP 429 responses strictly incur 0 Credits Charged, retries never burn your balance.

Step 2 · 4 Production TypeScript Recipes

Real Estate US/UK, TradingView Finance, E-Commerce & MCP/OpenAPI

Switch tabs below to copy 100% live, runnable TypeScript examples using exact EdgeData endpoints. All 6 Real Estate & Finance endpoints cost just 2 credits/call and enforce strict GDPR 0-PII.

examples/real-estate-us-uk.ts (2 credits/call)
// examples/real-estate-us-uk.ts — 4 live US/UK Real Estate endpoints (2 credits/call, 0-PII)
import { EdgeDataClient } from "../src/edgedata-client";

const client = new EdgeDataClient({
  apiKey: process.env.EDGEDATA_API_KEY ?? "YOUR_EDGEDATA_API_KEY",
});

async function runRealEstateBrief() {
  const [redfinListings, redfinTrends, rightmoveHpi, rightmoveLondon] = await Promise.all([
    // 1) Redfin US Residential Search (0-PII, mode=summary saves ~81% tokens)
    client.get("/v1/real-estate/redfin/properties/search", {
      query: "Seattle, WA",
      max_price: 950000,
      min_beds: 3,
      page_size: 10,
      mode: "summary",
    }),
    // 2) Redfin US Metro Market Trends (median list/sale price & DOM)
    client.get("/v1/real-estate/redfin/market/trends", {
      query: "Seattle, WA",
      mode: "summary",
    }),
    // 3) Rightmove UK Monthly House Price Index (regional tables)
    client.get("/v1/real-estate/rightmove/house-price-index", {
      mode: "summary",
    }),
    // 4) Rightmove UK Property Search (London BUY channel, GBP, 0-PII)
    client.get("/v1/real-estate/rightmove/properties/search", {
      query: "London",
      channel: "BUY",
      max_price: 750000,
      min_bedrooms: 2,
      mode: "summary",
    }),
  ]);

  console.log("Redfin Listings:", redfinListings.data, "Credits:", redfinListings.meta.credits_charged);
  console.log("Redfin Trends:", redfinTrends.data);
  console.log("Rightmove UK HPI:", rightmoveHpi.data);
  console.log("Rightmove London:", rightmoveLondon.data);
}

runRealEstateBrief().catch(console.error);
Runtime Native fetch Auth Pattern Recommended Pattern
Node.js 20 / 22 LTS Built-in Undici fetch process.env.EDGEDATA_API_KEY Use EdgeDataClient + Promise.all + openapi-typescript
Next.js App Router Extended Web fetch Server Components / Route Handlers Keep API key server-side; pass mode: "summary" to AI SDK tools
Cloudflare Workers Edge Web fetch env.EDGEDATA_API_KEY secret Zero Node polyfills needed; compact JSON stays well within CPU limits
Bun / Deno Native Web fetch Bun.env / Deno.env.get Run TS examples directly with bun run without a build step
Instant API Key · No Credit Card Required

Get 100 Free Monthly Credits for TypeScript & Node.js

Provision your live EdgeData API key below in seconds. Once issued, the TypeScript client and all 4 code tabs above automatically fill in your session key for immediate copy-paste testing.

Transparent Upgrade Ladder · 67 REST + 56 MCP Tools

Simple Credits Built for Production TypeScript Backends

One API key unlocks all 16 platforms. Upstream HTTP 504/429 errors strictly incur 0 Credits Charged.

No Card Required

Free Tier

$0 / month
  • ✓100 credits / mo via Free Key Wizard
  • ✓All 67 REST endpoints & 56 MCP tools
  • ✓mode="summary" ~80% token savings
Claim Free Key →
Never Expires

Credit Pack

$47 one-time
  • ✓25,000 non-expiring credits
  • ✓Zero recurring subscription lock-in
  • ✓Great for Next.js launches & side projects
Buy $47 Pack →
Most Popular

Pro

$49 / month
  • ✓15,000 credits / mo · 60 RPM
  • ✓Up to 500 reviews/call + 6h warm cache
  • ✓HTTP 504/429 = 0 Credits Charged
Choose Pro ($49/mo) →
High Throughput

Scale

$149 / month
  • ✓60,000 credits / mo · 200 RPM
  • ✓Up to 2,000 reviews/call + priority routing
  • ✓Built for Edge Worker & Node fleet scale
Choose Scale ($149/mo) →
Hosted Streamable HTTP MCP · Zero Wrapper Code

Prefer No-Code / AI IDE MCP?

Want your AI coding IDE or automation builder to call all 56 EdgeData tools directly without writing fetch boilerplate? Reuse your exact same API key with https://mcp.upp3.com/mcp.

One API Key · 4 Developer Quickstarts

Explore the Other 3 SDK & REST Guides

Building polyglot services? Reuse your exact same EdgeData key in Python, cURL, or OpenAI Agents, or return to the SDKs Index (/sdks).

TypeScript & Node.js FAQ

Frequently Asked Questions

Runtime support, OpenAPI 3.1 type generation, header auth, retry billing safety, and MCP interoperability.

Does the EdgeData TypeScript client work in Next.js App Router, Cloudflare Workers, and Bun without Node polyfills?
Yes. Because EdgeDataClient relies exclusively on Web Standard fetch, URL, URLSearchParams, and AbortController, it runs unmodified across Node.js 20+, Next.js Server Actions and Edge Runtime, Bun, Deno, and Cloudflare Workers with zero runtime dependencies.
How do I generate TypeScript types for all 67 EdgeData REST endpoints?
Run npx openapi-typescript https://api.upp3.com/v1/openapi-rapidapi.json -o src/edgedata.d.ts. You immediately get strict compile-time autocomplete for every query parameter, JSON payload, and mode="summary" response across all 16 platforms.
Should my TypeScript client send X-API-Key or Authorization: Bearer?
Both headers are supported identically on https://api.upp3.com and https://mcp.upp3.com/mcp. Sending X-API-Key: YOUR_EDGEDATA_API_KEY is concise for REST backends, while Authorization: Bearer YOUR_EDGEDATA_API_KEY integrates cleanly with @modelcontextprotocol/sdk and OpenAI tool adapters.
Will retrying HTTP 504 or HTTP 429 inside EdgeDataClient charge extra credits?
No. EdgeData strictly enforces 0 Credits Charged on every upstream HTTP 504 timeout or HTTP 429 rate-limit response, making automatic exponential backoff completely safe for production services and Edge Workers.
Can I combine REST endpoints with @modelcontextprotocol/sdk in the same TypeScript app?
Yes. One EdgeData API key authenticates both https://api.upp3.com (67 REST endpoints) and https://mcp.upp3.com/mcp (56 native Hosted MCP tools via StreamableHTTPClientTransport), with mode="summary" saving ~80% LLM tokens.