Analyze document

This is the main method that you will use to analyze your PDF document and extract the data.

There are 2 ways to analyze a document and retrieve its data.

We can:

  • call GET: /api/analyze?documentId=<your document id> passing in documentId as the query string or,
  • call POST: /api/analyze/file using a file.

Endpoint 1: Using document Id (query string)

GET https://app.pdfdodo.com/api/analyze?documentid={your document id}
Analyzes a PDF document given the document id and returns the data in JSON
Header
X-API-Key
string
Your API key. You can find this from the "Settings" page
Query string
documentId
string
The document Id

Example curl request

An example of how to do this request using curl is as follows. Just update the documentid with your document Id and X-API-KEY with your API Key.

curl -X GET \
     -H "x-api-key: YOUR_API_KEY_HERE" \
     -H "Content-Type: application/json" \
     "https://app.pdfdodo.com/api/analyze?documentid=123e4567-e89b-12d3-a456-426614174000/results"

Tip: You will need to upload a document first

You can upload a document using the upload file endpoint: upload-pdf

Endpoint 2: Using PDF file (FormData)

POST https://app.pdfdodo.com/api/analyze/file
Analyzes a PDF document and returns the data in JSON
Header
X-API-Key
string
Your API key. You can find this from the "Settings" page
Body
file
FormData
The PDF file as FormData

Example curl request

Below is an example of how to do this request in curl. Just update the file with your file path and x-api-key with your API Key from the “Settings” page.

curl -X POST \
     -H "Content-Type: multipart/form-data" \
     -H "x-api-key: YOUR_API_KEY" \
     -F "file=@/path/to/your/file.pdf" \
     https://https://app.pdfdodo.com/api/analyze/file

Response

This will give you a JSON response of the data in your PDF:

{
  "tables": [
    {
      "title": "The title of your table",
      "tableId": "a0f229f6-ade7-4637-bbff-e31fbbd64ec5",
      "pageNumber": 1,
      "rows": [
        [
          "0",
          "Money In ",
          "$1,880.00 "
        ],
        [
          "1",
          "Money Out ",
          "$150.25 "
        ],
        [
          "2",
          "You Received ",
          "$1,729.75 "
        ]
      ],
      "left": 0.6953286,
      "top": 0.2655254,
      "width": 0.2580709,
      "height": 0.11655326,
      "mergedTables": []
    }    
  ]
}