nb-scraper
TypeScript icon, indicating that this package has built-in type declarations

1.2.7 β€’ Public β€’ Published

icon

A comprehensive TypeScript scraper library by NB Team that provides easy-to-use functions for interact with various scraper service from NB Scripts.

Maintenance Open Source? Yes! Npm package version NPM Last Update Code Factor License: Unlicense Codacy Badge CI/CD Pipeline The Maintener

Scrapers Constributor

adhaaz
daffa
fongsidev
Fongsi
paxsenix0
Alex
lemonsync
Lemon
najmyw
NajmyW
yogikid
Yogi Priyan Perdana

[!NOTE] If your name appears in the repository’s app/scrapers folder, submit your GitHub username via an issue or pull request to be added to this contributor list.

πŸ“’ Join Our WhatsApp Channel

Untuk update terbaru, dukungan, dan sumber daya scraping terbaik, ikuti saluran resmi kami:

NB SCRAPER di WhatsApp:
WhatsApp Icon Join Channel

Why NB-Scraper Library?

This project is designed to be easy to use. Visit the WhatsApp Channel for the code resources

πŸ”½ Want to Include Your Scraper?
  1. Fork the repository here
  2. Create a new branch
  3. Add your scraper function on app/scrapers/
  4. Add your types on app/types.ts
  5. Add comprehensive tests in integration-tests/ (optional)
  6. Submit a pull request

Pro Tip: Join our WhatsApp Channel for contribution support!

[!IMPORTANT] If you encounter an error while using the library or are confused about adding your own scraper, feel free to open an issue.

πŸ“¦ Installation

NPM

Using npm:

npm install nb-scraper

Using yarn:

yarn add nb-scraper

Using pnpm:

pnpm add nb-scraper

Usage

ESM Support
import { generateDeepInfraResponse } from 'nb-scraper';

const result = await generateDeepInfraResponse({
  prompt: "Explain JavaScript in simple terms",
  model: "deepseek-ai/DeepSeek-R1"
});

if (result.status) {
  console.log(result.data.response);
}
CommonJS Support
const { generateDeepInfraResponse } = require('nb-scraper');

// Same usage as above
(async () => {
  const result = await generateDeepInfraResponse('What the meaning of Pahlawan Indonesia?');
  console.log(result);
})();

[!TIP] For detailed functions and examples, see the documentation at nb-scraper.js.org

πŸ›‘οΈ Error Handling

NB Scraper is designed to never throw errors. Instead, all functions return a response object with a status field:

const result = await generateDeepInfraResponse('test query');

if (result.status) {
  // Success - use result.data
  console.log(result.data.response);
} else {
  // Error - check result.error
  console.error(result.error);
}
Common error types:
  • NETWORK_ERROR: Connection, timeout, or server issues

  • INVALID_INPUT: Invalid parameters or URL format

  • INVALID_RESPONSE: Unexpected response format from API

  • RATE_LIMITED: Rate limiting or quota exceeded

  • SERVICE_UNAVAILABLE: Service temporarily unavailable

See the ERROR TYPES

Available Scrapers

See The scrapers folder

πŸ“„ License

This project is licensed under the Unlicense – see the LICENSE file for details.

πŸ”— Links

Made with β˜•

/nb-scraper/

    Package Sidebar

    Install

    npm i nb-scraper

    Weekly Downloads

    288

    Version

    1.2.7

    License

    Unlicense

    Unpacked Size

    755 kB

    Total Files

    9

    Last publish

    Collaborators

    • er-npm