Node.js SDK (with TypeScript support) for the Rocket Scraper API. For more information, visit the GitHub repository.
- Node.js version 18.0 or above
npm install rocketscraper
To use the SDK, you need to create a new instance of the RocketClient
class and pass your API key as an argument.
import { createRocketClient } from 'rocketscraper';
const rocketClient = createRocketClient({
apiKey: 'YOUR_API_KEY',
});
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.
For more information on how to use the Rocket Scraper API, visit the Rocket Scraper API documentation.
This project is licensed under the MIT License. See the LICENSE file for more details.