View as Markdown
ConvertAPI icon

ConvertAPI ACTION

Convert Web URL to Specified Format

Converts a website page to a specified format. See the documentation
  • Action
  • Read only
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's ConvertAPI account once, then configure and run Convert Web URL to Specified Format from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "convertapi-convert-web-url",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    convertapi: { authProvisionId: "apn_xxxxxxx" },
    url: "URL",
    formatTo: "Format To",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Convert Web URL to Specified Format inputs
Property Type Description
url URL string
The website URL to be converted to a specified format.
Required
formatTo Format To string
The format you want to convert the URL to.
Required
fileName File Name string
Converted output file name without extension. The extension will be added automatically.
Optional
timeout Timeout string
Conversion timeout in seconds.
Optional
conversionDelay Conversion Delay integer
Delay in seconds before page load and file creation. Sometimes useful to let web page fully load.
Optional
authUsername Auth Username string
HTTP authentication username. Could be used if conversion web page is protected with HTTP authentication.
Optional
authPassword Auth Password string
HTTP authentication password. Could be used if conversion web page is protected with HTTP authentication.
Optional
adBlock Ad Block boolean
Block ads in converting page.
Optional
cookieConsentBlock Cookie Consent Block boolean
Tries to remove EU regulation required cookie warnings from web pages.
Optional
cookies Cookies string
Set additional cookies for the page request. Exaple: cookiename1=cookievalue1; cookiename2=cookievalue2; cookiename3=cookievalue3
Optional
javaScript JavaScript boolean
Allow web pages to run JavaScript.
Optional
waitElement Wait Element string
Element selector string of the DOM element. Converter will wait for this element to appear in DOM before conversion begins.
Optional
userJs User JS string
Execute provided JavaScript before conversion begins.
Optional
userCss User CSS string
Apply additional CSS before conversion begins.
Optional
hideElements Hide Elements string
Element selector string of the DOM elements that need to be hidden during conversion.
Optional
cssMediaType CSS Media Type string
Use CSS media type in conversion process.
Optional
imageWidth Image Width integer
Image width in pixels.
Optional
imageHeight Image Height integer
Image height in pixels.
Optional
imageQuality Image Quality integer
Set output image quality.
Optional
cropElement Crop Element string
Element selector string of the DOM element that should be converted. Element will be cropped from the document.
Optional
cropX Crop X integer
Screenshot crop X offset.
Optional
cropY Crop Y integer
Screenshot crop Y offset.
Optional
cropWidth Crop Width integer
Screenshot crop width.
Optional
cropHeight Crop Height integer
Screenshot crop height.
Optional
zoom Zoom integer
Set the default zoom level of webpages.
Optional
loadLazyContent Load Lazy Content boolean
Load page images that loads only when they are visible.
Optional
viewportWidth Viewport Width integer
Sets browser viewport width.
Optional
viewportHeight Viewport Height integer
Sets browser viewport height.
Optional
respectViewport Respect Viewport boolean
If true, the converter will generate PDF as the content looks like in the browser. If is set to false, the converter acts like Chrome print to PDF function.
Optional
scale Scale integer
Set web page scale value in percentage.
Optional
pageOrientation Page Orientation string
PDF page orientation
Optional
pageSize Page Size string
PDF Page Size
Optional
pageWidth Page Width integer
Custom page width in millimeters (mm). This option override PageSize option.
Optional
pageHeight Page Height integer
Custom page height in millimeters (mm). This option override PageSize option.
Optional
marginTop Margin Top integer
Set the page top margin in millimeters (mm).
Optional
marginRight Margin Right integer
Set the page right margin in millimeters (mm).
Optional
marginBottom Margin Bottom integer
Set the page bottom margin in millimeters (mm).
Optional
marginLeft Margin Left integer
Set the page left margin in millimeters (mm).
Optional
pageRange Page Range string
Set page range. Example 1-10 or 1,2,5.
Optional
background Background boolean
Convert web page background.
Optional
fixedElements Fixed Elements string
Change fixed elements CSS 'position' property to adapt page for conversion
Optional
showElements ShowElements string
Element selector string of the DOM elements that should be visible during conversion. Other elements will be hidden.
Optional
avoidBreakElements Avoid Break Elements string
CSS selector for the elements that pages should not break.
Optional
breakBeforeElements Break Before Elements string
CSS selector for the elements that should apply page break before it.
Optional
breakAfterElements Break After Elements string
CSS selector for the elements that should apply page break after it.
Optional
compressPDF Compress PDF boolean
It tries to produce smaller output files but requires Adobe Reader 6, released in 2003 or newer, to view created PDF files.
Optional
syncDir SyncDir dir
Required

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
convertapi-convert-web-url
Version
0.0.3
App
ConvertAPI
Authentication
API key
Read-only
Yes
Destructive
No
Open world
Yes