Skip to content

CalculatorBit/SnapFromWeb

Repository files navigation

SnapFromWeb

A web service that captures screenshots of web pages using Puppeteer with stealth mode and ad-blocking capabilities.

Screenshot

Features

  • Single and bulk URL screenshot capture
  • Stealth mode to avoid detection
  • Ad-blocking for clean screenshots
  • Caching of previously captured screenshots
  • Concurrent processing using Puppeteer Cluster
  • High-quality full-page screenshots
  • Caching of previously captured screenshots
  • Screenshot Organization by Domain

Things to remember

  • public/i/ is a reserved directory for screenshots and added in .gitignore file
  • public/og.png is the preview image that appears when sharing the homepage link

API Endpoints

POST /api/screenshot

Captures screenshots of one or more web pages.

Request Format

For a single URL:

{
  "urls":["http://localhost:4321/"]
}

For multiple URLs:

{
  "urls": [
    "https://example.com",
    "https://example.org"
  ]
}

Response Format

{
    "success": true,
    "data": {
        "urls": [
            {
                "original": "http://localhost:4321/",
                "screenshot": "http://localhost:4321/i/localhost/ee169604f4cebd35817a28306f40ab7fa34409f0eabb32806cdbad7252aabd53.png"
            }
        ]
    }
}

Development

  1. Install dependencies:
pnpm install
  1. Start the development server:
pnpm dev
  1. Build for production:
pnpm build

About

Create Screenshot from URL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published