Capture screenshots in Elixir
Add screenshot and scrolling GIF capabilities to your Elixir applications with HTTPoison or Req. Fault-tolerant, concurrent, no headless browsers to manage.
Installation
- 1Add req to mix.exs: {:req, "~> 0.4.0"}
- 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:
{:ok, response} = Req.get(url,
headers: [{"X-KEY", "your-api-key"}]
)Elixir Screenshot Example
Capture a screenshot or create a scrolling GIF animation with a simple GET request:
{:ok, response} = HTTPoison.get(
"https://api.scrnpix.com/screenshot?url=https%3A%2F%2Fexample.com&width=1280&height=720&format=png",
[{"X-KEY", "your-api-key"}]
)
File.write!("screenshot.png", response.body){:ok, response} = HTTPoison.get(
"https://api.scrnpix.com/animate?url=https%3A%2F%2Fexample.com&scroll_duration=3000&scroll_easing=ease-in-out",
[{"X-KEY", "your-api-key"}]
)
File.write!("animation.gif", response.body)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 (binary) |
| Error Response | Error message with 4xx/5xx status |
Key Features
Zero Setup
No need to install Wallaby or manage browser processes. Just use Req or HTTPoison for HTTP calls.
Production Ready
Built on Cloudflare Workers with global edge network. Handles concurrency and browser lifecycle automatically.
Elixir Integration
Pattern matching and pipes. Integrates seamlessly with Phoenix, LiveView, Oban, or any Elixir 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 Elixir?
No. Scrnpix runs browsers on our infrastructure. You only need Req or HTTPoison to make HTTP calls.
Can I use this with Phoenix or LiveView?
Yes. Scrnpix works with any Elixir environment — Phoenix, LiveView, Nerves, or plain Elixir applications.
How do I handle errors in Elixir?
Pattern match on the response tuple. {:ok, response} means success with image bytes in the body. Use with or case for error handling.
What Elixir version is required?
Elixir 1.12+ with Req or HTTPoison support. The API is a simple HTTP GET request.
Ready to capture screenshots in Elixir?
Get your API key and start rendering screenshots in seconds. Free tier includes 50 screenshots per month.
Start Free