Capture screenshots in React Native
Add screenshot and scrolling GIF capabilities to your React Native applications with fetch API. One codebase, iOS and Android support.
Installation
- 1fetch is built into React Native
- 2Get your API key from the dashboard
- 3Set the X-KEY header in your fetch requests
Authentication
Include your API key in the X-KEY header with every request:
const response = await fetch(url, {
headers: { 'X-KEY': 'your-api-key' }
});
const blob = await response.blob();React Native Screenshot Example
Capture a screenshot or create a scrolling GIF animation with a simple GET request:
const response = await fetch(
'https://api.scrnpix.com/screenshot?url=https%3A%2F%2Fexample.com&width=1280&height=720&format=png',
{ headers: { 'X-KEY': 'your-api-key' } }
);
const blob = await response.blob();
// Use FileSystem or Share API to save/display the imageconst response = await fetch(
'https://api.scrnpix.com/animate?url=https%3A%2F%2Fexample.com&scroll_duration=3000&scroll_easing=ease-in-out',
{ headers: { 'X-KEY': 'your-api-key' } }
);
const blob = await response.blob();
// Use FileSystem or Share API to save/display the animationResponse 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 (Blob) |
| Error Response | Error message with 4xx/5xx status |
Key Features
Zero Setup
fetch is built into React Native. No native modules or WebView required.
Production Ready
Built on Cloudflare Workers with global edge network. Handles concurrency and browser lifecycle automatically.
React Native Integration
Works with Expo and bare React Native. Display images with Image component or save with react-native-fs.
Rich Features
Custom viewport sizes, full page capture, PNG/JPEG formats, scrolling GIFs with 15 easing functions.
Frequently Asked Questions
Do I need any native modules for this?
No. Scrnpix uses standard fetch API. Optionally use react-native-fs to save images to device storage.
Does this work with Expo?
Yes. Scrnpix works with Expo managed and bare workflows, as well as plain React Native projects.
How do I display the screenshot in my app?
Convert the blob to a base64 URI or save to file system, then use the Image component with the source.
What React Native version is required?
React Native 0.60+ with fetch support. The API is a simple HTTP GET request.
Ready to capture screenshots in React Native?
Get your API key and start rendering screenshots in seconds. Free tier includes 50 screenshots per month.
Start Free