Capture screenshots in V
Add screenshot and scrolling GIF capabilities to your V applications with net.http. Simple syntax, fast compilation, no headless browsers to manage.
Installation
- 1net.http is included in V standard library
- 2Get your API key from the dashboard
- 3Set the X-KEY header in your requests
Authentication
Include your API key in the X-KEY header with every request:
import net.http
mut header := http.new_header()
header.add_custom('X-KEY', 'your-api-key')!
resp := http.get(url) or { panic(err) }V Screenshot Example
Capture a screenshot or create a scrolling GIF animation with a simple GET request:
import net.http
import os
fn main() {
mut header := http.new_header()
header.add_custom('X-KEY', 'your-api-key') or { panic(err) }
resp := http.fetch(
url: 'https://api.scrnpix.com/screenshot?url=https%3A%2F%2Fexample.com&width=1280&height=720&format=png',
header: header
) or { panic(err) }
os.write_file_array('screenshot.png', resp.body) or { panic(err) }
}import net.http
import os
fn main() {
mut header := http.new_header()
header.add_custom('X-KEY', 'your-api-key') or { panic(err) }
resp := http.fetch(
url: 'https://api.scrnpix.com/animate?url=https%3A%2F%2Fexample.com&scroll_duration=3000&scroll_easing=ease-in-out',
header: header
) or { panic(err) }
os.write_file_array('animation.gif', resp.body) or { panic(err) }
}Response Format
On success, the API returns the image binary data directly in the response body.
| Status Code | 200 OK |
| Content-Type | image/png, image/jpeg, or image/gif |
| Body | Binary image data ([]u8) |
| Error Response | Error message with 4xx/5xx status |
Key Features
Zero Setup
net.http is built into V. No external dependencies or browser installations required.
Production Ready
Built on Cloudflare Workers with global edge network. Handles concurrency and browser lifecycle automatically.
V Integration
Simple syntax with fast compilation. Integrates seamlessly with vweb or any V application.
Rich Features
Custom viewport sizes, full page capture, PNG/JPEG formats, scrolling GIFs with 15 easing functions.
Frequently Asked Questions
Do I need to install any browser dependencies for V?
No. Scrnpix runs browsers on our infrastructure. You only need V's built-in net.http to make HTTP calls.
Can I use this with vweb?
Yes. Scrnpix works with any V environment — vweb applications, CLI tools, or plain V scripts.
How do I handle errors in V?
Use or blocks for error handling. A 200 status means success with image bytes in resp.body.
What V version is required?
V 0.3+ with net.http support. The API is a simple HTTP GET request.
Ready to capture screenshots in V?
Get your API key and start rendering screenshots in seconds. Free tier includes 50 screenshots per month.
Start Free