LogoLogoAPI 문서
LogoLogoAPI 문서
홈페이지
개요인증과 멱등성이미지 생성이미지 편집이미지 변환차트 생성작업과 제한 대기크레딧오류요청 제한과 동시 실행API 변경 내역
API 문서

차트 생성

데이터 표에서 논문용 차트 생성

POST /api/v1/charts/generations는 multipart/form-data를 받습니다. 필요한 권한: charts:generate. 서비스가 표를 읽고 지정하거나 자동 선택한 차트 종류로 그린 뒤 완성된 PNG 한 장을 반환합니다. 스트리밍이나 중간 상태는 노출되지 않으며 다른 작업과 같이 폴링하면 됩니다.

폼 필드

필드유형필수기본값규칙
datafile예—CSV, TSV, TXT, XLSX 또는 XLS; 최대 5 MB; 첫 행은 고유한 열 이름
promptstring아니요—보여 주거나 강조할 내용, 최대 8,000자
chart_typesstring아니요자동쉼표로 구분하거나 반복 지정; 아래 종류 중 최대 4개
journal_stylestring아니요defaultdefault, nature, science, cell, plos, acs
figure_widthstring아니요doublesingle(1단) 또는 double(2단)
color_palettestring아니요okabe_itookabe_ito, wong, tol_bright, tol_muted

구문 분석할 수 없거나 크기 제한을 초과하거나 열 이름이 중복·비어 있는 파일은 400 INVALID_REQUEST를 반환합니다(크기 초과 시 HTTP 상태는 413).

차트 종류

bar, line, scatter, boxplot, violin, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , .

이미지 변환

이미지를 SVG, PPTX, PNG, PDF, TIFF로 변환하기

작업과 제한 대기

비동기 작업을 폴링하고 정제된 결과 읽기

목차

폼 필드
차트 종류
크레딧
출력
cURL
JavaScript
Python
histogram
heatmap
regression
errorbar
timeseries
volcano
kaplan_meier
forest
dot
radar
upset
dendrogram
qq
ogive
funnel
density
roc
sankey
stem_leaf
correlation
pca
manhattan
bland_altman
waterfall
dose_response
growth_curve
standard_curve
raincloud
beeswarm
ecdf
ma_plot
enrichment
enzyme_kinetics
calendar_heatmap
choropleth
stacked_area
ridgeline
bubble
hexbin
paired_dot
precision_recall
calibration_curve
confusion_matrix

크레딧

차트 작업 하나에 10 크레딧이 들며, 작업 접수 시 예약되고 성공했을 때만 정산됩니다. 실패한 작업은 예약을 해제합니다.

출력

result.files에는 논문 인쇄 해상도의 PNG 한 장만 포함되며 width와 height가 함께 제공됩니다. 그림 크기는 저널 스타일과 단 너비에 따라 정해지므로 픽셀 크기는 요청마다 다릅니다.

cURL

curl https://sci-draw.com/api/v1/charts/generations \
  -H 'Authorization: Bearer sd_YOUR_KEY' \
  -H 'Idempotency-Key: study-12-figure-2' \
  -H 'Prefer: wait=30' \
  -F 'data=@results.csv;type=text/csv' \
  -F 'prompt=처리군을 비교하고 유의성을 표시' \
  -F 'chart_types=boxplot' \
  -F 'journal_style=nature' \
  -F 'figure_width=single'

JavaScript

const form = new FormData();
form.set('data', file);
form.set('prompt', '처리군을 비교하고 유의성을 표시');
form.set('chart_types', 'boxplot');
const response = await fetch('https://sci-draw.com/api/v1/charts/generations', {
  method: 'POST',
  headers: { Authorization: `Bearer ${apiKey}`, 'Idempotency-Key': crypto.randomUUID() },
  body: form,
});

Python

with open("results.csv", "rb") as table:
    response = requests.post(
        "https://sci-draw.com/api/v1/charts/generations",
        headers={"Authorization": f"Bearer {api_key}", "Idempotency-Key": str(uuid.uuid4())},
        files={"data": ("results.csv", table, "text/csv")},
        data={"prompt": "처리군을 비교하고 유의성을 표시", "chart_types": "boxplot"},
    )

업로드한 표는 비공개 작업 입력이며 작업이나 로그 응답에 절대 포함되지 않습니다. 최종 상태에 도달하면 삭제됩니다.