Guide
Extract assets
Pull assets and media streams out of files.
Extract assets let you pull content out of a container file instead of converting it: embedded images and resources from documents, images from a PDF, or individual audio and video streams from a media container. Each capability is a dedicated target you call through the standard conversion array. Authenticate every request with the lowercase x-oc-api-key header.
Extract embedded assets
The extract-assets target pulls embedded assets (such as images and other resources) out of a supported input file and returns them as separate outputs.
{
"input": [
{
"type": "remote",
"source": "https://example-files.online-convert.com/document/docx/example.docx"
}
],
"conversion": [
{
"category": "operation",
"target": "extract-assets"
}
]
}
curl -X POST https://api.api2convert.com/v2/jobs \
-H "x-oc-api-key: <your-api-key>" \
-H "Content-Type: application/json" \
-d @job.json
Extract assets from a PDF
Use extract-assets-from-pdf to pull the images and assets embedded in a PDF. Set allow_multiple_outputs to true to receive one output file per extracted asset instead of a single bundled result.
{
"input": [
{
"type": "remote",
"source": "https://example-files.online-convert.com/document/pdf/example.pdf"
}
],
"conversion": [
{
"category": "operation",
"target": "extract-assets-from-pdf",
"options": {
"allow_multiple_outputs": true
}
}
]
}
allow_multiple_outputs is enabled, the completed job exposes several entries under output — one per extracted asset. Iterate over the array to download them all.Extract individual streams
The extract-streams target separates the individual audio and video streams contained in a media file. Provide the stream option to choose which stream to pull out of the container.
{
"input": [
{
"type": "remote",
"source": "https://example-files.online-convert.com/video/mp4/example.mp4"
}
],
"conversion": [
{
"category": "operation",
"target": "extract-streams",
"options": {
"stream": "audio"
}
}
]
}
Live options
The options below are pulled live from the API for each extract target. Use them to refine the output.
Loading options…