nb-scraper
v1.3.0
Published
Community scraper library by Newbie Scrape
Downloads
102
Maintainers
Readme
A comprehensive TypeScript scraper library by NB Team that provides easy-to-use functions for interact with various scraper service from NB Scripts.
Scrapers Constributor
[!NOTE] If your name appears in the repository’s
app/scrapersfolder, 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:
Join Channel
Why NB-Scraper Library?
This project is designed to be easy to use. Visit the WhatsApp Channel for the code resources
- Fork the repository here
- Create a new branch
- Add your scraper function on
app/scrapers/ - Add your types on
app/types.ts - Add comprehensive tests in
integration-tests/(optional) - 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
Using npm:
npm install nb-scraperUsing yarn:
yarn add nb-scraperUsing pnpm:
pnpm add nb-scraperUsage
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);
}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);
}NETWORK_ERROR: Connection, timeout, or server issuesINVALID_INPUT: Invalid parameters or URL formatINVALID_RESPONSE: Unexpected response format from APIRATE_LIMITED: Rate limiting or quota exceededSERVICE_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.


