Decoding | cURL
Learn to decode Base64-encoded binary responses from ScraperAPI Async in cURL. Process PDFs, images, and files with cURL and command-line examples.
The responses returned by the Async API for binary requests require you to decode the data as they are encoded using Base64
encoding. This allows the binary data to be sent as a text string, which can then be decoded back into its original form when you want to use it.
Example request:
curl \
-H "content-type: application/json" \
--data '{"apiKey": "API_KEY", "url": "https://pdfobject.com/pdf/sample.pdf" }' \
https://async.scraperapi.com/jobs
Decode response:
curl https://async.scraperapi.com/jobs/<JOB_ID> \
| jq -r '.response.base64EncodedBody' \
| base64 -d > name.pdf
Last updated
Was this helpful?