Version: 1.56.40

The iLeagueRace Restful API

The iLeagueRacing api is intended for advanced users, It will be extremely helpful if you have worked with other API's before, as this api is no different than some other API's available on the internet. This System is under continued development. So new code and feeds should be updated here fairly regularly.
Some of the requirements for using this API is php 5, with CURL extension enabled on your web server. Most support those features So you should be okay. We also provide hosting packages, if you need something that's going to work no matter what our hosting packages will handle this api without any issues.

Keep in mind that although this allows you much more control over the output of various systems at ileague, It also means that It's harder to use and easier to break. If you don't feel advanced enough to use this API you can use the iframe system.

The Below Feed URLs are subject to change, as this system is still in it's infancy, Also feel free to modify any provided code. As

Championship Standings Feed URL: http://www.ileaguerace.com/api/example/result/id/86/

Code Base: (Currently only supports Single Class No Team Type Championships)


<?php
	$curl1 = curl_init();
	curl_setopt ($curl1, CURLOPT_URL, 'http://www.ileaguerace.com/api/example/result/id/86/');
        curl_setopt($curl1, CURLOPT_RETURNTRANSFER, 1);
	$event1_data = curl_exec ($curl1);
	curl_close ($curl1);
	$show_champ  = new SimpleXMLElement($event1_data);
        $points_leader = new SimpleXMLElement($event1_data);
?>
<?php foreach($points_leader as $lead):?>
<?$pts_total = $lead->champ_points;?>
<?break;?>
<?php endforeach;?>
<!-- BEGIN GET CHAMPIONSHIP DATA - ADD YOUR OWN CSS STYLE -->
	<table id="champlist" class="tablesorter">

    	<thead>
        	<tr>
                <th>Pos.</th>
                <th>Driver</th>
		<th>Pts</th>
		<?php if($mc->drop_mode == 'ON'):?>
		<th>Pts Total</th>
		<?php endif;?>
		<th>Behind</th>
                <th>S</th>
                <th>P</th>
                <th>W</th>
                <th>T5's</th>
                <th>Avg S</th>
                <th>Avg F</th>
                <th>Laps</th>
                <th>LL</th>
		<th>Pole%</th>
		<th>Win%</th>
		<th>LL%</th>
		<th>Miles</th>
		<th>KM</th>
		<th>Inc/R</th>
                <th>Inc</th>
		<th>CPI</th>
            </tr>
        </thead>

        <tbody>
        	<?php 
			$count = '1'; 
			foreach($show_champ as $ch):
			?>
        	<tr>
            	<td><?echo $count++?></td>
            	<td><?echo $ch->driver_title?></td>
		<td><?echo $ch->champ_points?></td>
		<?php if($mc->drop_mode == 'ON'):?>
		<td><?echo $ch->champ_points + $ch->drop_total?></td>
		<?php endif;?>
		<td><?$behind = $ch->champ_points - $pts_total?><?echo $behind?></td>
                <td><?echo $ch->starts_total?></td>
                <td><?echo $ch->poles_total?></td>
                <td><?echo $ch->wins_total?></td>
                <td><?echo $ch->top_five_total?></td>
                <td><?echo number_format((double)$ch->avg_s_total, 1)?></td>
                <td><?echo number_format((double)$ch->avg_f_total, 1)?></td>
                <td><?echo $ch->laps_total?></td>
                <td><?echo $ch->led_total?></td>
		<td><?php if($ch->poles_total == 0):?>0%<?php else:?><?$pole_perc = $ch->poles_total / $ch->starts_total?><?$p_p = $pole_perc * 100; $p_p_result = number_format($p_p, 1);?><?echo $p_p_result?>%<?php endif;?></td>
		<td><?php if($ch->wins_total == 0):?>0%<?php else:?><?$win_perc = $ch->wins_total / $ch->starts_total?><?$w_p = $win_perc * 100; $w_p_result = number_format($w_p, 1);?><?echo $w_p_result?>%<?php endif;?></td>
		<td><?php if($ch->led_total == 0):?>0%<?php else:?><?$ll_perc = $ch->led_total / $ch->laps_total?><?$ll_p = $ll_perc * 100; $ll_p_result = number_format($ll_p, 1);?><?echo $ll_p_result?>%<?php endif;?></td>
		<td><?echo $ch->miles_total?></td>
		<td><?echo $ch->km_total?></td>
		<td><?php if($ch->inc_total == 0):?>0.0<?php else:?><?$inc_per_race = $ch->inc_total / $ch->starts_total?><?echo number_format($inc_per_race, 1)?><?php endif;?></td>
		<td><?echo $ch->inc_total?></td>
		<td><?$cpi = $ch->turns * $ch->laps_total?><?php if($ch->inc_total == 0):?><?echo @number_format($cpi, 1, '.', '')?><?php else:?><?echo @number_format($cpi / $ch->inc_total, 1, '.', '')?><?php endif;?></td>
            </tr>
	<?php endforeach; ?>
        </tbody>

    </table>
<!-- END GET CHAMPIONSHIP DATA - ADD YOUR OWN CSS STYLE -->
	

Registered users: