
A microservice to fetch URLs and render them as:
- HTML: GET /html?url=
- Markdown: GET /markdown?url=
- PNG screenshot: GET /image?url=
npm install
# or
yarn install
yarn dev
- Start the development server with hot reloading using nodemonyarn start
- Start the service using Docker Compose
yarn test
- Run all unit testsyarn test:watch
- Run tests in watch modeyarn test:e2e
- Run end-to-end testsyarn test:e2e:docker
- Run end-to-end tests against Docker containeryarn test:all
- Run all tests including build and e2e tests
yarn build
- Build and start the Docker container
yarn examples:python
- Run Python example scriptsyarn examples:javascript
- Run JavaScript example scriptsyarn examples
- Run all examples (requires build)
yarn dev
curl http://localhost:3000/html?url=https://example.com
# Build and run using Docker Compose
yarn start
# Or manually
docker build -t web-capture .
docker run -p 3000:3000 web-capture
GET /html?url=<URL>
Returns the raw HTML content of the specified URL.
GET /markdown?url=<URL>
Converts the HTML content of the specified URL to Markdown format.
GET /image?url=<URL>
Returns a PNG screenshot of the specified URL.
The service is built with:
- Express.js for the web server
- Puppeteer for headless browser automation and screenshots
- Turndown for HTML to Markdown conversion
- Jest for testing
UNLICENSED