rocketscraper
v0.0.3
Published
Node.js SDK (with TypeScript support) for the Rocket Scraper API.
Downloads
14
Maintainers
Readme
Rocket Scraper API Node.js SDK
Node.js SDK (with TypeScript support) for the Rocket Scraper API. For more information, visit the GitHub repository.
Requirements
- Node.js version 18.0 or above
Installation
npm install rocketscraper
Usage
To use the SDK, you need to create a new instance of the RocketClient
class and pass your API key as an argument.
Setup
import { createRocketClient } from 'rocketscraper';
const rocketClient = createRocketClient({
apiKey: 'YOUR_API_KEY',
});
Scrape
The scrape
method allows you to scrape data from a website using a schema. The method returns the scraped data in the format specified in the schema.
const data = await rocketClient.scrape({
url: 'https://ycombinator.com/companies/pagerduty',
schema: {
company: 'string',
image_url: 'string',
founded_at: 'string',
size: 'integer',
location: 'string',
short_description: 'string',
long_description: 'string',
is_active: 'boolean',
founders: [
{
name: 'string',
role: 'string',
},
],
},
});
console.log(data);
For more details, visit the Node.js SDK GitHub repository.
Documentation
For more information on how to use the Rocket Scraper API, visit the Rocket Scraper API documentation.
License
This project is licensed under the MIT License. See the LICENSE file for more details.