WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

wordbricks/nextrows-client

Repository files navigation

@wordbricks/nextrows-client

npm version

TypeScript client for Nextrows Open API.

Getting Started

API Key

To use this client, you need a NextRows API key. Create one at:

NextRows Dashboard → Create API Key

Documentation

For complete API documentation, visit: NextRows API Docs

Installation

npm install @wordbricks/nextrows-client
yarn add @wordbricks/nextrows-client
pnpm add @wordbricks/nextrows-client
bun add @wordbricks/nextrows-client

Quick Start

import { Nextrows } from "@wordbricks/nextrows-client";

const client = new Nextrows({ apiKey: "sk-nr-your-api-key" });

API Methods

Extract Data

Extract structured data from URLs or text content using AI.

const result = await client.extract({
  type: "url",
  data: ["https://example.com/products"],
  prompt: "Extract all product names and prices",
});

if (result.success) {
  console.log(result.data);
}

Using Zod Schema

You can use Zod schemas to define the extraction output structure (requires Zod 3.24+):

import { z } from "zod/v4";

const productSchema = z.array(
  z.object({
    name: z.string(),
    price: z.number(),
  })
);

const result = await client.extract({
  type: "url",
  data: ["https://example.com/products"],
  schema: productSchema,
});

Run App

Run a published NextRows app and get JSON output.

const result = await client.runAppJson({
  appId: "abc123xyz",
  inputs: [
    { key: "url", value: "https://example.com/products" },
    { key: "maxItems", value: 10 },
  ],
});

if (result.success && result.data) {
  console.log("Columns:", result.data.columns);
  console.log("Rows:", result.data.rows);
  console.log(`Run ID: ${result.runId}`);
  console.log(`Elapsed time: ${result.elapsedTime}ms`);
}

Get Credits

Get the current credit balance for the authenticated user.

const result = await client.getCredits();

if (result.success && result.data) {
  console.log(`Remaining credits: ${result.data.credits}`);
}

Configuration

const client = new Nextrows({
  apiKey: "sk-nr-your-api-key",
  baseUrl: "https://api.nextrows.com", // default
  timeout: 30000, // default, in milliseconds
});

Features

  • Fully Typed: All request and response types are exported for TypeScript support
  • Simple API: Easy-to-use methods that mirror the REST API
  • Configurable: Custom base URL and timeout options
  • Zod Support: Use Zod schemas for type-safe extraction (optional, requires Zod 3.24+)

About

API client of nextrows.com

Resources

License

Stars

Watchers

Forks

Packages

No packages published