PHPackages                             sleiman/addcontext-php - 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. [API Development](/categories/api)
4. /
5. sleiman/addcontext-php

ActiveLibrary[API Development](/categories/api)

sleiman/addcontext-php
======================

PHP wrapper to connect with AddContext.io API and save context snapshots based on events/actions

1.1.2(8y ago)010MITPHPPHP ^5.3.3 || ^7.0

Since Apr 14Pushed 7y ago1 watchersCompare

[ Source](https://github.com/sleiman/addcontext-php)[ Packagist](https://packagist.org/packages/sleiman/addcontext-php)[ Docs](https://github.com/sleiman/addcontext-php)[ RSS](/packages/sleiman-addcontext-php/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (5)DependenciesVersions (6)Used By (0)

AddContext PHP Wrapper
======================

[](#addcontext-php-wrapper)

A PHP wrapper for the [AddContext API](https://addcontext.io/). Feedback or bug reports are appreciated.

Get started
-----------

[](#get-started)

### Installation

[](#installation)

If you're using Composer, you can run the following command:

```
composer require sleiman/addcontext-php

```

You can also download them directly and extract them to your web directory.

### Add the wrapper to your project

[](#add-the-wrapper-to-your-project)

If you're using Composer, run the autoloader

```
require 'vendor/autoload.php';
```

Or include the Addcontext.php file

```
include('../src/Addcontext.php');
```

### Initialize the class

[](#initialize-the-class)

```
use \TANIOS\Addcontext\Addcontext;
$addcontext = new Addcontext(array(
    'access_token' => 'ACCESS_TOKEN',
));
```

### Create new snapshot request

[](#create-new-snapshot-request)

We want to create a new entry in the system via the API

// Add any metadata you want to associate to that snapshopt to an array

```
$metadata['text_main_entity']   = 'russia';
$metadata['sent_from']   = 'iphone';
$metadata['tweet_id'] = '123213213';
$metadata['tweet_content']    = 'messsage text';

// Add all the information you have to an array (email, datetime and rule are mandatory)
// Add the metada array to the fields array

$fields = array(
    'email' => "someletters@youcanread.com",
    'datetime'=> "2018-03-01 19:08:00",
    'rule' => 'trump tweeted',
    'metadata'=> $metadata
);

// Create the snapshot
$new_snapshot = $addcontext->createSnapshotRequest($fields);
```

Credits
-------

[](#credits)

Copyright (c) 2018 - Programmed by Sleiman Tanios

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

5

Last Release

2953d ago

PHP version history (3 changes)1.0.1PHP ^5.3.3 || ^7.2

1.0.9PHP ^5.3.3

1.1.1PHP ^5.3.3 || ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/cb61b33113f2f2e419bdfff883646aafefecb165498989a9c710c61f60b90caf?d=identicon)[sleiman](/maintainers/sleiman)

---

Top Contributors

[![sleiman](https://avatars.githubusercontent.com/u/1677407?v=4)](https://github.com/sleiman "sleiman (14 commits)")

---

Tags

contextdataphpapidataContextmarketingmachine learningdata science

### Embed Badge

![Health badge](/badges/sleiman-addcontext-php/health.svg)

```
[![Health](https://phpackages.com/badges/sleiman-addcontext-php/health.svg)](https://phpackages.com/packages/sleiman-addcontext-php)
```

###  Alternatives

[deepseek-php/deepseek-php-client

deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.

47073.9k5](/packages/deepseek-php-deepseek-php-client)[nlpcloud/nlpcloud-client

NLP Cloud serves high performance pre-trained or custom models for NER, sentiment-analysis, classification, summarization, paraphrasing, grammar and spelling correction, keywords and keyphrases extraction, chatbot, product description and ad generation, intent classification, text generation, image generation, code generation, question answering, automatic speech recognition, machine translation, language detection, semantic search, semantic similarity, tokenization, POS tagging, speech synthesis, embeddings, and dependency parsing. It is ready for production, served through a REST API. This is the PHP client for the API. More details here: https://nlpcloud.com. Documentation: https://docs.nlpcloud.com. Github: https://github.com/nlpcloud/nlpcloud-php

2523.9k](/packages/nlpcloud-nlpcloud-client)[qwen-php/qwen-php-client

robust and community-driven PHP SDK library for seamless integration with the qwen AI API, offering efficient access to advanced AI and data processing capabilities

213.2k1](/packages/qwen-php-qwen-php-client)

PHPackages © 2026

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