Capture screenshots in COBOL
Add screenshot and scrolling GIF capabilities to your COBOL applications via REST API integration. Modernize legacy systems, no browser infrastructure needed.
Installation
- 1Configure HTTP client support (CICS Web Services, Enterprise COBOL, or middleware)
- 2Get your API key from the dashboard
- 3Set the X-KEY header in your HTTP requests
Authentication
Include your API key in the X-KEY header with every request:
* Using EXEC CICS WEB or middleware
MOVE "your-api-key" TO WS-API-KEY
MOVE "X-KEY" TO WS-HEADER-NAME
EXEC CICS WEB WRITE HTTPHEADER(WS-HEADER-NAME)
VALUE(WS-API-KEY) END-EXECCOBOL Screenshot Example
Capture a screenshot or create a scrolling GIF animation with a simple GET request:
IDENTIFICATION DIVISION.
PROGRAM-ID. SCREENSHOT-API.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-URL PIC X(200) VALUE
"https://api.scrnpix.com/screenshot?url=https%3A%2F%2Fexample.com&width=1280&height=720&format=png".
01 WS-API-KEY PIC X(50) VALUE "your-api-key".
PROCEDURE DIVISION.
EXEC CICS WEB OPEN HOST(WS-URL) END-EXEC
EXEC CICS WEB WRITE HTTPHEADER("X-KEY")
VALUE(WS-API-KEY) END-EXEC
EXEC CICS WEB READ INTO(WS-RESPONSE) END-EXEC. IDENTIFICATION DIVISION.
PROGRAM-ID. ANIMATE-API.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-URL PIC X(200) VALUE
"https://api.scrnpix.com/animate?url=https%3A%2F%2Fexample.com&scroll_duration=3000&scroll_easing=ease-in-out".
01 WS-API-KEY PIC X(50) VALUE "your-api-key".
PROCEDURE DIVISION.
EXEC CICS WEB OPEN HOST(WS-URL) END-EXEC
EXEC CICS WEB WRITE HTTPHEADER("X-KEY")
VALUE(WS-API-KEY) END-EXEC
EXEC CICS WEB READ INTO(WS-RESPONSE) END-EXEC.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 |
| Error Response | Error message with 4xx/5xx status |
Key Features
Zero Setup
No browser installation on mainframe required. Just make HTTP calls through CICS Web Services or middleware.
Production Ready
Built on Cloudflare Workers with global edge network. Handles concurrency and browser lifecycle automatically.
COBOL Integration
Works with CICS, IMS, Micro Focus, or any COBOL environment with HTTP/REST support.
Rich Features
Custom viewport sizes, full page capture, PNG/JPEG formats, scrolling GIFs with 15 easing functions.
Frequently Asked Questions
How do I call REST APIs from COBOL?
Use CICS Web Services, IBM z/OS Connect, Micro Focus Enterprise Server, or middleware like MuleSoft to make HTTP calls.
Can I use this with mainframe COBOL?
Yes. Scrnpix is a REST API accessible from any environment with HTTP capabilities, including mainframes via CICS or middleware.
How do I handle the binary response?
Store the binary response in a BLOB field or write to a file using your platform's I/O facilities.
What COBOL version is required?
Any COBOL version with HTTP client support through CICS, middleware, or external program calls.
Ready to capture screenshots in COBOL?
Get your API key and start rendering screenshots in seconds. Free tier includes 50 screenshots per month.
Start Free