apyhub
DATA EXTRACTION · DEVELOPER TOOLS

XML Text Extractor

Hosted on ApyHub

What it does

XML Text Extractor pulls readable text content out of XML files and returns it as a single data string. Send either an uploaded .xml file to /file or a remote XML file URL to /url.

Use preserve_paragraphs when you want the extracted text to keep paragraph breaks instead of flattening everything into one block. The file endpoint accepts the XML upload plus preserve_paragraphs as a string value of true or false. The URL endpoint accepts url and preserve_paragraphs as a boolean.

This is useful when you need to turn XML into plain text for downstream parsing, search indexing, review workflows, or content extraction pipelines. If you're building a tool that ingests XML feeds, documentation exports, or structured content from third-party systems, XML Text Extractor gives you the cleaned text without extra markup.

The response is minimal and predictable: you get data back with the extracted text content from the document.

▣ ENDPOINT 01 / 02
POST
Extract text from uploaded XML file
https://api.eu.apyverse.com/apyhub/extract-xml-text/file

QUICKSTART

GUIDE

Quickstart

Extract text from an XML file by uploading it as multipart form data.

curl -X POST "https://api.eu.apyverse.com/apyhub/extract-xml-text/file" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/file.xml"

What you'll get back

Returns a JSON object with a data string field containing the extracted XML text content.

{
  "data": "Sample XML element text content extracted from the document."
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
XML file (.xml).

About this endpoint

What it does

Uploads an XML file and extracts its text content. The response returns the extracted text as a JSON object.

Request Body

ParameterTypeMandatoryDescription
fileStringYesXML file (.xml) uploaded as binary.
preserve_paragraphsENUMNoControls whether paragraph breaks are preserved when extracting text. Allowed values: true, false. Default: false.

Response

Returns a JSON object with a data string field containing the extracted text content from the uploaded XML file.

ParameterTypeMandatoryDescription
dataStringYesExtracted text content from the XML document.

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 02 / 02
POST
Extract text from XML file at remote URL
https://api.eu.apyverse.com/apyhub/extract-xml-text/url

QUICKSTART

GUIDE

Quickstart

Extract text from an XML file by sending its URL.

curl -X POST "https://api.eu.apyverse.com/apyhub/extract-xml-text/url" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.xml"}'

What you'll get back

Returns a JSON object with a data string field containing the extracted XML text content.

{
  "data": "Sample XML element text content extracted from the document."
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*

About this endpoint

What it does

Extracts text content from an XML file available at a remote URL and returns the extracted text in the response.

Request Body

ParameterTypeMandatoryDescription
urlStringYesRemote XML file URL. Must be a URI.
preserve_paragraphsBooleanNoPreserves paragraph separation when extracting text. Default: false.

Response

Returns a JSON object with a data string field containing the extracted XML text content. The success response is an object with a single top-level data field.

ParameterTypeMandatoryDescription
dataStringYesExtracted text content from the XML document.

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.