Base URL
https://dgbyg.drziweidai.com

Prefer running dGbyG locally? A research version is available as a Python package. The source code and installation instructions are available on GitHub.

GEM Database Search APIs

Models API
Endpoint
GET /api/models?q={query} Search and return matching metabolic models.
Query parameters
Parameter Type Required Description
q string Yes Model name or ID (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 reactions. Optionally include ΔrG° results in the response.
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 Limit results to a specific model.
include_dg boolean No true Include ΔrG° data in the 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 return related reactions.
Query parameters
Parameter Type Required Description
q string Yes Metabolite name or ID (e.g., "10fthf5glu_l", "glucose")
model_filter string No Limit results to a 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-",
    "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 return 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 Limit results to a 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
  }
],
"max_reactions_per_gene": 1,
"model_filter": null,
"query": "LDHC",
"total_found": 6
}
ΔrG° Calculation APIs
Single Reaction Calculation
Endpoint
POST /calculate Calculate ΔrG° for one reaction.
Request parameters
Parameter Type Required Description
equation string Yes Reaction equation (e.g., "2 [H][H] + O=O = 2 O")
identifier_type string Yes One of: "smiles", "inchi", "inchi_key", "kegg", "metanetx", "hmdb", "name", "pubchem", "chebi", "bigg", "mixed"
reaction_condition string Yes Choose a preset: "d" (default), "c" (cytosol), "m" (mitochondria), "n" (nucleus), "e" (extracellular), "r" (endoplasmic reticulum), "g" (Golgi apparatus), "l" (lysosome), "i" (intermembrane space), "x" (peroxisome), or "custom" (user-defined).
custom_condition object No Required when reaction_condition is "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}
    }
  }'
For "mixed", prefix each compound 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 Reaction Calculation
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 the single-reaction endpoint.
reaction_condition string Yes Same as the single-reaction endpoint.
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 kept for backward compatibility. For new integrations, use the APIs above.

Unified GEM Search (Legacy)
Endpoint
POST /gem-dg Legacy endpoint that searches across all database entities.

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

API Reference
Error Handling

All endpoints use standard HTTP status codes:

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

Rate limits help keep the service stable and fair for everyone:

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 the Python package to run calculations locally.

Support & Documentation