everydayhero: Developer

Campaign totals

Individual campaign total

Using the campaigns endpoint with a .jsonp and callback option you can include campaign totals on websites.

Below shows a demo JQuery snippet that will load the campaign total on to a page.

  <script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type='text/javascript'>

  $(function() {
    $.getJSON('https://everydayhero.com/api/v2/campaigns/au-1234.jsonp?callback=?', {},  function (data) {          
      var funds = data.campaign.funds_raised;
      $('#raised').html(funds.currency.symbol + (funds.cents / 100) + " raised");


<div id='raised'></div>

Will display

$1000 raised