npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

zapserp

v1.0.2

Published

Official SDK for ZapSERP – Perform smart search (SERP) and reader (WEB CRAWLER) operations via API

Readme

Zapserp

Official TypeScript SDK for the ZapSerp API — smart search (SERP), web content extraction, and AI-powered answers.

🔍 What It Does

  • Search the web via Google, Bing, or DuckDuckGo
  • Extract full content from any web page
  • Use AI to summarize search results with cited sources
  • Multi-language support and advanced filters

🚀 Installation

npm install zapserp

⚡ Quick Start

import { Zapserp } from 'zapserp';

const sdk = new Zapserp({
  apiKey: 'your-api-key-here',
});

const results = await sdk.search({
  query: 'artificial intelligence',
  limit: 5,
});

console.log(results);

🔧 Features

1. Web Search (/search)

const results = await sdk.search({
  query: 'machine learning',
  engines: ['google', 'bing'],
  limit: 10,
  language: 'en',
  country: 'us',
  timeRange: 'week',
});

Returns:

SearchResult[] // Array of search items with title, url, optional snippet, and engines

2. Content Extraction (/reader)

Single Page

const result = await sdk.reader({
  url: 'https://en.wikipedia.org/wiki/Artificial_intelligence',
});

console.log(result.page.title);
console.log(result.page.contentLength);
console.log(result.page.metadata?.description);

Multiple Pages

const batch = await sdk.readerBatch({
  urls: ['https://example.com/1', 'https://example.com/2'],
});

batch.results.forEach(page => {
  console.log(page.title);
});

3. Combined Search + Extraction (/search/r)

const results = await sdk.searchWithReader({
  query: 'OpenAI GPT-4',
  limit: 3,
});

results.results.forEach(page => {
  console.log(`${page.title}: ${page.contentLength} characters`);
});

4. AI-Powered Search (/search/ai)

const summary = await sdk.aiSearch({
  query: 'What is quantum computing?',
  depth: 'medium',
});

console.log(summary.content);
console.log(`Based on ${summary.totalSources} sources`);

⚙️ Configuration Options

Search Engines

engines: ['google'] | ['bing'] | ['duckduckgo'] | ['google', 'bing']

Time Ranges

timeRange: 'day' | 'week' | 'month' | 'year' | 'any'

Safe Search

safeSearch: 0 | 1 | 2  // OFF | MODERATE | STRICT

Search Depth (AI Search)

depth: 'light' | 'medium' | 'deep'

🌍 Examples

Multi-language Search

const results = await sdk.search({
  query: 'الذكاء الاصطناعي', // Arabic
  language: 'ar',
  country: 'sa',
  limit: 3,
});

Content with Metadata

const page = await sdk.reader({
  url: 'https://example.com',
});

if (page.page.metadata?.description) {
  console.log(`Description: ${page.page.metadata.description}`);
}

if (page.page.metadata?.ogImage) {
  console.log(`Image: ${page.page.metadata.ogImage}`);
}

Error Handling

try {
  const results = await sdk.search({ query: 'test' });
} catch (error) {
  if (error.message.includes('Invalid')) {
    console.log('Check your API key');
  } else {
    console.log('API Error:', error.message);
  }
}

🧪 Types

All request and response types are included, such as SearchRequest, SearchResult, Page, TokenUsage, and more.


🧠 Get Started

  1. Get your API key from zapserp.com
  2. Install the SDK: npm install zapserp
  3. Start searching & crawling

🆘 Need Help?