PHPackages                             osd/ip-check-spam - 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. osd/ip-check-spam

ActiveLibrary[Security](/categories/security)

osd/ip-check-spam
=================

Qualify if an IP is listed as spam using AI

1.0.0(5mo ago)0341MITPHP

Since Jan 14Pushed 5mo agoCompare

[ Source](https://github.com/oscarvha/ip-check-spam)[ Packagist](https://packagist.org/packages/osd/ip-check-spam)[ RSS](/packages/osd-ip-check-spam/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (2)Used By (1)

osd/ip-check-spam
=================

[](#osdip-check-spam)

Qualify whether an IP address is likely to be spam or abusive using AI-based analysis.

This package is **framework-agnostic**, designed to be used in any PHP project (Laravel, Symfony, legacy PHP, etc.) and follows a clean, DDD-inspired architecture.

It currently uses **Groq AI (GPT models)** to analyze IP metadata and return a structured spam risk assessment.

---

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require osd/ip-check-spam
```

Features
--------

[](#features)

- AI-based IP spam risk analysis
- Residential vs datacenter classification
- Deterministic, structured output
- No framework dependencies
- No environment configuration required
- Explicit configuration via value objects
- Designed for clean integration into larger systems

---

Requirements
------------

[](#requirements)

- PHP ^8.1
- ext-curl
- A valid **Groq API key**

---

Installation
------------

[](#installation-1)

```
composer require osd/ip-check-spam
```

Basic Usage
-----------

[](#basic-usage)

```
use Osd\IpCheckSpam\Bootstrap\IpCheckSpamFactory;
use Osd\IpCheckSpam\Domain\DTO\IpSpamInput;
use Osd\IpCheckSpam\Application\Config\IpSpamConfig;

// Build the input from your own IP/domain model
$input = new IpSpamInput(
    ip: 'IP_ADDRESS',
    asn: 12345,
    isp: 'ISP_NAME',
    organization: 'ORGANIZATION_NAME',
    country: 'COUNTRY_CODE',
    city: 'CITY_NAME',
    cidr: 'CIDR_RANGE'
);

// Explicit configuration (no env dependency)
$config = new IpSpamConfig(
    apiKey: 'YOUR_GROQ_API_KEY'
);

// Create analyzer
$analyze = IpCheckSpamFactory::create($config);

// Execute analysis
$assessment = $analyze->execute($input);

// Access results
$assessment->spamScore();
$assessment->confidence();
$assessment->type();
$assessment->explanation();
$assessment->explanationEs();
```

Output Model
------------

[](#output-model)

The analysis result is returned as an `IpSpamAssessment` value object.

FieldTypeDescriptionspamScorefloatSpam likelihood (0.0 – 1.0)confidencestringlow, medium, hightypestringuser or datacenterexplanationstringTechnical explanation (EN)explanationEsstringTechnical explanation (ES)Architecture Overview
---------------------

[](#architecture-overview)

This package follows a clean, framework-agnostic architecture inspired by DDD (Domain-Driven Design) and Hexagonal Architecture.

### Layers

[](#layers)

- **Domain**

    - Pure business concepts
    - Immutable value objects (`IpSpamAssessment`)
    - DTOs (`IpSpamInput`)
    - Contracts (interfaces)
- **Application**

    - Use cases (`AnalyzeIpSpamRisk`)
    - Configuration objects (`IpSpamConfig`)
    - Orchestrates the analysis flow
- **Infrastructure**

    - External AI integration (Groq / GPT models)
    - HTTP clients
    - Prompt builders
    - Response mappers
- **Bootstrap**

    - Factory for assembling default implementations
    - No dependency on frameworks or containers

### Key Principles

[](#key-principles)

- No framework dependency (Laravel / Symfony / etc.)
- No environment coupling (`.env` is not required)
- Explicit configuration via objects
- Immutable domain models
- Easy to replace AI providers or models
- Designed for reuse across multiple projects

This makes the package suitable for:

- Legacy PHP applications
- Modern PHP projects
- Microservices
- CLI tools
- Portfolio-grade architecture examples

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance72

Regular maintenance activity

Popularity7

Limited adoption so far

Community8

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

Unknown

Total

1

Last Release

161d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/17102fc93a11c8c715e0bed8eea2f703d9fd0145b1d7b6ab4e608976737a0818?d=identicon)[oscarvha](/maintainers/oscarvha)

---

Top Contributors

[![oscarvha](https://avatars.githubusercontent.com/u/5433991?v=4)](https://github.com/oscarvha "oscarvha (3 commits)")

### Embed Badge

![Health badge](/badges/osd-ip-check-spam/health.svg)

```
[![Health](https://phpackages.com/badges/osd-ip-check-spam/health.svg)](https://phpackages.com/packages/osd-ip-check-spam)
```

###  Alternatives

[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k18.0M134](/packages/mews-purifier)[paragonie/ecc

PHP Elliptic Curve Cryptography library

24772.0k35](/packages/paragonie-ecc)

PHPackages © 2026

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