Quickstart

This guide provides step-by-step instructions on how to request your first document analysis using the Docu-analyzer API and download the results.

Through basic cURL and Python examples, you can quickly experience file uploads, API authentication, and saving result (ZIP) files.


Step 1: Create an Account

First, click the [Sign Up/Login] button in the top right corner of this page to create an account.

When you create an account, you'll immediately receive 300 free credits to test the API.


Step 2: Generate API Key

After logging in, follow the Authentication guide (or the Workspace > API Keys link) to generate your first API key.

Keep your API key secure
Copy the generated key value immediately and store it in a safe place. For security reasons, the key value cannot be retrieved again.

Step 3: Submit Analysis Request

Once your API key is ready, it's time to send the file to be analyzed to the /analyze endpoint.

The API receives files using multipart/form-data and returns analysis results as a ZIP file.

cURL

curl -X POST 'https://foundry.synap.kr/api/v1/docu-analyzer/analyze' \
  -H 'Authorization: Bearer {API_KEY}' \
  -F 'file=@{FILE_PATH}' \
  -o result.zip

Python

import requests

api_key = "{API_KEY}"
file_path = "/path/to/your/file.ext"
url = "https://foundry.synap.kr/api/v1/docu-analyzer/analyze"

headers = { "Authorization": f"Bearer {api_key}" }
# Optional: Add outputFormats parameter
params = { "outputFormats": ["xml", "json"] }

with open(file_path, "rb") as file:
    files = { "file": file }
    response = requests.post(url, headers=headers, files=files, params=params)

with open("result.zip", "wb") as f:
    f.write(response.content)

Node.js

const axios = require('axios');
const fs = require('fs');
const FormData = require('form-data');

const apiKey = "{API_KEY}";
const filePath = "/path/to/your/file.ext";
const url = 'https://foundry.synap.kr/api/v1/docu-analyzer/analyze';

const form = new FormData();
form.append('file', fs.createReadStream(filePath));

const headers = {
  ...form.getHeaders(),
  'Authorization': `Bearer ${apiKey}`,
};

axios.post(url, form, {
    headers: headers,
    responseType: 'stream'
}).then(response => {
    response.data.pipe(fs.createWriteStream('result.zip'));
}).catch(error => {
    console.error('Error:', error.response?.data || error.message);
});
Note: Replace {API_KEY} and {FILE_PATH} with your actual values in the example above.

Step 4: Check Results

Upon successful request, a result.zip file will be downloaded. This file contains the following analysis results:

  • JSON: Structured data of the document
  • Markdown: Human-readable text format
  • XML: Document structure information

Next Steps