Skip to Content

Get Pages

The page get commands retrieve a Confluence page in its native format — no Markdown conversion is applied. This is useful for inspecting the raw page structure, building custom processing pipelines, or archiving the original content.

Two formats are available:

FormatFlag valueDescription
ADF (default)atlas_doc_formatAtlassian Document Format — structured JSON
StoragestorageConfluence Storage Format — XML/HTML

Get by ID

acp2md page get by-id PAGE_ID [flags]

Examples

# Print ADF JSON to stdout acp2md page get by-id 163928 # Save ADF JSON to a file acp2md page get by-id 163928 --output page.json # Get the Storage (HTML/XML) format acp2md page get by-id 163928 --format storage --output page.html # Get the draft version in ADF format acp2md page get by-id 163928 --get-draft --output draft.json # Pipe page ID from stdin echo "163928" | acp2md page get by-id --output page.json

Flags

FlagShortDefaultDescription
--output-o(stdout)Output file path
--format-fatlas_doc_formatOutput format: atlas_doc_format (ADF JSON) or storage (HTML/XML)
--get-draft-dfalseRetrieve the draft (unpublished) version
--status-scurrentPage status filter: current, archived, trashed, deleted, draft
--version-v-1 (latest available)Retrieve a specific version number
--include-labels-lfalseInclude page labels
--include-version-VfalseInclude version info
--include-versions-LfalseInclude full version history
--attachments-dir——Download the page’s attachments into this directory (v1.0.12)
--conflict-resolution—overwriteOutput file conflicts: overwrite, skip, versioned

Get by title

acp2md page get by-title "PAGE TITLE" [flags]

Examples

# Get ADF JSON by title acp2md page get by-title "My Page Title" # Save to file acp2md page get by-title "Project Notes" --output page.json # Get Storage format acp2md page get by-title "Technical Spec" --format storage --output page.html # Get the draft, sorted by most recently modified acp2md page get by-title "Meeting Notes" --get-draft --sort -modified-date # Pipe title from stdin echo "Release Notes" | acp2md page get by-title --output notes.json

Additional flag

FlagShortDefaultDescription
--sort-S(none)Sort results: id, -id, created-date, -created-date, modified-date, -modified-date, title, -title

All other flags from by-id are also available.


Get by URL

acp2md page get by-url URL [flags]

Alias: url, u

Extracts the page ID from a Confluence URL and retrieves the page in its native format. This is convenient when you have a browser URL and want to skip looking up the page ID manually.

Supported URL formats:

  • https://domain.atlassian.net/wiki/spaces/KEY/pages/123456/Page+Title
  • https://domain.atlassian.net/wiki/spaces/KEY/pages/123456
  • https://domain.atlassian.net/wiki/pages/viewpage.action?pageId=123456

Examples

# Get ADF JSON from a Confluence URL acp2md page get by-url "https://mycompany.atlassian.net/wiki/spaces/ENG/pages/163928/API+Reference" # Save to a file acp2md page get by-url "https://mycompany.atlassian.net/wiki/spaces/ENG/pages/163928" --output page.json # Get Storage format acp2md page get by-url "https://mycompany.atlassian.net/wiki/spaces/ENG/pages/163928" --format storage --output page.html # Works with viewpage URLs too acp2md page get by-url "https://mycompany.atlassian.net/wiki/pages/viewpage.action?pageId=163928" --output page.json # Pipe URL from stdin echo "https://mycompany.atlassian.net/wiki/spaces/ENG/pages/163928" | acp2md page get by-url > page.json

Flags

All flags from by-id apply.


Sample native output

The following excerpt is based on a real page get by-id response, with tenant-specific details reduced to the fields that matter for structure:

{ "title": "Decision log", "id": "298494", "status": "current", "spaceId": "298324", "body": { "atlas_doc_format": { "representation": "atlas_doc_format", "value": { "type": "doc", "version": 1, "content": [ { "type": "layoutSection" } ] } } }, "version": { "number": 1 } }

Saving attachments

--attachments-dir DIR (available from v1.0.12) downloads the page’s attachments into DIR/<page-id>/ and describes each one — Confluence title, file ID, media type, version, size and SHA-256 — so the page can be restored with its files later:

  • with atlas_doc_format, in an attachments array added to the page JSON;
  • with storage, whose output is bare XHTML, in DIR/<page-id>.attachments.json.
# Back up one page with its attachments acp2md page get by-id 2973106197 -o ./page.json --attachments-dir ./attachments

A title with characters no filesystem accepts is saved under a safe name; the description keeps the original title. A file that fails to download is reported on stderr and listed without a file_path. The flag works the same on page get by-title and page get by-url.

Processing ADF output with jq

The ADF format is standard JSON and can be processed with jq:

# Extract the page title acp2md page get by-id 163928 | jq '.title' # List all node types in the document body acp2md page get by-id 163928 | jq '[.. | objects | .type] | unique' # Pretty-print and save acp2md page get by-id 163928 | jq '.' > page-pretty.json

Use acp2md page count nodes by-id and acp2md page count marks by-id for structured analysis of node and mark type distribution without needing to parse the JSON yourself.

Last updated on