|
| 1 | +# API Reference |
| 2 | + |
| 3 | +This document lists the HTTP routes exposed by `chem-spectra-app`. |
| 4 | + |
| 5 | +Use `docs/architecture.md` for component boundaries and `docs/core-flows.md` for runtime behavior. This file is the compact route-level reference for handlers, main inputs, and main outputs. |
| 6 | + |
| 7 | +## `file_api` |
| 8 | + |
| 9 | +| Route | Handler | Main input | Main output | |
| 10 | +|---|---|---|---| |
| 11 | +| `POST /api/v1/chemspectra/file/convert` | `chemspectra_file_convert()` | `file`, optional `molfile`, form params | JSON with base64 `jcamp` and `img`, or BagIt `list_jcamps` | |
| 12 | +| `POST /api/v1/chemspectra/file/save` | `chemspectra_file_save()` | `src`, `dst` or `dst_list`, optional `molfile`, form params | `spectrum.zip` containing source, generated files, predictions, optional CSV | |
| 13 | +| `POST /api/v1/chemspectra/file/refresh` | `chemspectra_file_refresh()` | `dst` or `dst_list`, optional `molfile`, form params | JSON with base64 `jcamp` and `img`, or `spectrum.zip` for multiple files | |
| 14 | +| `POST /api/v1/chemspectra/molfile/convert` | `chemspectra_molfile_convert()` | `molfile` | JSON with `smi`, `mass`, and molecule `svg` | |
| 15 | + |
| 16 | +## `transform_api` |
| 17 | + |
| 18 | +| Route | Handler | Main input | Main output | |
| 19 | +|---|---|---|---| |
| 20 | +| `POST /zip_jcamp_n_img` | `zip_jcamp_n_img()` | `file`, optional `molfile`, form params | `spectrum.zip` with JCAMP/image/optional CSV, plus `X-Extra-Info-JSON` | |
| 21 | +| `POST /zip_jcamp` | `zip_jcamp()` | `file`, optional `molfile`, form params | `spectrum.zip` with JCAMP files | |
| 22 | +| `POST /zip_image` | `zip_image()` | `file`, optional `molfile`, form params | `spectrum.zip` with image files | |
| 23 | +| `POST /jcamp` | `jcamp()` | `file`, optional `molfile`, form params | `spectrum.jdx` | |
| 24 | +| `POST /image` | `image()` | `file`, optional `molfile`, form params | `spectrum.png` | |
| 25 | +| `POST /nmrium` | `nmrium()` | NMRium `file` | `spectrum.jdx`, or `404` if conversion fails | |
| 26 | +| `POST /combine_images` | `combine_images()` | `files[]`, form params, optional `extras` | `spectrum.zip` with combined image output | |
| 27 | + |
| 28 | +## `inference_api` |
| 29 | + |
| 30 | +| Route | Handler | Main input | Main output | |
| 31 | +|---|---|---|---| |
| 32 | +| `POST /predict/by_peaks_json` | `chemspectra_predict_by_peaks_json()` | JSON `layout`, `peaks`, `shift`, `molfile` | prediction JSON | |
| 33 | +| `POST /api/v1/chemspectra/predict/nmr_peaks_json` | `chemspectra_predict_by_peaks_json()` | JSON `layout`, `peaks`, `shift`, `molfile` | prediction JSON | |
| 34 | +| `POST /predict/by_peaks_form` | `chemspectra_predict_by_peaks_form()` | form `layout`, `peaks`, `shift`, `molfile`, optional `spectrum` | prediction JSON | |
| 35 | +| `POST /api/v1/chemspectra/predict/nmr_peaks_form` | `chemspectra_predict_by_peaks_form()` | form `layout`, `peaks`, `shift`, `molfile`, optional `spectrum` | prediction JSON | |
| 36 | +| `POST /predict/infrared` | `chemspectra_predict_infrared()` | `layout`, `spectrum`, `molfile` | prediction JSON | |
| 37 | +| `POST /api/v1/chemspectra/predict/infrared` | `chemspectra_predict_infrared()` | `layout`, `spectrum`, `molfile` | prediction JSON | |
| 38 | +| `POST /predict/ms` | `chemspectra_predict_ms()` | `layout`, `spectrum`, `molfile` | prediction JSON | |
| 39 | +| `POST /api/v1/chemspectra/predict/ms` | `chemspectra_predict_ms()` | `layout`, `spectrum`, `molfile` | prediction JSON | |
| 40 | + |
| 41 | +## `spectra_layout_api` |
| 42 | + |
| 43 | +| Route | Handler | Main input | Main output | |
| 44 | +|---|---|---|---| |
| 45 | +| `GET /api/v1/chemspectra/spectra_layouts` | `get_spectra_layouts()` | none | JSON layout mapping from JCAMP data type configuration | |
0 commit comments