Skip to content

zukahai/balance-chemical-equations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

API PTHH

bg

Get Stated

POST https://api-balance-chemical-equations.herokuapp.com/api/v1/pthh
data: 
{
   "pthh": "H2 + O2 = H2O"
}

Example with jquery javascript

   $.ajax({
       url: 'https://api-balance-chemical-equations.herokuapp.com/api/v1/pthh',
       type: 'POST',
       data: {
           "pthh": "H2 + O2 = H2O"
       },
       dataType: 'json',
       success: function(data, status, errors) {
            console.log(data);
           //solve data
       },
       error: function(data, status, errors) {
           console.log(errors);
       }
   })

Response result

{
    "message": "ok",
    "result": {
        "success": true,
        "input": "Ca(OH)2+O2=CaCO3+H2",
        "left": [
            "Ca(OH)2",
            "O2"
        ],
        "right": [
            "CaCO3",
            "H2"
        ],
        "element": {
            "Ca": 2,
            "O": 6,
            "H": 4
        },
        "data": {
            "dataLeft": {
                "Ca(OH)2": {
                    "Ca": 1,
                    "O": 2,
                    "H": 2
                },
                "O2": {
                    "O": 2
                }
            },
            "dataRight": {
                "CaCO3": {
                    "Ca": 1,
                    "C": 1,
                    "O": 3
                },
                "H2": {
                    "H": 2
                }
            }
        },
        "result": {
            "resultLeft": {
                "Ca(OH)2": 2,
                "O2": 1
            },
            "resultRight": {
                "CaCO3": 2,
                "H2": 2
            }
        },
        "text": "2Ca(OH)2 + O2 = 2CaCO3 + 2H2"
    }
}

Follow github.

bg

Follow me: https://github.com/zukahai