This document outlines how to use the PDF processing API endpoint for converting PDFs to markdown and storing them.
1
2
3
4
curl -X POST https://backend.readpdfs.com/process_pdf/?uploadFile=true \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: multipart/form-data" \
-F "file=@/path/to/your/file.pdf"
1
2
3
4
curl -X POST https://backend.readpdfs.com/process_pdf/ \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"pdf_url": "https://example.com/your-pdf-file.pdf"}'
The request body can be either multipart/form-data (for file uploads) or JSON (for providing a URL):
1
2
3
4
5
Content-Type: multipart/form-data
file: [Your file]
uploadFile: true
quality: standard (or high)
1
2
3
4
5
6
Content-Type: application/json
{
"pdf_url": "https://example.com/your-pdf-file.pdf",
"quality": "standard" (or "high")
}
Here's an example of how to make a request to the PDF processing API:
1
2
3
4
curl -X POST https://backend.readpdfs.com/process_pdf/?uploadFile=true&quality=high \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: multipart/form-data" \
-F "file=@/path/to/your/file.pdf"
1
2
3
4
curl -X POST https://backend.readpdfs.com/process_pdf/?quality=standard \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"pdf_url": "https://example.com/your-pdf-file.pdf"}'
Here's an example of how to make a request to the PDF processing API:
1
2
3
4
curl -X POST https://backend.readpdfs.com/process_pdf/?uploadFile=true \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: multipart/form-data" \
-F "file=@/path/to/your/file.pdf"
1
2
3
4
curl -X POST https://backend.readpdfs.com/process_pdf/ \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"pdf_url": "https://example.com/your-pdf-file.pdf"}'
The API will respond with a JSON object containing the following information:
1
2
3
4
5
{
"document_id": "uuid",
"markdown_text": "https://example.com/path/to/markdown_file.md",
"credits_used": 10
}
The API may return the following error responses:
Please note that usage of this API is subject to rate limiting and credit consumption. Ensure that you have sufficient credits in your account before making requests.
For any questions or support, please contact our support team.