Summarize this article with:
In this tutorial, you will learn how to use the Document Question Answering API in 5 minutes using JavaScript. Eden AI provides an easy and developer-friendly API that allows you to extract specific information from your documents.
What is Document Question Answering API?

Document Question Answering allows the extraction of specific information from text-based documents using a query.
Simply provide the text you want to search, and the system will use optical character recognition (OCR) technology to scan the document and extract the information you need by automatically finding the specific data within large amounts of text.
This makes it ideal for tasks such as data entry and document analysis.
Getting Started with Document Question Answering
Set Up Your Eden AI Account
1. Sign Up: If you don't have an Eden AI account, create a free here. Once you do that you can obtain your API key, which you can use to access Document Question Answering.

2. Access OCR Tools: Once logged in, go to the document parsing section of the platform.
3. Choose the Document Question Answering Feature: Select the Document Question Answering tool. You can also explore advanced parsing options based on your specific requirements.
How to Implement Document Question Answering API in JavaScript?
If you haven’t already, install axios to handle HTTP requests in Node.js:
Eden AI uses an asynchronous job system:
- POST: Launches the job without waiting for processing to complete.
- GET: Separately retrieves the result once the job is finished. This method ensures reliability and scalability when processing large or complex documents.
Launch the Document Parsing Job (POST Request)
Explanation: What This Code Does
- Method: Sends a POST request to Eden AI’s OCR async endpoint.
- Authorization: Uses your API token to authenticate.
- Data:
- providers: Selects the AI provider (e.g., "amazon").
- queries: A list of questions to extract answers from the document.
- file_url: Public link to the document (image or PDF).
- providers: Selects the AI provider (e.g., "amazon").
Response: Returns a public_id used to track the job’s status.
Get the Job Results (GET Request)
Once the job is submitted, Eden AI processes it asynchronously. You use the public_id from the POST response to fetch results.
Example Output
Explanation of Output:
- query: The original question.
- answer: Extracted answer from the document.
- page: Page number where the answer was found.
- status: Status of the job (e.g., success).
- cost: API usage cost (if applicable).
Benefits of using Document QA API with Eden AI
Using Document QA with Eden AI API is quick and easy.
.gif)
Save time and cost
We offer a unified API for all providers: simple and standard to use, with a quick switch between providers and an access to the specific features of each provider.
Easy to integrate
The JSON output format is the same for all suppliers thanks to Eden AI's standardisation work. The response elements are also standardised thanks to Eden AI's powerful matching algorithms.
Customization
With Eden AI you have the possibility to integrate a third party platform: we can quickly develop connectors. To go further and customize your Document QA request with specific parameters, check out our documentation.
Conclusion
- Document Q&A allows you to extract precise answers from documents automatically.
- Eden AI’s two-stage async API makes this easy with a launch-and-fetch workflow.
- JavaScript with Axios provides a smooth integration path.
If you're building applications that handle document understanding like invoice parsing, contract analysis, or form processing, Eden AI offers a powerful and developer-friendly solution with minimal code and maximum flexibility.

.jpg)

.avif)
.avif)