Skip to content

Commit bb762a2

Browse files
committed
docs: add API Reference with examples, update Home with Mistral branding
1 parent 7b6f254 commit bb762a2

File tree

2 files changed

+163
-23
lines changed

2 files changed

+163
-23
lines changed

wiki/API-Reference.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Chart2CSV API Reference
2+
3+
> **Base URL:** `https://chart2csv.kikuai.dev`
4+
>
5+
> **Powered by Mistral Pixtral** — 90%+ accuracy on chart extraction
6+
7+
---
8+
9+
## Endpoints
10+
11+
### `POST /extract`
12+
13+
Extract data from a chart image.
14+
15+
#### Parameters
16+
17+
| Parameter | Type | Default | Description |
18+
|-----------|------|---------|-------------|
19+
| `file` | file | required | Chart image (PNG, JPG, WebP) |
20+
| `mode` | string | `llm` | Extraction mode: `llm`, `cv`, `auto` |
21+
| `chart_type` | string | auto | Force type: `scatter`, `line`, `bar` |
22+
23+
#### Modes
24+
25+
- **`llm`** (default) — Mistral Pixtral vision extraction, 90%+ accuracy
26+
- **`cv`** — Computer vision pipeline (legacy), faster but less accurate
27+
- **`auto`** — Try LLM first, fall back to CV if it fails
28+
29+
---
30+
31+
## Examples
32+
33+
### curl
34+
35+
```bash
36+
curl -X POST "https://chart2csv.kikuai.dev/extract" \
37+
-F "file=@chart.png" \
38+
-F "mode=llm"
39+
```
40+
41+
### Python
42+
43+
```python
44+
import requests
45+
46+
url = "https://chart2csv.kikuai.dev/extract"
47+
48+
with open("chart.png", "rb") as f:
49+
response = requests.post(
50+
url,
51+
files={"file": f},
52+
data={"mode": "llm"}
53+
)
54+
55+
result = response.json()
56+
print(f"Extracted {len(result['data'])} points")
57+
print(f"CSV:\n{result['csv']}")
58+
```
59+
60+
### JavaScript (fetch)
61+
62+
```javascript
63+
const form = new FormData();
64+
form.append('file', fileInput.files[0]);
65+
form.append('mode', 'llm');
66+
67+
const response = await fetch('https://chart2csv.kikuai.dev/extract', {
68+
method: 'POST',
69+
body: form
70+
});
71+
72+
const result = await response.json();
73+
console.log(`Extracted ${result.data.length} points`);
74+
console.log('CSV:', result.csv);
75+
```
76+
77+
### JavaScript (axios)
78+
79+
```javascript
80+
import axios from 'axios';
81+
82+
const form = new FormData();
83+
form.append('file', file);
84+
form.append('mode', 'llm');
85+
86+
const { data } = await axios.post(
87+
'https://chart2csv.kikuai.dev/extract',
88+
form
89+
);
90+
91+
console.log(data.csv);
92+
```
93+
94+
---
95+
96+
## Response Format
97+
98+
```json
99+
{
100+
"success": true,
101+
"chart_type": "scatter",
102+
"confidence": 0.95,
103+
"data": [
104+
{"x": 0, "y": 10},
105+
{"x": 1, "y": 20},
106+
{"x": 2, "y": 30}
107+
],
108+
"csv": "x,y\n0,10\n1,20\n2,30",
109+
"warnings": [],
110+
"processing_time_ms": 2500
111+
}
112+
```
113+
114+
---
115+
116+
## Rate Limits
117+
118+
- **20 requests per minute** per IP
119+
- Contact us for higher limits
120+
121+
---
122+
123+
## Swagger UI
124+
125+
Interactive API documentation: [chart2csv.kikuai.dev/docs](https://chart2csv.kikuai.dev/docs)

wiki/Home.md

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,52 @@
1-
# Chart2CSV Wiki
1+
# Chart2CSV
22

3-
Welcome to the Chart2CSV documentation.
3+
> **Extract data from chart images using AI. 90%+ accuracy with Mistral Pixtral.**
44
5-
## What is Chart2CSV?
6-
7-
Chart2CSV is a tool that extracts data from chart images and converts it to CSV format. You upload a picture of a chart (like a line graph or bar chart from a PDF or screenshot), and Chart2CSV gives you the actual numbers.
5+
---
86

97
## Quick Links
108

11-
- [Home](Home) — Overview
12-
- [Installation](Installation) — How to install
13-
- [Quick Start](Quick-Start) — Get started in 2 minutes
14-
- [CLI Reference](CLI-Reference) — All command line options
15-
- [How It Works](How-It-Works) — Technical explanation
16-
- [FAQ](FAQ) — Common questions
17-
- [Troubleshooting](Troubleshooting) — Fixing problems
9+
- 🚀 [Quick Start](Quick-Start)
10+
- 📖 [API Reference](API-Reference)
11+
- 💻 [CLI Reference](CLI-Reference)
12+
- ⚙️ [Installation](Installation)
13+
- 🔧 [Troubleshooting](Troubleshooting)
14+
-[FAQ](FAQ)
15+
16+
---
17+
18+
## Live Demo
1819

19-
## Why Use Chart2CSV?
20+
Try it now: **[chart2csv.kikuai.dev](https://kiku-jw.github.io/Chart2CSV/)**
2021

21-
**Problem:** You have a chart image (from a research paper, report, or website) and need the raw numbers.
22+
---
2223

23-
**Old way:** Manually click each point in WebPlotDigitizer. Takes 5-30 minutes per chart.
24+
## Features
2425

25-
**Chart2CSV way:** Drop the image, get CSV instantly. AI reads the chart for you.
26+
| Feature | Description |
27+
|---------|-------------|
28+
| 🧠 **Mistral Pixtral** | Powered by Mistral AI vision model |
29+
|**Zero-Click** | AI reads charts automatically |
30+
| 📊 **Multi-Chart** | Line, scatter, bar charts |
31+
| 🔒 **Privacy** | Offline mode with Tesseract |
32+
| 🌐 **REST API** | Simple HTTP endpoint |
33+
34+
---
2635

2736
## Supported Charts
2837

29-
- ✅ Line charts
30-
- ✅ Scatter plots
31-
- ✅ Bar charts
32-
- ✅ Linear and logarithmic scales
38+
✅ Line charts
39+
✅ Scatter plots
40+
✅ Bar charts
41+
42+
❌ Pie charts
43+
❌ Heatmaps
44+
❌ 3D charts
45+
46+
---
3347

34-
## Getting Help
48+
## Technology
3549

36-
- [GitHub Issues](https://github.com/kiku-jw/Chart2CSV/issues) — Report bugs
37-
- [FAQ](FAQ) — Common questions answered
50+
- **Mistral Pixtral Large** — Vision LLM for chart understanding
51+
- **FastAPI** — High-performance REST API
52+
- **OpenCV** — Image preprocessing (fallback mode)

0 commit comments

Comments
 (0)