I have my JSON in here: https://558b3eea-2ddb-4ba7-8c1f-b2ded681a17b-bluemix.cloudant.com/iotp_3f6oqn_default_2017-05-09/_all_docs?include_docs=true
And this is my HTML code in which I extract de data "Distance" to make some calculations:
<!DOCTYPE html>
  <html>
    <head>
        <title>Proyecto Final-Nivel del agua</title>
        <link rel="stylesheet" href="styles.css">
    </head>
    <body>
        <div class="app-wrapper flex -nowrap">
            <section class="app-section">
            <div class="app-section__wrapper flex--col -nowrap -justify-center h-talign-center">
                <h1 class="app-name">Agüita</h1>
                <p class="p--lead">Página para conocer los litros de agua almacenados en un depósito circular
                </p>
                <button class="app-section__action-btn js-next" (click)="nextSection('Configure')">Comienza <i class="fa fa-long-arrow-right"></i></button>
            </div>
            </section>
            <section class="app-section h-bkg-primary">
                <div class="app-section__wrapper">
                    <div class="form" >
                        <h1 class="header -h4 h-color-white">Calcula el nivel del agua</h1>
                        <p class="h-color-white">Ingresa las medidas</p>
                        <div class="form__group flex -justify-between">
                            <input type="number" id="alt" min="1" name="altura" placeholder="Altura cm" required />
                            <input type="number" id="diam" min="1" name="diametro" placeholder="Diametro cm" required />
                        </div>
                        <button onclick = "volumen()" class="app-section__action-btn js-next h-color-white" type="submit">Calcular <i class="fa fa-long-arrow-right"></i></button>
                        <p class="h-color-white">Capacidad total: </p> 
                        <p id= "total" class="h-color-white"> </p>   
                        <p class="h-color-white">Capacidad actual: </p> <p id= "actual" class="h-color-white"> </p>               
                    </div>
                </div>
            </section>
            <section class="app-section">
              <div class="app-section__wrapper -full-width">
                  <div class="app-section__header h-wrapper-padding">
                      <h1 class="header -h4">Resultado en litros:</h1>
                  </div>
              </div>
            </section>
        </div>
        <script>
            function volumen(){
                var diameter = document.getElementById("diam").value;
                var height = document.getElementById("alt").value;
                var radio = diameter/2;
                var total = Math.PI * (radio*radio)*height;
                document.getElementById("total").innerHTML = total + " ml";
                //Get JSON data
                var json = document.createElement('script');
                // assing src with callback name
                json.src = 'https://558b3eea-2ddb-4ba7-8c1f-b2ded681a17b-bluemix.cloudant.com/iotp_3f6oqn_default_2017-05-09/_all_docs?include_docs=true?callback=insertReply';
                // insert script to document and load content
                document.body.appendChild(json);
                //here's where the number from data: d: distance is kept
                var distance =  json;
                var actual = Math.PI * (radio*radio)*distance;
                document.getElementById("actual").innerHTML = actual + " ml";
            }
        </script>
    </body>
</html>
The only problem I'm facing is that I don't know how to extract just that particular data from the JSON.
The data I'm trying to get is from the first row. rows -> doc -> data -> d -> Distance -> number I'm trying to get.
 
    