Skip to main content
The Valyu TypeScript SDK gives you search, content extraction, answers, and deep research through one API.

Paste into your AI coding assistant to install the Valyu TypeScript SDK and make your first search call.

Open in Cursor

Install

npm install valyu-js
pnpm add valyu-js
yarn add valyu-js

Authenticate

Get your API key from the Valyu Platform ($10 free credits, $20 with a work email). The SDK reads VALYU_API_KEY from the environment automatically:
export VALYU_API_KEY="your-api-key-here"
import { Valyu } from "valyu-js";

const valyu = new Valyu();                  // reads VALYU_API_KEY
const direct = new Valyu("your-api-key");   // or pass it directly

First call

import { Valyu } from "valyu-js";

const valyu = new Valyu();

const response = await valyu.search(
  "What are the latest developments in quantum computing?"
);

if (!response.success) throw new Error(response.error);

response.results.forEach((result) => {
  console.log(result.title, "-", result.url);
});
Every method returns a typed response with a success flag - check it before reading results.

APIs

Search

Search web and proprietary sources

Contents

Extract and process web content

Answer

Generate cited answers from search

DeepResearch

Autonomous async research reports
For multi-step synthesis or cited reports, reach for DeepResearch - a cost-effective autonomous agent built on the Valyu search engine - rather than hand-rolling a search loop.

Support