Skip to content

Latest commit

 

History

History
49 lines (39 loc) · 1.74 KB

File metadata and controls

49 lines (39 loc) · 1.74 KB

Deploy on Railway

Shotlink is a lightweight and efficient REST API service written in Go that allows you to capture high-quality screenshots of websites programmatically. Designed for developers, automation tools, monitoring systems, and visual reporting platforms, Shotlink leverages Chrome Headless via chromedp to render fully interactive web pages—including dynamic JavaScript content and custom styles.

How to use

  1. Make a request: Send a GET request to https://shotlink.nexvul.com/get?url=<URL>, replacing <URL> with the website you want to capture.
  2. Receive the screenshot: The server will respond with a PNG image of the website screenshot.

Example request

curl -X GET "https://shotlink.nexvul.com/get?url=https://example.com" -o screenshot.png

Requirements

  • Go 1.18 or later
  • chromedp package for browser automation
  • cdproto package for Chrome DevTools Protocol
  • emulation package for viewport emulation
  • context package for managing request context
  • time package for request timeout
  • net/http package for handling HTTP requests
  • log package for logging errors

How to run locally

  1. Clone the repository:
    git clone https://github.com/Gausix/Shotlink
  2. Change into the project directory:
    cd Shotlink
  3. Install the required Go packages:
    go mod tidy
  4. Run the server:
    go run main.go
  5. Access the service at http://localhost:8080/get?url=<URL>. Replace <URL> with the website you want to capture.