Microlink.io integration for Zapier CLI (
zapier-platform-corev15): fetch metadata, screenshots, PDFs, Markdown, plain text, audio/video sources, performance insights, and logo palette data from any URL.
- What This App Includes
- Installation
- Authentication
- Actions (Tools)
- Parameters Reference
- Query-Building Rules
- Error Handling
- How to Use in Zapier CLI
- Testing
- Project Structure
- Custom auth with optional API key (
x-api-key) and optional base URL override. - 9 create actions (no triggers, no searches):
extract,screenshot,pdf,markdown,text,audio,video,insights,logo.
- Full Microlink query-param mapping, including nested dot-notation flattening.
- Advanced options, JSON object inputs, and additional arbitrary query params.
- Error normalization for HTTP failures and Microlink
{ status: "error" }responses. - Action-level tests using
zapier-platform-coretest tools +nock.
- Node.js
>=18 - npm
- Zapier CLI account access (for
zapier push)
npm installRun tests:
npm testConfigured in authentication.js using Zapier type: "custom".
| Field | Type | Required | Description |
|---|---|---|---|
apiKey |
password | No | Microlink Pro/Enterprise API key. If present, sent as x-api-key header. |
apiEnvironment |
string | No | Endpoint selection: auto (default), public, or pro. |
baseUrl |
string | No | Legacy field from older connections, still honored if set to a trusted endpoint. |
Base URL resolution:
- If legacy
baseUrlis present and trusted -> use it. - Else if
apiEnvironmentispublic->https://api.microlink.io. - Else if
apiEnvironmentispro->https://pro.microlink.io. - Else if
apiKeyexists ->https://pro.microlink.io. - Else ->
https://api.microlink.io.
Auth test behavior:
- Calls
GET <baseUrl>?url=https://example.com. - Expects Microlink JSON with
status: "success".
All tools are Zapier creates actions and share the same input fields.
Each action applies its own default query flags (shown below), then merges optional parameters.
| Action Key | Label | File | Auto Query Params |
|---|---|---|---|
extract |
Extract | creates/extract.js |
none |
screenshot |
Screenshot | creates/screenshot.js |
screenshot=true |
pdf |
creates/pdf.js |
pdf=true |
|
markdown |
Markdown | creates/markdown.js |
force=true, meta=false, embed=markdown, data.markdown.attr=markdown |
text |
Text | creates/text.js |
force=true, meta=false, embed=text, data.text.attr=text |
audio |
Audio | creates/audio.js |
audio=true |
video |
Video | creates/video.js |
video=true |
insights |
Insights | creates/insights.js |
insights=true |
logo |
Logo | creates/logo.js |
palette=true |
Returns metadata and extracted data from a URL.
Generates browser-rendered screenshots. Supports viewport and screenshot options.
Generates PDFs. Supports PDF and viewport options.
Returns page content in Markdown format (using Microlink embed extraction).
Returns page content as plain text (using Microlink embed extraction).
Detects playable audio sources.
Detects playable video sources.
Returns performance/technology insights.
Returns logo metadata, including palette data via palette=true.
| Input Field | Type | Required | Default | Description |
|---|---|---|---|---|
url |
string | Yes | - | The URL to analyze. |
responseMode |
string | No | auto |
auto, json, text, or binary. |
binaryProperty |
string | No | data |
Output property name for binary mode payloads. |
| Mode | Behavior |
|---|---|
auto |
Returns JSON unless embed is present, then returns text payload. |
json |
Expects/returns Microlink JSON envelope ({ status, data, ... }). |
text |
Uses raw HTTP response and returns { status: "success", data: "<text>" } unless Microlink JSON envelope is returned. |
binary |
Uses raw HTTP response and returns base64 payload in the configured binaryProperty (plus encoding: "base64"). If Microlink JSON is returned, it is validated and returned as JSON. |
| Field | Type | Default | Microlink Query Key | Description |
|---|---|---|---|---|
adblock |
boolean | false |
adblock |
Block ads during rendering. |
animations |
boolean | false |
animations |
Enable/disable animations. |
javascript |
boolean | true |
javascript |
Enable JavaScript execution. |
prerender |
boolean | false |
prerender |
Render with browser prerendering. |
click |
string | - | click |
CSS selector to click before capture. |
scroll |
string | - | scroll |
Scroll instruction (1000, #selector, etc.). |
waitForSelector |
string | - | waitForSelector |
Wait for selector to appear. |
waitForTimeout |
number | 0 |
waitForTimeout |
Wait fixed milliseconds before capture. |
waitUntil |
string | - | waitUntil |
Navigation event (load, domcontentloaded, networkidle0, networkidle2). |
device |
string | - | device |
Device emulation name. |
colorScheme |
string | - | colorScheme |
Force light/dark color scheme. |
mediaType |
string | - | mediaType |
CSS media type (screen / print). |
scripts |
string | - | scripts |
External scripts to inject. |
styles |
string | - | styles |
CSS to inject. |
modules |
string | - | modules |
ES modules to inject. |
function |
string | - | function |
Function to execute in page context. |
| Field | Type | Default | Microlink Query Key | Description |
|---|---|---|---|---|
meta |
boolean | true |
meta |
Include metadata in response. |
audio |
boolean | false |
audio |
Include audio extraction. |
video |
boolean | false |
video |
Include video extraction. |
insights |
boolean | false |
insights |
Include insights extraction. |
logo |
boolean | false |
palette |
Include logo/palette data. |
pdf |
boolean | false |
pdf |
Enable PDF output. |
screenshot |
boolean | false |
screenshot |
Enable screenshot output. |
filter |
string | - | filter |
Filter response fields. |
embed |
string | - | embed |
Return one embedded field directly. |
filename |
string | - | filename |
Output filename hint. |
force |
boolean | false |
force |
Bypass cache. |
| Field | Type | Default | Microlink Query Key | Description |
|---|---|---|---|---|
proxy |
string | - | proxy |
Proxy mode or URL. |
retry |
number | 0 |
retry |
Retry attempts. |
timeout |
number | 0 |
timeout |
Max timeout in milliseconds. |
ttl |
number | 0 |
ttl |
Cache TTL in seconds. |
staleTtl |
number | 0 |
staleTtl |
Stale TTL in seconds. |
ping |
boolean | false |
ping |
Warm cache / ping endpoint. |
| Field | Type | Default | Microlink Query Key |
|---|---|---|---|
viewportWidth |
number | 0 |
viewport.width |
viewportHeight |
number | 0 |
viewport.height |
viewportDeviceScaleFactor |
number | 0 |
viewport.deviceScaleFactor |
viewportIsMobile |
boolean | false |
viewport.isMobile |
viewportHasTouch |
boolean | false |
viewport.hasTouch |
viewportIsLandscape |
boolean | false |
viewport.isLandscape |
| Field | Type | Default | Microlink Query Key |
|---|---|---|---|
pdfFormat |
string | - | pdf.format |
pdfWidth |
string | - | pdf.width |
pdfHeight |
string | - | pdf.height |
pdfLandscape |
boolean | false |
pdf.landscape |
pdfMargin |
string | - | pdf.margin |
pdfPageRanges |
string | - | pdf.pageRanges |
pdfScale |
number | 0 |
pdf.scale |
| Field | Type | Default | Microlink Query Key |
|---|---|---|---|
screenshotType |
string | - | screenshot.type |
screenshotFullPage |
boolean | false |
screenshot.fullPage |
screenshotElement |
string | - | screenshot.element |
screenshotOmitBackground |
boolean | false |
screenshot.omitBackground |
screenshotOverlayBackground |
string | linear-gradient(225deg, #FF057C 0%, #8D0B93 50%, #321575 100%) |
screenshot.overlay.background |
screenshotOverlayBrowser |
string | dark |
screenshot.overlay.browser |
screenshotCodeScheme |
string | - | screenshot.codeScheme |
These fields accept JSON objects (as text in Zapier UI). They are parsed and flattened into dot notation.
| Field | Type | Default | Query Prefix | Description |
|---|---|---|---|---|
headersJson |
text (JSON object) | {} |
headers.* |
Additional outbound HTTP headers. |
dataJson |
text (JSON object) | {} |
data.* |
Custom extraction rules. |
metaJson |
text (JSON object) | {} |
meta.* |
Custom metadata extraction config. |
viewportJson |
text (JSON object) | {} |
viewport.* |
Nested viewport configuration. |
insightsJson |
text (JSON object) | {} |
insights.* |
Nested insights configuration. |
Validation:
- If JSON is invalid or not an object, the app throws
InvalidInput(400).
additionalParams is a line-item input where each item has:
key(string)value(string)
Behavior:
- Dot-notation keys are supported (for example,
data.author.selector). - Values are loosely parsed:
"true"/"false"-> boolean- numeric strings -> number
- JSON strings -> object/array
- Objects are flattened recursively into dot-notation query params.
- Additional params are applied last and can override built-in options.
Implemented in lib/microlink.js.
- Start with action defaults (for example
pdf=truefor PDF action). - Merge common input options.
- Merge JSON options (
dataJson,metaJson, etc.) into existing objects. - Flatten object-like params (
data,meta,headers,viewport,insights). - Apply
additionalParamslast. - Nested keys win for boolean-or-object fields:
- if
screenshot.*exists, remove top-levelscreenshot - if
pdf.*exists, remove top-levelpdf - if
insights.*exists, remove top-levelinsights
- if
- Empty values are skipped (
undefined,null, empty string, numeric0).
All request execution is centralized in performMicrolinkRequest.
- HTTP failures (
>=400) -> throwsz.errors.Errorwith parsed Microlink message when available. - Microlink JSON payload with
status !== "success"-> throwsz.errors.Error. - Invalid JSON object fields (for
*Jsoninputs) -> throwsInvalidInputwith status400. - Raw-text and binary modes still detect and validate Microlink JSON envelopes when returned.
- Install dependencies:
npm install- Validate app:
npx zapier validate- Run tests:
npm test- Log in to Zapier CLI (if not already):
npx zapier login- Push a new app version:
npx zapier push- In Zapier editor:
- Choose one of the 9 create actions.
- Fill
url. - Optionally set auth (
apiKey) and advanced params. - Use
responseModeaccording to output you need (json,text, orbinary).
Tests use:
zapier-platform-corecreateAppTesternockfor API mockingmochatest runner
npm testnpx mocha test/creates/extract.test.js
npx mocha test/creates/screenshot.test.js
npx mocha test/creates/pdf.test.js
npx mocha test/creates/markdown.test.js
npx mocha test/creates/text.test.js
npx mocha test/creates/audio.test.js
npx mocha test/creates/video.test.js
npx mocha test/creates/insights.test.js
npx mocha test/creates/logo.test.jstest/
helpers.js
creates/
extract.test.js
screenshot.test.js
pdf.test.js
markdown.test.js
text.test.js
audio.test.js
video.test.js
insights.test.js
logo.test.js
.
├── authentication.js
├── index.js
├── creates/
│ ├── action-factory.js
│ ├── extract.js
│ ├── screenshot.js
│ ├── pdf.js
│ ├── markdown.js
│ ├── text.js
│ ├── audio.js
│ ├── video.js
│ ├── insights.js
│ └── logo.js
├── lib/
│ ├── input-fields.js
│ └── microlink.js
└── test/
├── helpers.js
└── creates/*.test.js