SkyShot is a microservice built with Skykit that captures screenshots of websites. Simply append any URL to the service URL and get an instant screenshot.
Simply append any URL to the SkyShot service URL:
<img src="https://shot.skysca.pe/https://example.com" />
<!-- Screenshot of GitHub -->
<img src="https://shot.skysca.pe/https://github.com" />
<!-- Screenshot of The Skyscape -->
<img src="https://shot.skysca.pe/https://theskyscape.com" />
[]byte# Build the Docker image
docker build -t skyshot .
# Run the container
docker run -p 5000:5000 skyshot
# Install Chromium
sudo apt-get install chromium-browser
# Run the service
go run .
Visit http://localhost:5000 to see the homepage.
# Build the binary
go build -o skyshot .
# Deploy to The Skyscape infrastructure
../devtools/build/launch-app deploy \
--name skyshot \
--binary ./skyshot
Homepage with usage instructions and examples.
Capture and return a screenshot of the given URL.
Parameters:
url - Full URL including protocol (http:// or https://)Response:
Example:
GET /https://example.com
type Screenshot struct {
ID int // Auto-generated
URL string // The URL that was screenshotted (unique)
ImageData []byte // The screenshot as PNG bytes
IsDefault bool // True if this is the fallback image
CreatedAt time.Time // When the screenshot was captured
UpdatedAt time.Time // Last updated
}
SkyShot uses environment variables for configuration:
PORT - Server port (default: 5000)HOST_PREFIX - Host prefix for routing (optional)SkyShot handles errors gracefully:
The default image is a beautiful gradient background from The Skyscape web-server.
Once deployed, web-server can use SkyShot for:
Example integration:
<!-- In web-server templates -->
<img src="https://shot.skysca.pe/https://app.theskyscape.com/{{ .App.ID }}"
alt="App screenshot">
skyshot/
├── main.go # Application entry point
├── controllers/ # HTTP handlers
│ └── screenshots.go # Screenshot capture and serving
├── models/ # Data models
│ ├── database.go # Database connection
│ └── screenshot.go # Screenshot model
├── views/ # HTML templates
│ ├── home.html # Homepage
│ └── public/ # Static assets
│ └── default.png # Fallback image
├── Dockerfile # Docker configuration
├── go.mod # Go dependencies
└── README.md # This file
Part of The Skyscape platform.
This project was built using knowledge from:
Snapshotting Service for the SkyScape.