Help - APIs

Advanced use via APIs

Food Metabolome Repository provides a set of APIs (Application Programming Interfaces) by which other programs can use the repository data directly. By accessing the URLs written in specified formats, users can see the results on a browser, can get the results in JSON format (text), and can download data files. Especially, the APIs that returns JSON format are useful to integrate the search functions in other programs and to perform a large amount of searches.

Displaying the results on a browser

Displaying peaks in foods searched by a mass value and a retention time

Format /search/TARGET/MASS/MASS_TOLERANCE/MASS_TOLERANCE_UNIT/TYPE
/search/TARGET/MASS/MASS_TOLERANCE/MASS_TOLERANCE_UNIT/TYPE/RT/RT_TOLERANCE
Variable TARGET: mz, detected m/z value or mzdi, molecular mass after removal of adduct
MASS: a mass value
MASS_TOLERANCE: a tolerance of the mass value. At a maximum of 10 Da is allowed
MASS_TOLERANCE_UNIT: unit of the mass tolerance. ppm or da
TYPE: detection mode. pos, neg, or both
Retention time limitation is not applied when omitting parameters below.
RT: a retention time
RT_TOLERANCE: a tolerance of the retention time (min)
Example /search/mz/611.1611/5/ppm/pos
/search/mzdi/307/0.5/da/both/13/1
Description A list of peaks matched the condition and a summary is displayed on a browser.

Displaying peak information

Format /peak/FOOD_NO/TYPE/PEAK_NO
Variable FOOD_NO: food number
TYPE: detection modepos or neg
PEAK_NO: peak number
Example /peak/01026/pos/8603
Description A detailed information of a peak specified by a food number, detection mode and a peak number is displayed on a browser.

Getting the results in JSON format

A full description about key names and the structure of each JSON object was omitted here. Please check them in the results obtained by the examples

Getting statistics

Format /api/stat
Example /api/stat
Description Statistical information such as number of food items and peaks. The prefix 'num' represents number in 'int' value, and the prefix 'ratio' represents ratio in 'float' value.

Getting a food list

Format /api/foods
Example /api/foods
Description A full food list is obtained in JSON format.

Getting a food list (for published items)

Format /api/foods/published
Example /api/foods/published
Description A list of food with published data is obtained in JSON format.

Getting a peak list detected in a food

Format /api/peaklist/FOOD_NO/TYPE
Variable FOOD_NO: a food number
TYPE: detection mode. pos or neg
Example /api/peaklist/01026/pos
Description A list of detected peaks in a specified food and detection mode is obtained in JSON format.

Getting peak information

Format /api/peak/FOOD_NO/TYPE/PEAK_NO
Variable FOOD_NO: a food number
TYPE: detection mode. pos or neg
PEAK_NO: a peak number
Example /api/peak/04032/pos/6461
Description A detailed informatio of a peak in a specified food, detection mode, and a peak number is obtained in JSON format.

Getting MS spectra for a peak

Format /api/msn/FOOD_NO/TYPE/PEAK_NO
Variable FOOD_NO: a food number
TYPE: detection mode. pos or neg
PEAK_NO: a peak number
Example /api/msn/04032/pos/6461
Description A MSn spectra information of a peak in a specified food, detection mode and a peak number is obtaine in JSON format.

Getting peaks in foods searched by a mass value and a retention time

Format /api/search/peaks/TARGET/MASS/MASS_TOLERANCE/MASS_TOLERANCE_UNIT/TYPE
/api/search/peaks/TARGET/MASS/MASS_TOLERANCE/MASS_TOLERANCE_UNIT/TYPE/RT/RT_TOLERANCE
Variable TARGET: mz, detected m/z value; or mzdi, molecular mass value after removal of adduct
MASS: a mass value
MASS_TOLERANCE: a tolerance of the mass value. At a maximum of 10 Da is allowed.
MASS_TOLERANCE_UNIT: unit of the mass tolerance. ppm or da
TYPE: detection mode. pos, neg, or both
Retention time limitation is not applied when omitting parameters below.
RT: a retention time
RT_TOLERANCE: a tolerance of the retention time (min)
Example /api/search/peaks/mz/611.1611/5/ppm/pos
/api/search/peaks/mzdi/307/0.5/da/both/13/1
Description A list of peaks matched the conditions is obtained in JSON format.

