PHPackages                             linkshieldai/linkshieldai - 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. [Security](/categories/security)
4. /
5. linkshieldai/linkshieldai

ActiveLibrary[Security](/categories/security)

linkshieldai/linkshieldai
=========================

PHP SDK for the LinkShieldAI URL safety API.

v0.1.2(1mo ago)06MITPHPPHP &gt;=8.1

Since May 31Pushed 1mo agoCompare

[ Source](https://github.com/LinkShieldAI/LinkShieldAI-PHP-SDK)[ Packagist](https://packagist.org/packages/linkshieldai/linkshieldai)[ RSS](/packages/linkshieldai-linkshieldai/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

LinkShieldAI PHP SDK
====================

[](#linkshieldai-php-sdk)

New integrations should use `$client->scan($url, $mode)`, which calls Bearer-authenticated `POST /v1/scan`. Existing methods remain for compatibility.

```
$client = new \LinkShieldAI\Client(); // Reads LINKSHIELDAI_API_KEY.
$result = $client->scan('https://example.com', 'standard');
echo $result['verdict'] . ' ' . $result['request_id'];
```

`UNKNOWN` means the API found no decisive signal. Do not treat it as `SAFE`.

PHP SDK for the LinkShieldAI API at `https://api.linkshieldai.com`.

The SDK supports basic URL safety checks, detailed checks with screenshot URL and detected tag, screenshot download, NSFW site checks, Chimera AI classification, retry/backoff for transient API failures, and a small command-line tool.

Install
-------

[](#install)

```
composer require linkshieldai/linkshieldai
```

Authentication
--------------

[](#authentication)

Every SDK request sends the key as an `Authorization: Bearer` header. Legacy endpoints receive only the URL as a query parameter.

```
use LinkShieldAI\Client;

$client = new Client(apiKey: 'YOUR_API_KEY');
```

Or set `LINKSHIELDAI_API_KEY` and omit `apiKey`.

Usage
-----

[](#usage)

```
$basic = $client->basicCheck('https://example.com');
echo $basic->result;
var_dump($basic->isMalicious);

$detailed = $client->detailedCheck('https://example.com');
echo $detailed->screenshotUrl;
echo $detailed->tag;

$nsfw = $client->nsfwCheck('https://example.com');
var_dump($nsfw->isNsfw);

$chimera = $client->chimera('https://google.com');
echo $chimera->result;
echo $chimera->probability;
```

The API field `"screenshot url"` is normalized to `$result->screenshotUrl`.

Screenshot Download
-------------------

[](#screenshot-download)

SDK screenshot downloads also use Bearer authentication. Existing direct screenshot URLs remain compatible.

```
$imageBytes = $client->getScreenshot('05046f.png');
$client->getScreenshot('https://api.linkshieldai.com/screenshot/05046f.png', 'site.png');
```

Options
-------

[](#options)

```
$client = new Client(
    apiKey: 'YOUR_API_KEY',
    baseUrl: 'https://api.linkshieldai.com',
    timeout: 15.0,
    maxRetries: 3,
    backoffFactor: 1.0,
);
```

By default the SDK uses `timeout: 10.0`, `maxRetries: 2`, and `backoffFactor: 0.5`.

Retries are applied to temporary connection failures and HTTP `429`, `502`, `503`, and `504`.

CLI
---

[](#cli)

```
vendor/bin/linkshieldai --api-key YOUR_API_KEY scan https://example.com --mode standard
vendor/bin/linkshieldai --api-key YOUR_API_KEY scan https://example.com --mode detailed
vendor/bin/linkshieldai --api-key YOUR_API_KEY scan https://example.com --mode deep
vendor/bin/linkshieldai --api-key YOUR_API_KEY basic https://example.com
vendor/bin/linkshieldai --api-key YOUR_API_KEY detailed https://example.com
vendor/bin/linkshieldai --api-key YOUR_API_KEY nsfw https://example.com
vendor/bin/linkshieldai --api-key YOUR_API_KEY chimera https://google.com
vendor/bin/linkshieldai --api-key YOUR_API_KEY screenshot 05046f.png --output site.png
```

You can omit `--api-key` if `LINKSHIELDAI_API_KEY` is set.

Errors
------

[](#errors)

```
use LinkShieldAI\Exception\ApiConnectionException;
use LinkShieldAI\Exception\ApiResponseException;
use LinkShieldAI\Exception\ApiStatusException;
use LinkShieldAI\Exception\AuthenticationException;
use LinkShieldAI\Exception\RateLimitException;
```

Raw API payloads are preserved on result objects through `$result->raw`.

Keep API keys server-side. Do not expose them in browser JavaScript.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance94

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

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

Total

3

Last Release

32d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/151997688?v=4)[LinkShieldAI](/maintainers/linkshieldai)[@LinkShieldAI](https://github.com/LinkShieldAI)

---

Top Contributors

[![LinkShieldAI](https://avatars.githubusercontent.com/u/151997688?v=4)](https://github.com/LinkShieldAI "LinkShieldAI (5 commits)")

---

Tags

sdksecurityphishinglinkshieldaiurl-safety

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/linkshieldai-linkshieldai/health.svg)

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

###  Alternatives

[phpmussel/phpmussel

PHP-based anti-virus anti-trojan anti-malware solution.

429236.8k1](/packages/phpmussel-phpmussel)[perimeterx/php-sdk

PerimeterX SDK for PHP

1888.7k](/packages/perimeterx-php-sdk)[xxtea/xxtea

XXTEA is a fast and secure encryption algorithm. This is a XXTEA library for PHP.

11343.0k](/packages/xxtea-xxtea)[security-database/cvss

Common Vulnerability Scoring System Version 3.1

1018.1k](/packages/security-database-cvss)

PHPackages © 2026

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