Nat4Wat API documentation (0.0.1)

GET sci-studies/sci-publicationsGet all scientific publications used in the tool and that passed peer-review.
    Responses
  • 200: Returns an array with all scientific studies that are used in the tool
    Example
    http://localhost:3001/sci-studies/sci-publications
GET sci-studies/sci-studiesGet all scientific studies gathering data about wastewater treatment performance used in the tool
    Parameters
  • records (string): if records is true, the array returned is object oriented. Otherwise, it is column oriented (polars dataframe).
    Responses
  • 200: Returns an array with all scientific studies that are used in the tool
    Example
    http://localhost:3001/sci-studies/sci-studies?records=true
GET technologies/technologiesGet the list of technologies
    Parameters:
  • id (string): The id of the technology to retrieve (only one).
    Responses:
  • 200: Returns an array with technologies
  • 400: Bad request if id does not exist
    Example
    http://localhost:3001/technologies/technologies?id=French_CW
    Table with ids and the corresponding technology:
idDescription
A_FWSAerated + free water surface wetland
IA_CWAerated treatment wetland
CSO_ATWAerated treatment wetland for CSO
AP+FP_PLAnaerobic + facultative pond
AP+FP+MP_PLAnaerobic + maturation pond
BS_ABSAnaerobic bioretention system
AP_PLAnaerobic pond
A_HAAquaponic system
BS_BSBioretention swale (or trench)
BS_BTPBioretention tree pit
SW_CASConveyance and attenuation swale
DB_DBDetention basin
GR_ERExtensive green roof
FP+MP_PLFacultative + maturation pond
FP_PLFacultative pond
FP_PL+FWS_CWFacultative pond + Free water surface flow constructed wetland
FS_FSFilter strips
FWS_CWFree water surface treatment wetland
French_CWFrench vertical flow treatment wetland
PP_GRGrass reinforcement
HF_GWHorizontal flow green wall
HSSF_CWHorizontal flow treatment wetland
HSSF_CW+MP_PLHorizontal flow treatment wetland + maturation pond
WWHybrid living wall
H_HAHydroponic system
I-SRSIn-stream restoration
IS_IBaInfiltration basin
IS_ITInfiltration trench
GR_IRIntensive green roof
GR_IRRIntensive green roof with retention layer
MP_PLMaturation pond
PP_MoPePModular permeable paving
NWNatural wetland
PhytoPhytoparking
PO_POPond
PO_PRPond retrofits
BS_RGRain garden
RG-TRain garden with treatment
BS_RPRaised planter
SIS_SRapid-rate soil infiltration system
IRM_CWReactive media in treatment wetland
R_CWReciprocating treatment wetland
Rair_FrWRhizosph'air aerated french wetland
GRRooftop treatment wetland
SIS_RSlow-rate soil infiltration system
IA_PLSurface aerated pond
CSO_CWTreatment wetland for CSO
TR_TRTrees
VSSF+HSSF_CWVertical flow + Horizontal flow treatment wetland
VF_GWVertical flow green wall
VSSF_CWVertical flow treatment wetland
VF-RPSVertical flow wetland with recycle and partial saturation
SW_WSWet swale
WSWillow system
POST technologies/find-nbsFind all the NBS suitable for a scenario
    Parameters
  • waterType (string): The type of water in the scenario. Defaults to any_wastewater, and so, it returns only technologies for water treatment.
      One of the following:
    • any_wastewater
    • raw_domestic_wastewater
    • greywater
    • secondary_treated_wastewater
    • pretreated_domestic_wastewater
    • river_diluted_wastewater
    • camping_wastewater
    • offices_wastewater
    • cso_discharge_water
    • rain_water
    • runoff_water
      When the waterType ends with "_wastewater" or is "greywater", then the technologies for water treatment are selected and the parameters for stormwater technologies are ignored.
      When the waterType ends with "_water", then the technologies for stormwater management are selected and the parameters for treatment technologies are ignored.
    • Parameters for treatment technologies:
    • inhabitants (positive number): The number of people served by the technology.
    • litresPerson (positive number): The litres of wastewater generated by a person in a day. Default: 120.
    • inflow (positive number): The inflow in m3/day. If not provided is calculated as inhabitants * litresPerson * 0.001
    • climate (string): The climate of the scenario, according to Koppen classification. Default: temperate.
        One of the following:
      • tropical
      • dry
      • temperate
      • continental
    • avgTemperature (number): The average temperature of the coolest month in the scenario.If climate is not provided, this is used to classify the climate.
    • pollutants (array): The pollutants to be removed by the technology. If pollutants are included in minPerformance or in pollutantsConcentrations, they are automatically added to this array.
        Any of the following:
      • bod_removal
      • cod_removal
      • nh4_removal
      • no3_removal
      • tn_removal
      • p_removal
      • pathogens_reduction
    • minPerformance (key:value object): The minimal performance of the technologies removing the pollutant. Default is 80. The pollutants admitted are bod cod tn nh4.
    • pollutantsConcentrations (key:value object): The pollutants concentrations in the inflow and outflow. The name of the pollutants must be suffixed with _in or _out depending on the location of the pollutant. The value of the pollutant must be a positive number. For example: {"bod_in": 50, "bod_out": 10}. The pollutants admitted and the units are in the following table:
      PollutantUnits
      bodmg/L
      codmg/L
      tnmg/L
      nh4mg/L
      Parameters for stormwater management technologies:
    • onlyInfiltration (bolean): If true, only technologies with infiltration are selected.
      • The following parameters are used to estimate the surface of the technologies:
      • spilledVolume (positive number): The volume of water spilled in the event of interest in m3.
      • cumRain (positive number): The cumulated rain in l/m2 for the event of interest. If spilledVolume is provided, this is ignored.
      • catchmentArea (positive number): The catchment area in m2. If spilledVolume is provided, this is ignored.
      • duration (positive number): The duration of the rain in hours.
      • drainagePipeDiameter (positive number): The diameter of the drainage pipe in m. (default: 0). Only used if surface is estimated.
      • infiltration (positive number): The infiltration rate of the receiving soil in mm/hour. If not provided, it is assumed as 0, i.e., no infiltration is possible. Then, technologies without storage capacity are rejected. Only used if surface is estimated.
      • infiltrationSoils (string): The type of soil where the technology is located. Only used if surface is estimated and infiltration is not provided.
          One of the following:
        • sand
        • loamySand
        • sandyLoam
        • loam
        • siltLoam
        • sandyClayLoam
        • clayLoam
        • siltyClayLoam
        • sandyClay
        • siltyClay
        • clay
      Parameters for CSO treatment technologies:
        The following parameters are used to estimate the surface of the technologies:
      • spilledVolume (positive number): The volume of water spilled by the CSO in a year in m3.
      Generic parameters:
    • area (positive number): The available surface to allocate the technology.
    • vertical (boolean): If false, green wall technologies are rejected.
    • verticalArea (positive number): The available vertical surface to allocate vertical technologies.
    • household (boolean): If true, only technologies that are available at house scale are selected.
    • ecosystemServices (key:value object): The technologies are filtered in terms of the provision of ecosystem services. The values admitted are from 0 (none) to 3 (high). All technologies providing the ecosystem services at that level or higher are included in the list of technologies returned.
        The ecosystem services admitted are:
      • es_biodiversity_fauna
      • es_biodiversity_flora
      • es_temperature_regulation
      • es_flood_mitigation
      • es_cso_mitigation
      • es_carbon_sequestration
      • es_biomass_production
      • es_aesthetic_value
      • es_recreation
      • es_pollination
      • es_food_source
      • es_water_reuse
      • es_biosolids
    • energy (string 'yes'|'no'): If 'no' technologies not using energy are selected. If 'yes' only technologies using energy are selected.
    • manPower (int 0:3): Manpower is the level of work hours required for the operation of the technologies. When provided, all technologies with a higher level of manpower are rejected.
    • skills (int 0:3): Skills refer to the required technical knowledge to operate the technology. When provided, all technologies with a higher level of manpower are rejected.
    • biohazardRisk (int 0:3): Biohazard risks include microorganisms, viruses and toxins that can affect human health. When provided, all technologies with a higher level of manpower are rejected.
  • techIds (array): This is a backdoor to get specific technologies. It expects and array of IDs corresponding to technologies in the knowledge base.
    Responses
  • 200: Returns an array with all suitable technologies.
  • 400: Bad request with an error message if body or some parameters are not in the expected format.
