Base URL

https://dgbyg.drziweidai.com

A research version of dGbyG is also available as a Python package for local use. Source code and installation details can be found on https://github.com/f-wc/dGbyG/tree/main.

GEM Database Search APIs

Models API
Endpoint
GET /api/models?q={query} Search and retrieve metabolic model information
Query Parameters
Parameter Type Required Description
q string Yes Model name or identifier (e.g., "Recon3D", "Human-GEM")
Example Request
curl "https://dgbyg.drziweidai.com/api/models?q=Recon3D"
Example Response
{
"models": [
  {
    "conditions": {
      "Cytosol": {
        "I": 0.25,
        "T": 298.15,
        "e_potential": 0,
        "pH": 7.2,
        "pMg": 14.0
      },
      "Endoplasmic reticulum": {
        "I": 0.25,
        "T": 298.15,
        "e_potential": 0,
        "pH": 7.2,
        "pMg": 14.0
      },
      "Extracellular": {
        "I": 0.25,
        "T": 298.15,
        "e_potential": 0.03,
        "pH": 7.4,
        "pMg": 14.0
      },
      "Golgi apparatus": {
        "I": 0.25,
        "T": 298.15,
        "e_potential": 0,
        "pH": 6.35,
        "pMg": 14.0
      },
      "Inner mitochondria": {
        "I": 0.25,
        "T": 298.15,
        "e_potential": -0.155,
        "pH": 8.0,
        "pMg": 14.0
      },
      "Lysosome": {
        "I": 0.25,
        "T": 298.15,
        "e_potential": 0.019,
        "pH": 5.5,
        "pMg": 14.0
      },
      "Mitochondria": {
        "I": 0.25,
        "T": 298.15,
        "e_potential": -0.155,
        "pH": 8.0,
        "pMg": 14.0
      },
      "Nucleus": {
        "I": 0.25,
        "T": 298.15,
        "e_potential": 0,
        "pH": 7.2,
        "pMg": 14.0
      },
      "Peroxisome": {
        "I": 0.25,
        "T": 298.15,
        "e_potential": 0.012,
        "pH": 7.0,
        "pMg": 14.0
      }
    },
    "download_url": "/api/models/Recon3D/download",
    "model_id": "Recon3D",
    "stats": {
      "boundary_reactions": 1892,
      "covered_irreversible": 5187,
      "covered_multi_compartment": 4412,
      "covered_reactions": 9646,
      "covered_reversible": 4459,
      "covered_reversible_vs_irreversible": "4459:5187",
      "covered_single_compartment": 5234,
      "covered_single_vs_multi_compartment": "5234:4412",
      "total_reactions": 13543,
      "unbalanced_reactions": 565,
      "unstructured_reactions": 1440
    }
  }
],
"query": "Recon3D",
"total_found": 1
}
Reactions API
Endpoint
GET /api/reactions?q={query}&include_dg={true|false} Search biochemical reactions with optional ΔrG° calculations
Query Parameters
Parameter Type Required Default Description
q string Yes - Reaction BiGG ID or name(e.g., "10FTHF5GLUtl","5-glutamyl-10FTHF transport, lysosomal")
model_filter string No null Filter by specific model
include_dg boolean No true Include ΔrG° data in response
Example Request
curl "https://dgbyg.drziweidai.com/api/reactions?q=ALADGLNexR&include_dg=true"
Example Response
{
"include_dg": true,
"model_filter": null,
"query": "ALADGLNexR",
"reactions": [
  {
    "dg_data": [
      {
        "SD": 0.0,
        "equation": "ala__D_e + gln__L_c <=> ala__D_c + gln__L_e",
        "model_id": "RECON1",
        "reaction_id": "ALADGLNexR",
        "standard_dGr_prime": 3.42
      },
      {
        "SD": 0.0,
        "equation": "ala_D[e] + gln_L[c] <=> ala_D[c] + gln_L[e]",
        "model_id": "Recon3D",
        "reaction_id": "ALADGLNexR",
        "standard_dGr_prime": 2.61
      },
      {
        "SD": 0.0,
        "equation": "ala__D_e + gln__L_c <=> ala__D_c + gln__L_e",
        "model_id": "iCHOv1",
        "reaction_id": "ALADGLNexR",
        "standard_dGr_prime": 3.42
      },
      {
        "SD": 0.0,
        "equation": "ala__D_e + gln__L_c <=> ala__D_c + gln__L_e",
        "model_id": "iMM1415",
        "reaction_id": "ALADGLNexR",
        "standard_dGr_prime": 3.42
      },
      {
        "SD": 0.0,
        "equation": "ala__D_c + gln__L_e <=> ala__D_e + gln__L_c",
        "model_id": "Human-GEM",
        "reaction_id": "ALADGLNexR",
        "standard_dGr_prime": -3.42
      },
      {
        "SD": 0.0,
        "equation": "ala__D_c + gln__L_e <=> ala__D_e + gln__L_c",
        "model_id": "Worm-GEM",
        "reaction_id": "ALADGLNexR",
        "standard_dGr_prime": -3.42
      },
      {
        "SD": 0.0,
        "equation": "ala__D_c + gln__L_e <=> ala__D_e + gln__L_c",
        "model_id": "Rat-GEM",
        "reaction_id": "ALADGLNexR",
        "standard_dGr_prime": -3.42
      },
      {
        "SD": 0.0,
        "equation": "ala__D_c + gln__L_e <=> ala__D_e + gln__L_c",
        "model_id": "Zebrafish-GEM",
        "reaction_id": "ALADGLNexR",
        "standard_dGr_prime": -3.42
      },
      {
        "SD": 0.0,
        "equation": "ala__D_c + gln__L_e <=> ala__D_e + gln__L_c",
        "model_id": "Mouse-GEM",
        "reaction_id": "ALADGLNexR",
        "standard_dGr_prime": -3.42
      },
      {
        "SD": 0.0,
        "equation": "ala__D_c + gln__L_e <=> ala__D_e + gln__L_c",
        "model_id": "Fruitfly-GEM",
        "reaction_id": "ALADGLNexR",
        "standard_dGr_prime": -3.42
      }
    ],
    "equation": "ala__D_e + gln__L_c <=> ala__D_c + gln__L_e",
    "id": "ALADGLNexR",
    "model_list": [
      "Fruitfly-GEM",
      "Human-GEM",
      "Mouse-GEM",
      "RECON1",
      "Rat-GEM",
      "Recon3D",
      "Worm-GEM",
      "Zebrafish-GEM",
      "iCHOv1",
      "iMM1415"
    ],
    "name": "L-alanine/glutamine reversible exchange"
  }
],
"total_found": 1
}
Metabolites API
Endpoint
GET /api/metabolites?q={query} Search metabolites and their associated reactions
Query Parameters
Parameter Type Required Description
q string Yes Metabolite name or ID (e.g., "10fthf5glu_l", "glucose")
model_filter string No Filter by specific model
Example Request
curl "https://dgbyg.drziweidai.com/api/metabolites?q=10fthf5glu_l&model_filter=RECON1"
Example Response
{
"include_dg": true,
"metabolites": [
  {
    "formula": "C40H45N11O19",
    "id": "10fthf5glu_l",
    "name": "10-formyltetrahydrofolate-[Glu](5)",
    "reactions": [
      {
        "dg_data": [
          {
            "SD": 0.0,
            "equation": "10fthf5glu_c --> 10fthf5glu_l",
            "model_id": "RECON1",
            "reaction_id": "10FTHF5GLUtl",
            "standard_dGr_prime": -447.94
          }
        ],
        "equation": "10fthf5glu_c --> 10fthf5glu_l",
        "model_list": [
          "RECON1"
        ],
        "name": "5-glutamyl-10FTHF transport, lysosomal",
        "reaction_id": "10FTHF5GLUtl"
      },
      {
        "dg_data": [
          {
            "SD": 22.2,
            "equation": "10fthf5glu_l + 4.0 h2o_l --> 10fthf_l + 4.0 glu__L_l",
            "model_id": "RECON1",
            "reaction_id": "GGH_10FTHF5GLUl",
            "standard_dGr_prime": 4.57
          }
        ],
        "equation": "10fthf5glu_l + 4.0 h2o_l --> 10fthf_l + 4.0 glu__L_l",
        "model_list": [
          "RECON1"
        ],
        "name": "Gamma-glutamyl hydrolase (10FTHF5GLU), lysosomal",
        "reaction_id": "GGH_10FTHF5GLUl"
      },
      {
        "dg_data": [
          {
            "SD": 38.51,
            "equation": "10fthf6glu_l + h2o_l --> 10fthf5glu_l + glu__L_l",
            "model_id": "RECON1",
            "reaction_id": "GGH_10FTHF6GLUl",
            "standard_dGr_prime": -135.72
          }
        ],
        "equation": "10fthf6glu_l + h2o_l --> 10fthf5glu_l + glu__L_l",
        "model_list": [
          "RECON1"
        ],
        "name": "Gamma-glutamyl hydrolase (10FTHF6GLU), lysosomal",
        "reaction_id": "GGH_10FTHF6GLUl"
      }
    ],
    "universal_id": "10fthf5glu"
  }
],
"model_filter": "RECON1",
"query": "10fthf5glu_l",
"total_found": 1
}
Genes API
Endpoint
GET /api/genes?q={query} Search genes and their associated reactions
Query Parameters
Parameter Type Required Description
q string Yes Gene name or ID (e.g., "ENO1", "LDHC")
max_reactions integer No Max reactions per gene (default: 10)
model_filter string No Filter by specific model
Example Request
curl "https://dgbyg.drziweidai.com/api/genes?q=LDHC&max_reactions=1"
Example Response
{
"genes": [
  {
    "id": "Ldhc",
    "model_list": [
      "Mouse-GEM",
      "Rat-GEM"
    ],
    "name": "Ldhc",
    "reactions": [
      {
        "gpr_info": [
          {
            "gpr": "Ldha or Ldhal6b or Ldhb or Ldhc or Ldhd",
            "models": [
              "Mouse-GEM",
              "Rat-GEM"
            ]
          }
        ],
        "id": "2H3MVc",
        "name": "Formation of 2-Hydroxy-3-Methyl-Valerate"
      }
    ],
    "total_reactions": 4
  },
  {
    "id": "3948_AT1",
    "model_list": [
      "RECON1"
    ],
    "name": "LDHC",
    "reactions": [
      {
        "gpr_info": [
          {
            "gpr": "(3939_AT1 and 3945_AT1) or 3945_AT1 or 92483_AT1 or 3939_AT1 or 55293_AT1 or 160287_AT1 or 3948_AT2 or 3948_AT1",
            "models": [
              "RECON1"
            ]
          }
        ],
        "id": "2HBO",
        "name": "2 HydroxybutyrateNAD oxidoreductase"
      }
    ],
    "total_reactions": 4
  },
  {
    "id": "3948_AT2",
    "model_list": [
      "RECON1"
    ],
    "name": "LDHC",
    "reactions": [
      {
        "gpr_info": [
          {
            "gpr": "(3939_AT1 and 3945_AT1) or 3945_AT1 or 92483_AT1 or 3939_AT1 or 55293_AT1 or 160287_AT1 or 3948_AT2 or 3948_AT1",
            "models": [
              "RECON1"
            ]
          }
        ],
        "id": "2HBO",
        "name": "2 HydroxybutyrateNAD oxidoreductase"
      }
    ],
    "total_reactions": 4
  },
  {
    "id": "ENSG00000166796",
    "model_list": [
      "Human-GEM"
    ],
    "name": "LDHC",
    "reactions": [
      {
        "gpr_info": [
          {
            "gpr": "ENSG00000111716 or ENSG00000134333 or ENSG00000166796 or ENSG00000166800 or ENSG00000166816 or ENSG00000171989",
            "models": [
              "Human-GEM"
            ]
          }
        ],
        "id": "2H3MVc",
        "name": "Formation of 2-Hydroxy-3-Methyl-Valerate"
      }
    ],
    "total_reactions": 4
  },
  {
    "id": "16833",
    "model_list": [
      "iMM1415"
    ],
    "name": "Ldhc",
    "reactions": [
      {
        "gpr_info": [
          {
            "gpr": "16833 or 52815 or 16832 or 160287 or (16832 and 16828) or 106557 or 16828 or 52815 or 16833",
            "models": [
              "iMM1415"
            ]
          }
        ],
        "id": "HPYRR2x",
        "name": "Hydroxypyruvate reductase (NADH)"
      }
    ],
    "total_reactions": 1
  },
  {
    "id": "3948",
    "model_list": [
      "iAT_PLT_636"
    ],
    "name": "LDHC",
    "reactions": [
      {
        "gpr_info": [
          {
            "gpr": "(3945 and 3939) or 3939 or 3945 or 3948 or 92483 or 55293 or 160287",
            "models": [
              "iAT_PLT_636"
            ]
          }
        ],
        "id": "LDH_L",
        "name": "L-lactate dehydrogenase"
      }
    ],
    "total_reactions": 1
  }
],
"max_reactions_per_gene": 1,
"model_filter": null,
"query": "LDHC",
"total_found": 6
}

