UnSearch Docs

JavaScript SDK

Official UnSearch JavaScript/TypeScript SDK reference.

JavaScript SDK

Installation

npm install @unsearch/sdk

Quick Start

import { UnSearch } from '@unsearch/sdk';

const client = new UnSearch({ apiKey: 'sk_live_...' });

// Search
const results = await client.search({
  query: 'latest AI news',
  engines: ['google', 'bing'],
  maxResults: 10,
});

// Extract content
const content = await client.extract('https://example.com');

// Agent search (Tavily-compatible)
const answer = await client.agentSearch({
  query: 'What is RAG?',
  includeAnswer: true,
});

Configuration

const client = new UnSearch({
  apiKey: 'sk_live_...',
  baseUrl: 'https://api.unsearch.dev', // or your self-hosted URL
  timeout: 30000,
});

Requirements

  • Node.js >= 16
  • TypeScript >= 4.5 (optional)

On this page