Example body
{
  "waterType": "greywater",   "inhabitants": 200,   "litresPerson": 120,   "inflow": 3000,   "area": 200,   "pollutants": ["bod_removal", "pathogens_reduction"],   "minPerformance": {"bod": 90, "tn": 80},   "pollutantsConcentrations": {"bod_in": 50, "bod_out": 10},   "climate": "tropical",   "avgTemperature": 21,   "vertical": false,   "verticalArea": 50,   "ecosystemServices" : {     "es_biodiversity_fauna": 2,     "es_recreation": 3    },   "energy": "no"   "manPower": 3   "skills": 2   "biohazardRisk": 1 }
POST technologies/find-nbs-multipleVectorized version of/find-nbs
    Parameters
  • It accepts the same parameters asfind-nbsbut it expects an array of objects instead of an object in the request body.
    Responses
  • 200: Returns an array containing an array of technologies for each object (scenario) in the body request.
  • 400: Returns a bad request when the request body is not an array
    Details
  • If some of the scenarios (objects in the array) returns a bad request, that item contains an error message
  • instead of the technology as follows:[{error: error message}]
Example body
[
  {     "waterType": "greywater",     "inhabitants": 200,     "litresPerson": 120,     "inflow": 3000,     "area": 200,     "climate": "tropical",     "avgTemperature": 21   },   {     "waterType": "raw_domestic_wastewater"   } ]
