Skip to content

Commit

Permalink
api_manual corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
shinokumura committed Feb 23, 2024
1 parent 0188679 commit 28c1705
Showing 1 changed file with 104 additions and 71 deletions.
175 changes: 104 additions & 71 deletions pages/api_manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@

layout = dbc.Container(
[
libs_navbar,
html.Hr(style={"border": "3px", "border-top": "1px solid"}),
# libs_navbar,
# html.Hr(style={"border": "3px", "border-top": "1px solid"}),
dcc.Markdown(
"""
### [REACTIONS REST API Documentation](#reactions)
### [Nuclear Reactions REST API Documentation](#reactions)
The REACTIONS REST API is built using Flask and provides access to the nuclear reaction dataset extracted from the Experimental Nuclear Reaction Database (EXFOR) using EXFOR_parser. The API endpoints are designed to retrieve data tables of specific nuclear reactions. This document outlines the available endpoints and their functionalities.
Expand All @@ -45,9 +45,11 @@
```bash
curl https://nds.iaea.org/dataexplorer/api/reactions/
```
**Response:**
- **Response:**
```json
{"message": "This is REACTIONS REST API"}
{
"message": "This is REACTIONS REST API"
}
```
##### 2. Search
Expand All @@ -56,29 +58,30 @@
- **Method:** `GET`
- **Description:** Search for reactions based on the specified type.
- **Parameters:**
- `type` (path parameter): Type of reaction (e.g., "XS", "FY", "RP").
- `type` (path parameter): Type of observable (e.g., `xs` for cross section, `fy` for fission yield, `rp` for residual production cross section, `th` for thermal neutron capture cross section).
- `page` (query parameter): Page number for pagination (default is 1).
- `table` (query parameter, boolean): Data table request (default is False)
- `eval` (query parameter, boolean): Evaluated nuclear reaction libraries data request (default is False)
- Additional parameters based on the type of reaction (refer to examples).
- **Examples:**
- Cross Section Search:
```bash
curl https://nds.iaea.org/reactions/xs?target_elem=Al&target_mass=27&reaction=n%2Cp&page=1
curl https://nds.iaea.org/dataexplorer/api/reactions/xs?target_elem=Al&target_mass=27&reaction=n%2Cp&&table=True&eval=True&page=1
```
- Fission Yield Search:
```bash
curl https://nds.iaea.org/reactions/fy?&target_elem=U&target_mass=235&reaction=n,f&fy_type=Cumulative&page=1
curl https://nds.iaea.org/dataexplorer/api/reactions/fy?&target_elem=U&target_mass=235&reaction=n,f&fy_type=Cumulative&table=True&eval=True&page=1
- Residual Products Search:
```bash
curl https://nds.iaea.org/reactions/rp?target_elem=Ti&target_mass=0&inc_pt=A&rp_elem=Cr&rp_mass=51&page=1
curl https://nds.iaea.org/dataexplorer/api/reactions/rp?target_elem=Ti&target_mass=0&inc_pt=A&rp_elem=Cr&rp_mass=51&page=1
```
- **Response:**
```json
{
"hits": 10,
"aggregations": { /* Aggregated data based on the search criteria */ },
"libraries": { /* Information about libraries */ },
}
{
"hits": 10,
"aggregations": { /* Aggregated data based on the search criteria */ },
"libraries": { /* Information about libraries */ },
}
```
#### Notes
Expand All @@ -89,78 +92,62 @@
This documentation provides a basic overview of the REACTIONS REST API. For more details and specific use cases, refer to the examples and consult with the API developer.
### [EXFOR Viewer REST API Manual](#exfor)
The EXFOR Viewer REST API is built using Flask and provides access to the EXFOR nuclear reaction database. The API endpoints are designed to retrieve specific information related to nuclear reactions such as experimental conditions, data tables, bibliography, etc. The API allows users to retrieve information related to an EXFOR entry or subentry by specifying the entry number and subentry number.
- **Base URL:** `https://nds.iaea.org/dataexplorer/api/exfor/`
#### EXFOR Viewer API Endpoints:
##### GET `/exfor/`
This endpoint returns a message indicating that this is the EXFOR REST API.
Example response:
```json
{"message": "This is EXFOR REST API"}
```
### [EXFOR Viewer REST API Documentation](#exfor)
##### GET `/exfor/<string:div>`
The EXFOR Viewer REST API is built using Flask and provides access to the EXFOR nuclear reaction database. The API endpoints are designed to retrieve specific information related to nuclear reactions stored in the EXFOR format such as experimental conditions, data tables, bibliography, etc. The API allows users to retrieve information related to an EXFOR entry or subentry by specifying the entry number and subentry number.
This endpoint returns a JSON object containing the relevant data for the specified category. The valid values for `<string:div>` are "entry", "facility", "institute", "method", and "detector". If `<string:div>` is "entry", a message is returned indicating that the user should specify an entry number.
* Path Parameters
#### Overview
- `div`: A string indicating the division to access.
The EXFOR Viewer REST API provides access to JSON converted EXFOR entries and the entities defined in the EXFOR dictionary.
Available options:
- **Base URL:** `https://nds.iaea.org/dataexplorer/api/exfor/`
- entry: Returns instructions for how to access a specific entry number in the database.
- facility: Returns a list of facilities in the database.
- institute: Returns a list of institutes in the database.
- method: Returns a list of methods in the database.
- detector: Returns a list of detectors in the database.
#### EXFOR Viewer API Endpoints:
Example requests and responses:
##### GET `/exfor/`
- GET `/api/exfor/facility`
This endpoint returns a message indicating that this is the EXFOR REST API.
```json
{
"1CANALA": "University of Alberta, Edmonton, Alberta",
"2JPNJAE": "Japan Atomic Energy Agency (JAEA)",
...
}
- **Endpoint:** `/`
- **Method:** `GET`
- **Description:** Get information about the REACTIONS REST API.
- **Example:**
```bash
curl https://nds.iaea.org/dataexplorer/api/exfor/
```
- GET `/exfor/method`
- **Response:**
```json
{
"ACTIV": "Activation",
"EDE": "Particle identification by 'E/Delta E' measurement",
...
"message": "This is EXFOR REST API"
}
```
- GET `/exfor/entry`
```json
{"message": "specify the entry number such as /api/exfor/10300"}
```
##### GET `/exfor/<string:div>`
##### GET `/api/exfor/entry/<string:entnum>`
This endpoint returns a JSON object containing the relevant data for the specified category. The valid values for `<string:div>` are "entry", "subentry", and "dict".
- **Endpoint:** `/<type>`
- **Method:** `GET`
- **Description:** Search for reactions based on the specified type.
- **Parameters:**
- `entry`: Returns a specific entry in JSON format.
- `subentry`: Returns a specific sub-entry in JSON format.
- `dict`: Returns definition of the EXFOR keywords defined in the EXFOR dictionary.
This endpoint returns a JSON object containing the data for the specified EXFOR entry number. The `<string:entnum>` parameter should be a 5-digit string. If an invalid length is provided, an error message is returned.
###### GET `/api/exfor/entry/<string:entnum>`
Example request and response:
This endpoint returns a JSON object of EXFOR entry. The `<string:entnum>` parameter should be a 5-digit string.
- **Example:**
```bash
GET `/api/exfor/entry/10300`
- curl https://nds.iaea.org/dataexplorer/api//exfor/entry/10300
```
- **Response:**
```json
{
"entry": "10300",
Expand All @@ -172,16 +159,15 @@
}
```
##### GET `/api/exfor/entry/<string:entnum>/<string:section>`
###### GET `/api/exfor/entry/<string:entnum>/<string:section>`
This endpoint returns a JSON object containing the specified section of the data for the specified EXFOR entry number. The `<string:entnum>` parameter should be a 5-digit string, and the `<string:section>` parameter should be one of "reactions", "bib", "histories", "data", or "experiment". If an invalid length is provided for `<string:entnum>`, an error message is returned. If an invalid section is provided, an error message is returned.
Example request and response:
This endpoint returns a JSON object containing the specified section of the data for the specified EXFOR entry number. The `<string:section>` parameter should be one of "reactions", "bib", "histories", "data", or "experiment". If an invalid length is provided for `<string:entnum>`, an error message is returned.
- **Example:**
```bash
GET `/api/exfor/entry/10300/data`
curl https://nds.iaea.org/dataexplorer/api/exfor/entry/10300/data
```
- **Response:**
```json
{
"data_tables": {
Expand All @@ -192,16 +178,17 @@
}
```
##### GET `/api/exfor/subentry/<string:entnum>/<string:subent>`
This endpoint returns a JSON object containing the data for the specified subentry of the specified EXFOR entry number. The `<string:entnum>` parameter should be a 5-digit string, and the `<string:subent>` parameter should be a 3-digit string. If an invalid length is provided for either parameter, an error message is returned.
###### GET `/api/exfor/subentry/<string:entnum>/<string:subent>`
Example request and response:
This endpoint returns a JSON object containing the data for the specified subentry of the specified EXFOR entry number. The `<string:entnum>` parameter should be a 5-digit string, and the `<string:subent>` parameter should be a 3-digit string. If an invalid length is provided for either parameter, an error message is returned.
- **Example:**
```bash
GET `/api/exfor/subentry/10300/001`
curl https://nds.iaea.org/dataexplorer/api/exfor/subentry/10300/001
```
- **Response:**
```json
{
"entry": "10300001",
Expand All @@ -211,6 +198,52 @@
... }
}
```
###### GET `/api/exfor/dict/<string:field>`
This endpoint returns a JSON object containing the list of the EXFOR keywords. The valid values for `<string:field>` are "facility", "institute", "method", and "detector".
- **Endpoint:** `/<field>`
- **Method:** `GET`
- **Description:** Search for the definition of EXFOR keywords defined in the EXFOR dictionary.
- **Parameters:**
- `facility`: Returns a list of facilities in the dictionary.
- `institute`: Returns a list of institutes in the dictionary.
- `method`: Returns a list of methods in the dictionary.
- `detector`: Returns a list of detectors in the dictionary.
- **Example:**
```bash
GET `/api/exfor/dict/facility`
```
- **Response:**
```json
{
"1CANALA": "University of Alberta, Edmonton, Alberta",
"2JPNJAE": "Japan Atomic Energy Agency (JAEA)",
...
}
```
###### GET `/api/exfor/dict/<string:field>/<string:keyword>`
This endpoint returns a JSON object containing the definitions of the EXFOR keywords. If the keyword searched is obsolete, "active" returns "false".
- **Example:**
```bash
GET `/api/exfor/dict/method/ede`
```
- **Response:**
```json
{
"active":true,
"description":"Particle identification by 'E/Delta E' measurement"
}
```
""",
link_target="_blank",
),
Expand Down

0 comments on commit 28c1705

Please sign in to comment.