Way to extract CSV values from invoice using Document Intelligence REST API?

Adam 0 Reputation points
2024-08-26T13:51:45.58+00:00

I need to extract CSV values directly from a REST API call using Document Intelligence. Is there a way to achieve this without parsing the JSON response? Just like it is in the response table GUI in the DI Studio?

Azure AI Document Intelligence
Azure AI Document Intelligence
An Azure service that turns documents into usable data. Previously known as Azure Form Recognizer.
2,100 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sina Salam 22,031 Reputation points Volunteer Moderator
    2024-08-26T19:20:57.5133333+00:00

    Hello Adam,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand that you would like to extract CSV values directly from a REST API call using Azure AI Document Intelligence.

    Is there a way to achieve this without parsing the JSON response?

    Azure AI Document Intelligence offers a REST API that simplifies extracting key information from documents, including CSV data. You can interact with the service directly through this API, which eliminates the need for manual JSON parsing. By using the prebuilt-layout model, the service can extract text, text locations, tables, selection marks, and structural information from various documents and images. Also, if you enable the optional features=keyValuePairs parameter, it can also extract key-value pairs. To use this service, you need to submit your document content—whether it's an image or a scanned PDF—to the API endpoint. The response will be a structured format containing the extracted data. https://techcommunity.microsoft.com/t5/azure-for-isv-and-startups/using-azure-ai-document-intelligence-and-azure-openai-to-extract/ba-p/4107746 and https://robkerr.ai/azure-ai-document-intelligence-rest-api

    Just like it is in the response table GUI in the DI Studio?

    The REST API does not natively provide data in CSV format, but you can convert the data into CSV with custom programming. To achieve a response similar to the DI Studio Response Table GUI, you should create a script or application to format the data as CSV. It starts by setting up your environment, obtaining necessary keys and endpoints, and choosing the suitable Document Intelligence model. https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/ai-services/document-intelligence/how-to-guides/use-sdk-rest-api.md

    I hope this is helpful! Do not hesitate to let me know if you have any other questions.

    ** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful ** so that others in the community facing similar issues can easily find the solution.

    Best Regards,

    Sina Salam

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.