Create a document
create_documentMake a document from a web page, HTML or Markdown and return it. Use this when the user wants to save, share, print or download something: output pdf or docx returns a download link that works for 48 hours; markdown, html or json returns the content itself. Give exactly one of url, html or markdown. To read a page for your own use, call read_page instead. Markdown and json output leave link addresses out unless include_links is true, and are never cut short, however long the page. Counts as one document on the API key's plan.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | A web page to turn into a document. Starts with https://. | |
| html | No | HTML to turn into a document, instead of a url. Up to 2 MB of markup. | |
| title | No | The document's title. Used for html and markdown input; a url supplies its own. | |
| output | Yes | pdf or docx: a file with a download link. markdown or html: the clean content. json: the content with its details (title, author, date, word count). | |
| markdown | No | Markdown to turn into a document, instead of a url. Up to 1 MB. | |
| page_size | No | Paper size for pdf and docx. letter for the US and Canada, a4 elsewhere. | |
| include_links | No | Keep link addresses in the Markdown, as [text](url). Affects markdown and json output only. Off by default. |
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output | Yes | The format that was made. | |
| content | No | The document itself (markdown and html only). | |
| document | Yes | The page's details: title, url, site, author, date, excerpt, image and word_count. For json output it also holds content_html and content_markdown. | |
| file_url | No | Download link for the PDF or Word file (pdf and docx only). Valid for 48 hours. | |
| expires_at | No | When the download link stops working, as an ISO 8601 time (pdf and docx only). | |
| size_bytes | No | Size of the file in bytes (pdf and docx only). |