Skip to content

Repository files navigation

iconNPMCodeFactorTypeScriptLicense: UnlicenseCodacy BadgeCI/CD Pipeline

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

📢 Join Our WhatsApp Channel

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

NB SCRAPER di WhatsApp:
WhatsApp IconJoin Channel

Why NB-Scrape Library?

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

📦 Installation

Using npm:

npm install nb-scraper

Using yarn:

yarn add nb-scraper

Using pnpm:

pnpm add nb-scraper

🛠️ Usage

ESM (Modern JavaScript/TypeScript)

import{generateDeepInfraResponse}from'nb-scraper';constresult=awaitgenerateDeepInfraResponse({prompt: "Explain JavaScript in simple terms",model: "deepseek-ai/DeepSeek-R1"});if(result.status){console.log(result.data.response);}

CommonJS (Node.js)

const{ generateDeepInfraResponse }=require('nb-scraper');// Same usage as above it(async()=>{constresult=awaitgenerateDeepInfraResponse('What the meaning of Pahlawan Indonesia?');console.log(result);})();

See Documentation: Nb-Scraper-Docs

Success Response Example

{creator: "...",status: true,data: {response: "...",}}

Error Response Example

{creator: "NB Team",status: false,error: "[NETWORK_ERROR] Request timeout after 30000ms"}

🛡️ Error Handling

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

constresult=awaitgenerateDeepInfraResponse('test query');if(result.status){// Success - use result.dataconsole.log(result.data.response);}else{// Error - check result.errorconsole.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 ☕

About

All Scrapers Resource Available Here! Give Us Stars🌟

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages