Capture screenshots in F#
Add screenshot and scrolling GIF capabilities to your F# applications with HttpClient. Functional-first, type-safe, no headless browsers to manage.
Installation
- 1Use .NET 6+ (includes HttpClient)
- 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:
open System.Net.Http
let client = new HttpClient()
client.DefaultRequestHeaders.Add("X-KEY", "your-api-key")
let! bytes = client.GetByteArrayAsync(url) |> Async.AwaitTaskF# Screenshot Example
Capture a screenshot or create a scrolling GIF animation with a simple GET request:
open System.Net.Http
open System.IO
let client = new HttpClient()
client.DefaultRequestHeaders.Add("X-KEY", "your-api-key")
let bytes =
client.GetByteArrayAsync("https://api.scrnpix.com/screenshot?url=https%3A%2F%2Fexample.com&width=1280&height=720&format=png")
|> Async.AwaitTask
|> Async.RunSynchronously
File.WriteAllBytes("screenshot.png", bytes)open System.Net.Http
open System.IO
let client = new HttpClient()
client.DefaultRequestHeaders.Add("X-KEY", "your-api-key")
let bytes =
client.GetByteArrayAsync("https://api.scrnpix.com/animate?url=https%3A%2F%2Fexample.com&scroll_duration=3000&scroll_easing=ease-in-out")
|> Async.AwaitTask
|> Async.RunSynchronously
File.WriteAllBytes("animation.gif", bytes)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 (byte[]) |
| Error Response | Error message with 4xx/5xx status |
Key Features
Zero Setup
No need to install Canopy or manage browser processes. Just use HttpClient included in .NET.
Production Ready
Built on Cloudflare Workers with global edge network. Handles concurrency and browser lifecycle automatically.
F# Integration
Pipe operators and async workflows. Integrates seamlessly with Giraffe, Saturn, Fable, or any F# 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 F#?
No. Scrnpix runs browsers on our infrastructure. You only need HttpClient to make HTTP calls.
Can I use this with Giraffe or Saturn?
Yes. Scrnpix works with any F# environment — Giraffe, Saturn, SAFE Stack, or plain F# applications.
How do I handle errors in F#?
Check the response status code. A 200 status means success with image bytes in the body. Use Result or Option types for error handling.
What .NET version is required?
.NET 6+ is recommended for modern F# support. The API is a simple HTTP GET request.
Ready to capture screenshots in F#?
Get your API key and start rendering screenshots in seconds. Free tier includes 50 screenshots per month.
Start Free