PHPackages                             lsmonki/php-open-calais - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. lsmonki/php-open-calais

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

lsmonki/php-open-calais
=======================

A PHP class for extracting entities and social tags from documents with the OpenCalais API http://www.opencalais.com/

2.2(5y ago)312.2k2[1 PRs](https://github.com/lsmonki/PHP-OpenCalais/pulls)2MITPHPPHP &gt;=5.3.0

Since Dec 28Pushed 5y ago1 watchersCompare

[ Source](https://github.com/lsmonki/PHP-OpenCalais)[ Packagist](https://packagist.org/packages/lsmonki/php-open-calais)[ Docs](http://www.dangrossman.info/)[ RSS](/packages/lsmonki-php-open-calais/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (2)

Open Calais Tags
================

[](#open-calais-tags)

Open Calais Tags is a PHP class for extracting entities and tags from text using [Open Calais](http://www.opencalais.com). Calais performs semantic analysis of the text, using natural language processing to identify concepts like people, companies and technologies discussed in the text. These are especially useful for suggesting tags for your content such as website articles or blog posts. You could even automatically tag archived content that would take days to go through manually.

Calais is free for both personal and commercial use, and usage of this class requires a Calais API key. Getting an API key is an easy, automated process. Just click the "Request API Key" link at the top of their site.

Install via composer
--------------------

[](#install-via-composer)

Edit your composer.json file to include the following:

```
{
    "require": {
        "lsmonki/php-open-calais": "2.x"
    }
}
```

Usage
-----

[](#usage)

Basic usage is simple. Create an instance of the class with your API key, and call the getEntities method using your content string.

```
$oc = new \OpenCalais\OpenCalais('your-api-key');
$entities = $oc->getEntities($content);

```

### Example input

[](#example-input)

> April 7 (Bloomberg) . Yahoo! Inc., the Internet company that snubbed a $44.6 billion takeover bid from Microsoft Corp., may drop in Nasdaq trading after the software maker threatened to cut its bid if directors fail to give in soon. If Yahoo.s directors refuse to negotiate a deal within three weeks, Microsoft plans to nominate a board slate and take its case to investors, Chief Executive Officer Steve Ballmer said April 5 in a statement. He suggested the deal.s value might decline if Microsoft has to take those steps. The ultimatum may send Yahoo Chief Executive Officer Jerry Yang scrambling to find an appealing alternative for investors to avoid succumbing to Microsoft, whose bid was a 62 percent premium to Yahoo.s stock price at the time. The deadline shows Microsoft is in a hurry to take on Google Inc., which dominates in Internet search, said analysts including Canaccord Adams.s Colin Gillis.

### Example output

[](#example-output)

```
Array
(
    [topics] => Array
        (
            [0] => Business_Finance
            [1] => Technology_Internet
        )

    [socialTag] => Array
        (
            [0] => Alibaba Group
            [1] => World Wide Web
            [2] => Yahoo!
            [3] => Steve Ballmer
            [4] => Microsoft
            [5] => Ballmer
            [6] => Jerry Yang
            [7] => Canaccord Genuity
        )

    [entities] => Array
        (
            [IndustryTerm] => Array
                (
                    [0] => software maker
                    [1] => Internet search
                    [2] => Internet
                )

            [Company] => Array
                (
                    [0] => Canaccord Adams
                    [1] => Yahoo
                    [2] => Google Inc.
                    [3] => Yahoo! Inc.
                    [4] => Microsoft Corp.
                )

            [Person] => Array
                (
                    [0] => Colin Gillis
                    [1] => Steve Ballmer
                    [2] => Jerry Yang
                )

            [Position] => Array
                (
                    [0] => Chief Executive Officer
                )

        )

)

```

Optional Settings
-----------------

[](#optional-settings)

A number of settings exist which can be changed through public properties of the OpenCalais object: `contentType` (default: text/html), `outputFormat` (default: application/json). Refer to the OpenCalais documentation for more information.

This code is distributed under the MIT license. See

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 52.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~902 days

Total

3

Last Release

1990d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/01a49534a28c71cebc3745f727ebef8639d7c3df08135bdc7836808d199e100a?d=identicon)[lsmonki](/maintainers/lsmonki)

---

Top Contributors

[![dangrossman](https://avatars.githubusercontent.com/u/407706?v=4)](https://github.com/dangrossman "dangrossman (12 commits)")[![lsmonki](https://avatars.githubusercontent.com/u/1839992?v=4)](https://github.com/lsmonki "lsmonki (10 commits)")[![CipHuK](https://avatars.githubusercontent.com/u/2241839?v=4)](https://github.com/CipHuK "CipHuK (1 commits)")

---

Tags

metadatasemanticopencalaisopen calaissemantic analysissemantic data

### Embed Badge

![Health badge](/badges/lsmonki-php-open-calais/health.svg)

```
[![Health](https://phpackages.com/badges/lsmonki-php-open-calais/health.svg)](https://phpackages.com/packages/lsmonki-php-open-calais)
```

###  Alternatives

[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)[mck89/peast

Peast is PHP library that generates AST for JavaScript code

18934.7M29](/packages/mck89-peast)[mf2/mf2

A pure, generic microformats2 parser — makes HTML as easy to consume as a JSON API

200296.9k33](/packages/mf2-mf2)[ivopetkov/html5-dom-document-php

HTML5 DOMDocument PHP library (extends DOMDocument)

6031.4M49](/packages/ivopetkov-html5-dom-document-php)[ergebnis/json

Provides a Json value object for representing a valid JSON string.

2521.7M8](/packages/ergebnis-json)[ergebnis/json-pointer

Provides an abstraction of a JSON pointer.

2021.8M6](/packages/ergebnis-json-pointer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