POST technologies/mcdaCalculate scores for MultiCriteria Decision Analysis
    Parameters
  • techs (array): An array of technologies with features as provided by technologies/find-nbs.
  • techIds (array): An array of ids of technologies. If techs is provided, this parameter is ignored.
  • weights (key:value object): An object with the weights of each score in the mcda between 0 and 5. Weights not provided default to 2.5.
      The weights admitted are:
    • wBiodiversity
    • wOperation
    • wSpaceRequirements
    • wEnvImpact
    • wCapex
    • wSocialBenefits
    • wCircularity
    • wRemovalPerformance
    Responses
  • 200: Returns an array containing an array of technologies for each object (scenario) in the body request.
  • 400: Returns a bad request when the request body is not an array
Example body
{
  "techIds": ["WW", "HSSF_CW", "GR"],   "weights" : {     "wOperation": 2,     "wEnvImpact": 3    } }
POST sci-studies/add-sci-studyAdd scientific study to the knowledge base.

If your study has more than one sample with different concentrations in the inflow or in the outflow, please upload as separate studies repeating the corresponding information.

    Parameters
  • username (string)*: The username of the user adding the study.
  • token (string)*: The token of the user adding the study (provided by API administrators).
  • email (string)*: The email of the user adding the study.
  • company (string): The company of the user adding the study.
  • technology (key:value object)*: Information on the technology features.
    It can contain the following keys, some of them are mandatory (*):
    • techId (string)*: The id of the technology according to knowledge base:
      One of the following ids:
      idDescription
      A_FWSAerated + free water surface wetland
      IA_CWAerated treatment wetland
      CSO_ATWAerated treatment wetland for CSO
      AP+FP_PLAnaerobic + facultative pond
      AP+FP+MP_PLAnaerobic + maturation pond
      BS_ABSAnaerobic bioretention system
      AP_PLAnaerobic pond
      A_HAAquaponic system
      BS_BSBioretention swale (or trench)
      BS_BTPBioretention tree pit
      SW_CASConveyance and attenuation swale
      DB_DBDetention basin
      GR_ERExtensive green roof
      FP+MP_PLFacultative + maturation pond
      FP_PLFacultative pond
      FP_PL+FWS_CWFacultative pond + Free water surface flow constructed wetland
      FS_FSFilter strips
      FWS_CWFree water surface treatment wetland
      French_CWFrench vertical flow treatment wetland
      PP_GRGrass reinforcement
      HF_GWHorizontal flow green wall
      HSSF_CWHorizontal flow treatment wetland
      HSSF_CW+MP_PLHorizontal flow treatment wetland + maturation pond
      WWHybrid living wall
      H_HAHydroponic system
      I-SRSIn-stream restoration
      IS_IBaInfiltration basin
      IS_ITInfiltration trench
      GR_IRIntensive green roof
      GR_IRRIntensive green roof with retention layer
      MP_PLMaturation pond
      PP_MoPePModular permeable paving
      NWNatural wetland
      PhytoPhytoparking
      PO_POPond
      PO_PRPond retrofits
      BS_RGRain garden
      RG-TRain garden with treatment
      BS_RPRaised planter
      SIS_SRapid-rate soil infiltration system
      IRM_CWReactive media in treatment wetland
      R_CWReciprocating treatment wetland
      Rair_FrWRhizosph'air aerated french wetland
      GRRooftop treatment wetland
      SIS_RSlow-rate soil infiltration system
      IA_PLSurface aerated pond
      CSO_CWTreatment wetland for CSO
      TR_TRTrees
      VSSF+HSSF_CWVertical flow + Horizontal flow treatment wetland
      VF_GWVertical flow green wall
      VSSF_CWVertical flow treatment wetland
      VF-RPSVertical flow wetland with recycle and partial saturation
      SW_WSWet swale
      WSWillow system
    • surface (positive number)*: The surface of the technology in m2.
    • year_operation (positive int)*: The year of operation of the technology.
    • hrt (positive number): The hydraulic retention time in days.
    • peopleServed (positive number): The number of people served by the technology.
  • water (key:value object)*: Information on the water features
    It can contain the following keys, some of them are mandatory (*):
    • type (string)*: The type of water used in the study. One of the following:
      • any_wastewater
      • raw_domestic_wastewater
      • greywater
      • secondary_treated_wastewater
      • pretreated_domestic_wastewater
      • river_diluted_wastewater
      • camping_wastewater
      • offices_wastewater
      • cso_discharge_water
      • rain_water
      • runoff_water

      If your water does not fit with any of the above categories, please contact us.

    • inflow (positive number)*: The inflow in m3/day.
    • urbanWaterSystem (string): The urban water system where the technology is located. One of the following:
      • WWTP
      • Household
      • River
    • temperature (positive number): The temperature of the water in ºC.
    • airTemperature (number): The temperature of the air in ºC.
  • pollutants (key:value object): The pollutants concentrations in the inflow and outflow. The name of the polluntats must be suffixed with _in or _out depending on the location of the pollutant. The value of the pollutant must be a positive number. For example: {"bod_in": 50, "bod_out": 10}. The pollutants admitted and the units are in the following table:
    PollutantUnits
    bodmg/L
    codmg/L
    tnmg/L
    nh4mg/L
  • document (key:value object)*: Information of the publication presenting the data.
    It may contain the following keys, some of them are mandatory (*):
    • title (string)*: The title of the publication.
    • doi (string)*: The doi of the publication. If the publication does not have a doi, you can upload it to a repository that provides a doi (e.g. Zenodo).
    • year (positive int)*: The year of publication.
    • authors (string): The authors of the publication. The authors shpould follow the format last_name, first_name initials. If there are more than one author, they should be separated by ;.
    • journal (string): The journal where the publication was published.
    • issue (string): The issue of the journal where the publication was published.
    • startPage (positive int): The start page of the publication in the journal.
    • endPage (positive int): The end page of the publication in the journal.

EU Acknowledgment

Multisource is funded by H2020 (grant no. 101003527).