Capture Node SDK
Node Library for capture.page
Get your API Key and Secret from https://capture.page/console
List of all capture options: https://docs.capture.page
Installation
npm install capture-node
Usage
List of all capture options: https://docs.capture.page
Image
import { Capture } from 'capture-node';
const capture = new Capture(YOUR_API_KEY, YOUR_API_SECRET);
const url = capture.buildImageUrl('https://capture.page/', {
full: true,
delay: 3,
t: Date.now()
});
const image = await capture.fetchImage('https://capture.page/', {
full: true,
delay: 3,
t: Date.now()
});
Now stick that url in an img tag to render the screenshot!
PDF
import { Capture } from 'capture-node';
const capture = new Capture(YOUR_API_KEY, YOUR_API_SECRET);
const url = capture.buildPdfUrl('https://capture.page/', {
full: true,
delay: 3,
t: Date.now()
});
const pdf = capture.fetchPdf('https://capture.page/', {
full: true,
delay: 3,
t: Date.now()
});
Content
import { Capture } from 'capture-node';
const capture = new Capture(YOUR_API_KEY, YOUR_API_SECRET);
const url = capture.buildContentUrl('https://capture.page/');
const content = await capture.fetchContent('https://capture.page/');
Metadata
import { Capture } from 'capture-node';
const capture = new Capture(YOUR_API_KEY, YOUR_API_SECRET);
const url = capture.buildMetadataUrl('https://capture.page/');
const content = await capture.fetchMetadata('https://capture.page/');