🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@metalift/sdk

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metalift/sdk

Metalift TypeScript SDK

latest
Source
npmnpm
Version
1.0.12
Version published
Weekly downloads
355
1320%
Maintainers
1
Weekly downloads
 
Created
Source

@metalift/sdk

Official TypeScript/JavaScript SDK for Metalift — turn any URL into agent-ready markdown, HTML, or structured data.

Requirements

  • Node.js 20+
  • ESM only — use import, not require()

Install

npm install @metalift/sdk

Quick start

import Metalift from "@metalift/sdk";

const client = new Metalift({ apiKey: "YOUR_API_KEY" });

const result = await client.scrape({
  url: "https://example.com",
  formats: ["markdown"],
});
console.log(result.data.markdown);

Get an API key from the Metalift dashboard.

Web search (decoupled from scrape)

Search returns top 10 SERP snippets (2 credits). Scrape URLs separately when you need full content (1+ credits each):

const serp = await client.search({ query: "docker docs" });
for (const hit of serp.results) {
  console.log(hit.title, hit.url);
}

const page = await client.scrape({
  url: serp.results[0].url,
  formats: ["markdown"],
});
console.log(page.data.markdown);

Configuration

import Metalift from "@metalift/sdk";

const client = new Metalift({
  apiUrl: "https://api.metalift.ai", // default
  apiKey: process.env.METALIFT_API_KEY,
});
VariableDescription
METALIFT_API_URLAPI base URL (default: https://api.metalift.ai)
METALIFT_API_KEYBearer token for authenticated requests

Metalift Cloud requires X-B2B-Attestation: I-confirm-B2B-use on authenticated requests. @metalift/sdk ≥ 1.0.11 sends this header automatically.

CommonJS projects

This package is ESM-only. In CommonJS projects, use dynamic import:

const { default: Metalift } = await import("@metalift/sdk");

Or add "type": "module" to your package.json, or use .mjs entry files.

FAQs

Package last updated on 31 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts