| Home - Developers - Fitbook APIS |
| Many of you were waiting for the API's of Fitbook for better integration in your websites. Here I am presenting them: |
API for graphical representation of the evolution of body weight. |
| You can get a custom line graph of the evolution of the weight of any user, just have to build the URL with three parameters: (2 of them optional) |
|
| How to build de URL? |
| An example URL is: http://www.fitbook.es/apipeso.php?titulo=Evolucion&medidas=500x250&user=1 |
| This URL produces the following graph: |
|
||
|
| How do I include the direct link to the graphic from my site? |
| The easiest way is to do it directly in an include |
| Example: |
|
<?php
NOTE: Where (1) is the user number.include('http://www.fitbook.es/apipeso.php?titulo=Evolucion&medidas=500x250&user=1') ?> or, if your host uses PHP 5.0 or higher... You probablly ha ve to use this:
<?php
NOTE: Where (1) is the user number.$a= file_get_contents("http://www.fitbook.es/apipeso.php?titulo=Evolucion&medidas=500x250&user=1"); echo ($a); ?> |
Thus, the URL generated and displayed on your site (in the case of this graph) is as follows: http://chart.apis.google.com/chart?chs=500x250&cht=lc&chtt=Evolucion&chd=t:73.00,77.00,78.00,77.00,85.00,78.00,77.00,95.00&chco=0000ff&chdl=Peso%20(Kgs)&chxl=0:|01|07|04|09|01|07|08|12&chxt=x |
Does not appear any Fitbook reference on your site. |
API for Percentage Done graph. |
| You can get a custom pie chart the percentage achieved by any user, just have to build the URL with three parameters (two loos optional): |
|
| How to build the URL? |
| An example URL is:: http://www.fitbook.es/apiobjetivo.php?tipo=p3&medidas=500x250&user=1 |
| This URL produces the following graph |
|
query failed
|
| How do I include the direct link to the graphic from my site? |
| The easiest way is to do it directly in an include |
| Example: |
|
<?php
include('http://www.fitbook.es/apiobjetivo.php?tipo=p3&medidas=500x250&user=1') ?> NOTE: Where (1) is the user number. or, if your host uses PHP 5.0 or higher... You probablly ha ve to use this:
<?php
NOTE: Where (1) is the user number.$a= file_get_contents("http://www.fitbook.es/objetivo.php?titulo=Evolucion&medidas=500x250&user=1"); echo ($a); ?> |
The URL generated is the following: http://chart.apis.google.com/chart?cht=p&chd=t:78.72,21.28&chs=500x200&chl=Cons|Pend |
|
query failed
NOTE: Where (1) is the user number. or, if your host uses PHP 5.0 or higher... You probablly ha ve to use this:
<?php
$a= file_get_contents("http://www.fitbook.es/apiobjetivo.php?titulo=Evolucion&medidas=500x250&user=1"); echo ($a); ?> NOTE: Where (1) is the user number. |
This second example creates a Speedometer graph only changing the parameter tipo=gom and the URL generates the following grapth: http://chart.apis.google.com/chart?cht=gom&chd=t:78.72&chs=500x250&chl=Conseguido |
No Fitbook's references appers on your site. |