Getting summary of peaks in foods searched by a mass value and a retention time

Format /api/search/summary/TARGET/MASS/MASS_TOLERANCE/MASS_TOLERANCE_UNIT/TYPE
/api/search/summary/TARGET/MASS/MASS_TOLERANCE/MASS_TOLERANCE_UNIT/TYPE/RT/RT_TOLERANCE
Variable TARGET: mz, detected m/z value; or mzdi, molecular mass value after removal of adduct
MASS: a mass value
MASS_TOLERANCE: a tolerance of the mass value. At the maximum of 10 Da is allowed.
MASS_TOLERANCE_UNIT: unit of the mass tolerance. ppm or da
TYPE: detection mode. pos, neg, or both
Retention time limitation is not applied when omitting parameters below.
RT: a retention time
RT_TOLERANCE: a tolerance of the retention time (min)
Example /api/search/summary/mz/611.1611/5/ppm/pos
/api/search/summary/mzdi/307/0.5/da/both/13/1
Description A summary of the foods that the peaks were found by the search condition in the food groups is obtained in JSON format.

Getting file size of a ZIP file

Format /api/dlsize/FILE_TYPE/FOOD_NO/MODE
Variable FILE_TYPE: raw, mzXML, or peak
FOOD_NO: a food number
MODE: detection mode. pos, or neg
Example /api/dlsize/peak/01026/pos
Description Information of file name and file size (MB) of the zip compressed data is obtained in JSON format. Downloading is not performed by this API. Binary raw data (raw), mass chromatogram data converted into mzXML format (mzXML), and a set of peak list and MS spectra data (peak) are available for each food analyzed by positive and negative modes.

Getting the images

Getting a image of 2D chromatogram

Format /api/img/chrm/FOOD_NO/MODE
Variable FOOD_NO: a food number
MODE: detection mode. pos, or neg
Example /api/img/chrm/01026/pos
Description A 2-dimensional (2D) chromatogram of food analysis using LC-MS (x-axis: retention time, y-axis: m/z value) is obtained.

Getting a image of food

Format /api/img/food/FOOD_NO
Variable FOOD_NO: a food number
Example /api/img/food/01026
Description A image of analyzed food is obtained. The food image is for illustration purposes, and may differ from the sample which was actually analyzed here. A part of the images were obtained from the websites below.
Photo AC |  Forest in Full Bloom |  Food foto |  Photock |  Ashinari's website |  Sozai page

Getting a image of 2D chromatogram with a food image

Format /api/img/chrmfood/FOOD_NO/MODE
Variable FOOD_NO: a food number
MODE: detection mode. pos, or neg
Example /api/img/chrmfood/01026/pos
Description A 2-dimensional (2D) chromatogram of food analysis using LC-MS (x-axis: retention time, y-axis: m/z value) with an insertion of a food image at the top-right is obtained. The food image is for illustration purposes, and may differ from the sample which was actually analyzed here. A part of the food images were obtained from the websites below.
Photo AC |  Forest in Full Bloom |  Food foto |  Photock |  Ashinari's website |  Sozai page

Downloading

Download a ZIP file

Format /api/dl/FILE_TYPE/FOOD_NO/MODE
Variables FILE_TYPE: raw, mzXML, or peak
FOOD_NO: a food number
MODE: pos, or neg
Example /api/dl/peak/01026/pos
Description File download is performed. Binary raw data (raw), mass chromatogram data converted into mzXML format (mzXML), and a set of peak list and MS spectra data (peak) are available for each food analyzed by positive and negative modes.