ΔrG° Calculation APIs

Single Equation Prediction
Endpoint
POST /calculate Calculate ΔrG° for a single chemical reaction
Request Parameters
Parameter Type Required Description
equation string Yes Chemical equation (e.g., "2 [H][H] + O=O = 2 O")
identifier_type string Yes Identifier type: "smiles", "inchi", "inchi_key","kegg", "metanetx", "hmdb", "name","pubchem","chebi", "bigg", "mixed"
reaction_condition string Yes Condition: "d" (default), "c" (cytosol), "m" (mitochondria), "n" (nucleus), "e" (extracellular), "r" (endoplasmic reticulum), "g" (Golgi apparatus), "l" (lysosome), "i" (intermembrane space), "x" (peroxisome), "custom" (user-defined).
custom_condition object No Custom conditions (required when reaction_condition="custom")
Example Request (Standard)
curl -X POST https://dgbyg.drziweidai.com/calculate \
  -H "Content-Type: application/json" \
  -d '{
    "equation": "2 [H][H] + O=O = 2 O",
    "identifier_type": "smiles",
    "reaction_condition": "d"
  }'
Example Response
{
  "dG_prime": -529.06,
  "dG_std_dev": 3.96,
  "message": "Calculation completed successfully"
}
Example Request (Mixed Identifiers)
curl -X POST https://dgbyg.drziweidai.com/calculate \
  -H "Content-Type: application/json" \
  -d '{
    "equation": "CHEBI:37736 = SMILES:O=C(CO)COP(=O)(O)O + name:D-Glyceraldehyde 3-phosphate",
    "identifier_type": "mixed",
    "reaction_condition": "custom",
    "custom_condition": {
      "0": {"pH": 8.0, "I": 0.25, "pMg": 14.0, "e_potential": 0.0},
      "1": {"pH": 7.0, "I": 0.25, "pMg": 14.0, "e_potential": 0.0},
      "2": {"pH": 7.0, "I": 0.25, "pMg": 14.0, "e_potential": 0.0}
    }
  }'
