File: //home/httpd/mech_ftp/baretube.com/api/api.documentation.php
<?
$headertitle = "Public API Documentation v1.0";
$title = "Public API Documentation v1.0";
getTemplate('template.overall_header.php');
?>
<p>This website features a public JSON-Based API which allow you to interface with it. Below are the methods and sample outputs.<p>
<h3>» media.newest</h3>
<p>This endpoint allows you to request the newest media from the website.<br />
Sample Request: <? echo $basehttp; ?>/api/?output=json&command=media.newest&type=videos&offset=0&amount=10<br><br>
The endpoint accepts the following parameters:</p>
<table width="500" border="1" cellspacing="0" cellpadding="5">
<tr>
<td valign="top">output</td>
<td valign="top">Must be set to "json". Currently, this is the only available output format.</td>
</tr>
<tr>
<td width="104" valign="top">command</td>
<td width="396" valign="top">Must be set to "media.newest"</td>
</tr>
<tr>
<td valign="top">type</td>
<td valign="top">The type of media to display. Must be "videos" or "galleries".</td>
</tr>
<tr>
<td valign="top">offset</td>
<td valign="top">Number of media to offset the results by</td>
</tr>
<tr>
<td valign="top">amount</td>
<td valign="top">Amount of content to pull, can be a maximum of 1000</td>
</tr>
</table>
<p>The output will be a json array containing a boolean value of 'success', the total results for that type of media, and a sub-array containing the actual results of the query. You can adjust the number of displayed videos by using the "amount" parameter, and paginate the results by using the "offset" parameter.</p>
<h3>» media.search</h3>
<p>This endpoint allows you to run search queries on the website.<br />
Sample Request: <? echo $basehttp; ?>/api/?output=json&command=media.search&q=SEARCH_STRING&type=videos&offset=0&amount=10<br />
<br />
The endpoint accepts the following parameters:</p>
<table width="500" border="1" cellspacing="0" cellpadding="5">
<tr>
<td valign="top">output</td>
<td valign="top">Must be set to "json". Currently, this is the only available output format.</td>
</tr>
<tr>
<td width="104" valign="top">command</td>
<td width="396" valign="top">Must be set to "media.search"</td>
</tr>
<tr>
<td valign="top">type</td>
<td valign="top">The type of media to display. Must be "videos" or "galleries".</td>
</tr>
<tr>
<td valign="top">q</td>
<td valign="top">The search string query. Must be at least 3 characters long.</td>
</tr>
<tr>
<td valign="top">offset</td>
<td valign="top">Number of media to offset the results by</td>
</tr>
<tr>
<td valign="top">amount</td>
<td valign="top">Amount of content to pull, can be a maximum of 1000</td>
</tr>
</table>
<p>The output will be a json array containing a boolean value of 'success', the total results for your query for that type of media, and a sub-array containing the actual results of the query. You can adjust the number of displayed videos by using the "amount" parameter, and paginate the results by using the "offset" parameter.</p>
<h3>» media.data</h3>
<p>This end point lets you fetch information about a specific video..<br />
Sample Request: <? echo $basehttp; ?>/api/?output=json&command=media.data&id=NUMERIC_MEDIA_ID<br />
<br />
The endpoint accepts the following parameters:</p>
<table width="500" border="1" cellspacing="0" cellpadding="5">
<tr>
<td valign="top">output</td>
<td valign="top">Must be set to "json". Currently, this is the only available output format.</td>
</tr>
<tr>
<td width="104" valign="top">command</td>
<td width="396" valign="top">Must be set to "media.data"</td>
</tr>
<tr>
<td valign="top">id</td>
<td valign="top">Numeric ID of a video</td>
</tr>
</table>
<p>The output will be a json array containing a boolean value of 'success', and a sub-array containing the actual results of the query.</p>
<?
getTemplate('template.overall_footer.php');
exit();
?>