PHPackages                             sightenginehard/client-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. sightenginehard/client-php

ActiveLibrary

sightenginehard/client-php
==========================

Sightengine PHP client

1.3(7y ago)03PHP

Since Jun 10Pushed 5y agoCompare

[ Source](https://github.com/luisalonsobr/client-php)[ Packagist](https://packagist.org/packages/sightenginehard/client-php)[ Docs](https://sightengine.com)[ RSS](/packages/sightenginehard-client-php/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (7)Used By (0)

 [ ![](https://camo.githubusercontent.com/466f2dbac7121b36d57acceda7957684949f6309da459cecdeb7e4123180f2e1/68747470733a2f2f7472617669732d63692e6f72672f5369676874656e67696e652f636c69656e742d7068702e7376673f6272616e63683d6d6173746572) ](https://travis-ci.org/Sightengine/client-php)About
=====

[](#about)

Use the Sightengine Moderation API to instantly moderate images and videos. See  for more information.

Before starting, please make sure you have created an account on

Install
=======

[](#install)

```
composer require sightengine/client-php
```

Initialize the client
=====================

[](#initialize-the-client)

You will need your API USER and API SECRET to initialize the client. You can find both of them on your Sightengine account.

```
use \Sightengine\SightengineClient;

$client = new SightengineClient('{api_user}', '{api_secret}');
```

Moderate an image
=================

[](#moderate-an-image)

The API accepts both standard still images: JPEG, PNG, WEBP etc. and multi-frame GIF images.

Several moderation engines are available for you to choose from (nudity detection, inappropriate content detection etc...). Please refer to the documentation for more.

Moderate an image through a public URL:
---------------------------------------

[](#moderate-an-image-through-a-public-url)

```
# Detect nudity in an image

$output = $client->check(['nudity'])->set_url('http://img09.deviantart.net/2bd0/i/2009/276/c/9/magic_forrest_wallpaper_by_goergen.jpg')

# Detect nudity, weapons, alcohol, drugs, likely fruadulant users, celebrities and faces in an image, along with image properties and type
$output = $client->check(['nudity', 'type', 'properties', 'wad', 'face', 'scam', 'celebrity'])->set_url('http://img09.deviantart.net/2bd0/i/2009/276/c/9/magic_forrest_wallpaper_by_goergen.jpg')
```

Moderate a local image:
-----------------------

[](#moderate-a-local-image)

```
# Detect nudity in an image
$output = $client->check(['nudity'])->set_file('/full/path/to/image.jpg')

# Detect nudity, weapons, alcohol, drugs and faces in an image, along with image properties and type
$output = $client->check(['nudity', 'type', 'properties', 'wad', 'face'])->set_file('/full/path/to/image.jpg')
```

Moderate a binary image:
------------------------

[](#moderate-a-binary-image)

```
# Detect nudity in an image
$output = $client->check(['nudity'])->set_bytes($binary_image)

# Detect nudity, weapons, alcohol, drugs and faces in an image, along with image properties and type
$output = $client->check(['nudity', 'type', 'properties', 'wad', 'face'])->set_bytes($binary_image)
```

Video and Stream Moderation
===========================

[](#video-and-stream-moderation)

You can perform either *synchronous* or *asynchronous* Video Moderation.

- Synchronous Moderation is simple and easy: the Moderation result is provided directly in the reponse to your API request. Synchronous Moderation is only available for videos that are less than 1 minute long.
- Asynchronous Moderation is available for any video or stream. Moderation results are provided through a so-called callback mechanism. You define a callback URL and the Moderation Engine will send back moderation events to that URL in realtime.

Synchronous Video Moderation
----------------------------

[](#synchronous-video-moderation)

Beware: this is only for videos that have a duration below 1 minute.

```
$client->check(['nudity', 'wad'])->video_sync('https://sightengine.com/assets/stream/examples/funfair.mp4')
```

Asynchronous Video Moderation
-----------------------------

[](#asynchronous-video-moderation)

The first step to moderate a video stream is to submit the video stream to the API, along with a callback URL.

```
$client->check(['nudity', 'wad'])->video('https://sightengine.com/assets/stream/examples/funfair.mp4', 'https://example.com/yourcallback')
```

Once you have submitted the video, the API will start POSTing moderation updates to your callback URL.

Please see our [Documentation](https://sightengine.com/docs) for more details.

Feedback
========

[](#feedback)

In order to report a misclassification, you need to report the image that was misclassified, the model that was run on this image (models are nudity, face, type, wad), and the correct class of the image.

For each model, there are different classes that you may report. Here are the details:

The nudity model has 3 classes:

- raw: corresponding to raw nudity
- partial: corresponding to partial nudity
- safe: corresponding to no nudity

The face model has 3 classes:

- none
- single
- multiple

The type model has 2 classes:

- photo
- illustration

The wad model has 3 classes:

- no-weapons
- weapons
- no-alcohol
- alcohol
- no-drugs
- drugs

```
$client->feedback(model, class,image)
```

Example of feedback on a local image:

```
$client->feedback("nudity","safe", "/full/path/to/image.jpg")
$client->feedback("type","illustration", "/full/path/to/image.jpg")
$client->feedback("nudity","raw", "/full/path/to/image.jpg")
```

Example of feedback through a public URL::

```
$client->feedback("nudity","safe", "http://img09.deviantart.net/2bd0/i/2009/276/c/9/magic_forrest_wallpaper_by_goergen.jpg")
$client->feedback("type","illustration", "http://img09.deviantart.net/2bd0/i/2009/276/c/9/magic_forrest_wallpaper_by_goergen.jpg")
$client->feedback("nudity","raw", "http://img09.deviantart.net/2bd0/i/2009/276/c/9/magic_forrest_wallpaper_by_goergen.jpg")
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~117 days

Total

4

Last Release

2903d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/26698413?v=4)[Wade W](/maintainers/spectral)[@spectral](https://github.com/spectral)

---

Top Contributors

[![luisalonsobr](https://avatars.githubusercontent.com/u/8870244?v=4)](https://github.com/luisalonsobr "luisalonsobr (3 commits)")[![davidlis](https://avatars.githubusercontent.com/u/3018387?v=4)](https://github.com/davidlis "davidlis (2 commits)")[![rlmckenney](https://avatars.githubusercontent.com/u/845794?v=4)](https://github.com/rlmckenney "rlmckenney (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sightenginehard-client-php/health.svg)

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

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k20](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)

PHPackages © 2026

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