docs-scraper
v1.0.6
Published
CLI and SDK for scraping documents from DocSend, Notion, and other sources
Maintainers
Readme
docs-scraper
To install dependencies:
bun installTo run:
bun run index.tsThis project was created using bun init in bun v1.1.30. Bun is a fast all-in-one JavaScript runtime.
Supported Links
- [ ] Notion
- [ ] Docsend
- [ ] Pitch.com
- [ ] Google slides
- [ ] Google drives
- [ ] PDF links
How it works?
- User sends link via
/api/v1/scrapewith url and JSON objectdatathat may containemail,passwordor other values - A spin up Playwright to interact with the page
- For templated projects we will follow our scripts, if blockers are met, it stores the status and required items to proceed
- User polls
/api/v1/results/:jobIdto check scraping result and status. If blocked, users should provide blocking items via ``api/v1/update` - Scraped content gets stored into a PDF file.
- Each scrape returns an array of PDF file. For single page link, it returns an array of single PDF file link. For pages that may contain multiple scraping jobs (e.g. Docsend folders), we will return an array of pdf link.
/api/v1/scrapereturns sessionId and jobId. To scrape with an old session (e.g. to avoid signing in twice), pass sessionId as parameter- Falls back to using LLM to scrape when links are not supported.
API Endpoints
| Method | Endpoint | description | | ------ | ---------------------- | ------------------- | | POST | /api/v1/scrape | Submit job | | POST | /api/v1/update | Provide auth data | | GET | /api/v1/results/:jobId | Poll for results | | GET | /api/v1/jobs | List jobs | | DELETE | /api/v1/jobs/:jobId | Cancel job | | GET | /api/v1/sessions | List saved sessions | | DELETE | /api/v1/sessions | Clear sessions |
Tech Stack
- Typescript + express
- BullMQ to queue tasks
- Playwright to interact with links
- Cloudflare R2 to store scraped content as PDF files
Auth
Use a simple api secret to gate access to this service.
- Configure
API_SECRETin your env variables - All requests must include
x-api-secretto access the service