When using "mixed" identifier type, each compound should be prefixed with its identifier type (e.g., CHEBI:37736, SMILES:CCO, name:glucose)
Example Response
{
  "dG_prime": -35.96,
  "dG_std_dev": 0.45,
  "message": "Calculation completed successfully"
}
Batch Equations Prediction
Endpoint
POST /batch_calculate Calculate ΔrG° for multiple reactions in one request
Request Parameters
Parameter Type Required Description
equations string Yes Multiple equations, one per line
identifier_type string Yes Same as single equation
reaction_condition string Yes Same as single equation
Example Request
curl -X POST https://dgbyg.drziweidai.com/batch_calculate \
  -H "Content-Type: application/json" \
  -d '{
    "equations": "2 [H][H] + O=O = 2 O\nOCC1OC(O)C(O)C(O)C1O + O=P(O)(O)OP(O)(O)=O = OCC1OC(O)C(O)C(O)C1OP(=O)(O)O + O=P(O)(O)O",
    "identifier_type": "smiles",
    "reaction_condition": "custom",
    "custom_condition": {
        "pH": 7.4,
        "I": 0.15,
        "pMg": 3.0,
        "e_potential": -0.2
      }
  }'
Example Response
{
  "message": "Batch calculation completed",
  "results": [
    {
      "dG_prime": -529.06,
      "dG_std_dev": 3.96,
      "equation": "2 [H][H] + O=O = 2 O",
      "status": "success"
    },
    {
      "dG_prime": 6.45,
      "dG_std_dev": 1.97,
      "equation": "OCC1OC(O)C(O)C(O)C1O + O=P(O)(O)OP(O)(O)=O = OCC1OC(O)C(O)C(O)C1OP(=O)(O)O + O=P(O)(O)O",
      "status": "success"
    }
  ]
}

Legacy Endpoints

Note: These endpoints are maintained for backward compatibility. Use the APIs above for new projects.

Unified GEM Search (Legacy)
Endpoint
POST /gem-dg Legacy unified search across all database entities

Recommendation: Use the specialized API endpoints above for better performance and cleaner responses.

API Reference

Error Handling

All API endpoints use standard HTTP status codes:

Status Code Description Common Causes
200 OK Request successful Valid query with results
400 Bad Request Invalid parameters Missing query, invalid values
404 Not Found Resource not found Invalid endpoint or model ID
429 Too Many Requests Rate limit exceeded Too many requests per hour
500 Internal Server Error Server error Database issues, processing errors
Error Response Format
{
  "error": "Invalid query parameter",
  "status_code": 400,
  "timestamp": "2024-03-15T10:30:00Z"
}
Rate Limiting

API rate limits ensure fair usage and system stability:

Endpoint Category Rate Limit Window Notes
Thermodynamic Calculations No limit - Core functionality
GEM Database APIs 300 requests Per hour Search operations
Legacy Endpoints 300 requests Per hour Backward compatibility

Need higher limits? Install our Python package for unlimited local calculations.

Support & Documentation