Logo de Fitbook






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)
  • First parameter: Graph title. (Optional. Eg titulo = Evolution)
  • Second Parameter: Size of the graph. (Optional medidas = 500x200)
  • Third and last parameter: Number of user you want to get the data.
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:
|| Evolucion del peso
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/apipeso.php?titulo=Evolucion&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
$a= file_get_contents("http://www.fitbook.es/apipeso.php?titulo=Evolucion&medidas=500x250&user=1"); echo ($a);
?>
NOTE: Where (1) is the user number.


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):
  • First parameter: type of graph. (Optional type = p for 2 dimensions, type = p3 for 3 dimensions and for type type = gom speedometer)
  • Second Parameter: Size of the graph (Optional eg medidas = 500x250)
  • Third and last parameter: Number of user you want to get the data.
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
$a= file_get_contents("http://www.fitbook.es/objetivo.php?titulo=Evolucion&medidas=500x250&user=1");
echo ($a);
?>
NOTE: Where (1) is the user number.


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.