Open Calais API & examples – PHP

Open Calais is a rapidly growing toolkit of capabilities that allow you to readily incorporate state-of-the-art semantic functionality within your blog & provide more or less same functionality as what zemanta guys do.

Open calais use NLP to manipulate user’s queries. They are giving API access to multiple languages. Here i can explain the samples with php.

Live URL :


<form name=”calais” action=”octest.php” method=”post”>

URL : <input type=”text” name=”url” value=”” /> <input type=”submit” name=”submit” value=”Get Tags!” />



$apikey = “XXXXXXXXXX”;

$oc = new OpenCalais($apikey);

$content = file_get_contents($_REQUEST[“url”]);

//echo $content;

$entities = $oc->getEntities($content);

foreach ($entities as $type => $values) {

echo “<b>” . $type . “</b>”;
echo “<ul>”;

foreach ($values as $entity) {
echo “<li>” . $entity . “</li>”;

echo “</ul>”;


All the best :)