PHPackages                             sokolnikov911/cloudflare-abuse-reports - 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. sokolnikov911/cloudflare-abuse-reports

ActiveLibrary[API Development](/categories/api)

sokolnikov911/cloudflare-abuse-reports
======================================

PHP client for the Cloudflare Abuse Reports API

v1.0.3(1mo ago)156↑118.2%MITPHPPHP ^8.1

Since May 7Pushed 1mo agoCompare

[ Source](https://github.com/sokolnikov911/cloudflare-abuse-reports)[ Packagist](https://packagist.org/packages/sokolnikov911/cloudflare-abuse-reports)[ RSS](/packages/sokolnikov911-cloudflare-abuse-reports/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

Cloudflare Abuse Reports API Client
===================================

[](#cloudflare-abuse-reports-api-client)

PHP client for the [Cloudflare Abuse Reports API](https://developers.cloudflare.com/api/resources/abuse_reports).

[![Latest Stable Version](https://camo.githubusercontent.com/9d1a1a9f5e3752da13eb3c277db2aaf7bb2735e6c594e0010a9f117f4d245b15/68747470733a2f2f706f7365722e707567782e6f72672f736f6b6f6c6e696b6f763931312f636c6f7564666c6172652d61627573652d7265706f7274732f762f737461626c65)](https://packagist.org/packages/sokolnikov911/cloudflare-abuse-reports) [![Total Downloads](https://camo.githubusercontent.com/4ef49e1e5dd712a8936025d128ee73ca0ceefea300a9485dd6c72910dd751442/68747470733a2f2f706f7365722e707567782e6f72672f736f6b6f6c6e696b6f763931312f636c6f7564666c6172652d61627573652d7265706f7274732f646f776e6c6f616473)](https://packagist.org/packages/sokolnikov911/cloudflare-abuse-reports) [![Latest Unstable Version](https://camo.githubusercontent.com/5c61f69487fee10db60af4d30befc7250b05d84922efec134497f997632bf83e/68747470733a2f2f706f7365722e707567782e6f72672f736f6b6f6c6e696b6f763931312f636c6f7564666c6172652d61627573652d7265706f7274732f762f756e737461626c65)](https://packagist.org/packages/sokolnikov911/cloudflare-abuse-reports) [![composer.lock](https://camo.githubusercontent.com/017263fb6ff1e3e2c2a4b25202e6c623af63bdd9d06411d4fb6297cf54bee71a/68747470733a2f2f706f7365722e707567782e6f72672f736f6b6f6c6e696b6f763931312f636c6f7564666c6172652d61627573652d7265706f7274732f636f6d706f7365726c6f636b)](https://packagist.org/packages/sokolnikov911/cloudflare-abuse-reports) [![StandWithUkraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)Scrutinizer CI[![Build Status](https://camo.githubusercontent.com/821a89f33c497ec62d4e8d2128cf57cc2f044f5387c10de7d1da260770655835/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736f6b6f6c6e696b6f763931312f636c6f7564666c6172652d61627573652d7265706f7274732f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/sokolnikov911/cloudflare-abuse-reports/build-status/master) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/43f3e7f4acf04f591fbf770878970c0fe6d5e87fe08fd7a9ae2b6e23fbc3a3bc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736f6b6f6c6e696b6f763931312f636c6f7564666c6172652d61627573652d7265706f7274732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/sokolnikov911/cloudflare-abuse-reports/?branch=master) [![Code Coverage](https://camo.githubusercontent.com/be6c9a5ac9185a50aaabefbabfe14cdd81cbc7542bb73785e3dcedf717307bbf/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736f6b6f6c6e696b6f763931312f636c6f7564666c6172652d61627573652d7265706f7274732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/sokolnikov911/cloudflare-abuse-reports/?branch=master)Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- `ext-curl`
- `ext-json`

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

[](#installation)

```
composer require sokolnikov911/cloudflare-abuse-reports
```

Usage
-----

[](#usage)

### Setup

[](#setup)

```
use CloudflareAbuse\AbuseReportClient;

$client = new AbuseReportClient('your-cloudflare-api-token');
```

To customize the request timeout, pass your own transport:

```
use CloudflareAbuse\AbuseReportClient;
use CloudflareAbuse\HttpTransport\CurlHttpTransport;

$client = new AbuseReportClient('your-api-token', new CurlHttpTransport(timeout: 60));
```

---

### Submit a report

[](#submit-a-report)

Each report type has its own request class. All share common fields (`email`, `name`, `urls`) and add type-specific ones.

#### Phishing

[](#phishing)

```
use CloudflareAbuse\Request\PhishingReportRequest;

$response = $client->submitReport('account-id', new PhishingReportRequest(
    email: 'reporter@example.com',
    name: 'Jane Doe',
    urls: "https://evil.example.com/login\nhttps://evil.example.com/steal",
    justification: 'This page impersonates a bank login form.',
));

echo $response->abuseRand; // report identifier
```

#### DMCA

[](#dmca)

```
use CloudflareAbuse\Request\DmcaReportRequest;

$response = $client->submitReport('account-id', new DmcaReportRequest(
    email: 'rights@example.com',
    name: 'John Copyright',
    urls: 'https://infringing.example.com/stolen-content',
    originalWork: 'https://original.example.com/my-work',
    address1: '123 Main St',
    city: 'New York',
    state: 'NY',
    country: 'US',
));
```

> `signature`, `agree`, and notification fields are set automatically per DMCA requirements.

#### Trademark

[](#trademark)

```
use CloudflareAbuse\Request\TrademarkReportRequest;

$response = $client->submitReport('account-id', new TrademarkReportRequest(
    email: 'legal@example.com',
    name: 'Legal Team',
    urls: 'https://infringing.example.com',
    trademarkNumber: 'TM12345',
    trademarkOffice: 'USPTO',
    trademarkSymbol: 'ACME',
    justification: 'Unauthorized use of our registered trademark.',
));
```

#### General abuse

[](#general-abuse)

```
use CloudflareAbuse\Request\GeneralReportRequest;

$response = $client->submitReport('account-id', new GeneralReportRequest(
    email: 'security@example.com',
    name: 'Security Team',
    urls: 'https://malicious.example.com',
    justification: 'C2 server distributing malware.',
    destinationIps: '203.0.113.42',
    portsProtocols: '443/TCP',
    sourceIps: '198.51.100.1',
));
```

#### Other report types

[](#other-report-types)

Class`act` value`ThreatReportRequest``abuse_threat``ChildrenReportRequest``abuse_children``RegistrarWhoisReportRequest``abuse_registrar_whois``NcseiReportRequest``abuse_ncsei`All constructors follow the same pattern: required fields first, then optional ones with defaults.

#### Notification options

[](#notification-options)

For report types that support it, use `NotificationOption` to control whether the host and site owner are notified:

```
use CloudflareAbuse\Enum\NotificationOption;
use CloudflareAbuse\Request\ThreatReportRequest;

new ThreatReportRequest(
    email: 'a@b.com',
    name: 'Alice',
    urls: 'https://threat.example.com',
    hostNotification: NotificationOption::SendAnon,
    ownerNotification: NotificationOption::None,
);
```

Available values: `Send`, `SendAnon`, `None`.

---

### Get a report

[](#get-a-report)

```
$report = $client->getReport('account-id', 'report-id');

echo $report->id;
echo $report->domain;
echo $report->status; // "accepted" or "in_review"
echo $report->type;
echo $report->cdate;  // RFC 3339
```

---

### List reports

[](#list-reports)

```
use CloudflareAbuse\ListReportsParams;
use CloudflareAbuse\Enum\ReportStatus;
use CloudflareAbuse\Enum\ReportType;

$page = $client->listReports('account-id', new ListReportsParams(
    status: ReportStatus::InReview,
    type: ReportType::Phishing,
    domain: 'evil.example.com',
    perPage: 20,
    page: 1,
));

echo $page->totalCount;

foreach ($page->items as $report) {
    echo "{$report->id}: {$report->domain} ({$report->status})\n";
}
```

All `ListReportsParams` fields are optional. Omit the second argument to fetch with no filters.

---

### List mitigations

[](#list-mitigations)

```
$mitigations = $client->listMitigations('account-id', 'report-id');

foreach ($mitigations as $m) {
    echo "{$m->id}: {$m->type} — {$m->status}\n";
}
```

---

### Appeal a mitigation

[](#appeal-a-mitigation)

```
$client->appealMitigations('account-id', 'report-id', 'This content is not infringing.');
```

---

### Error handling

[](#error-handling)

All methods throw `CloudflareAbuse\Exception\ApiException` on failure:

```
use CloudflareAbuse\Exception\ApiException;

try {
    $report = $client->getReport('account-id', 'unknown-id');
} catch (ApiException $e) {
    echo $e->getMessage();    // Cloudflare error message
    echo $e->getStatusCode(); // HTTP status code
    print_r($e->getErrors()); // raw Cloudflare errors array
}
```

License
-------

[](#license)

MIT

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance94

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

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

Total

2

Last Release

31d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/97a1cefec9fcbf213bb9a2db1f26e21b6ccb750984727256dd9833c5b27f25ae?d=identicon)[sokolnikov911](/maintainers/sokolnikov911)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sokolnikov911-cloudflare-abuse-reports/health.svg)

```
[![Health](https://phpackages.com/badges/sokolnikov911-cloudflare-abuse-reports/health.svg)](https://phpackages.com/packages/sokolnikov911-cloudflare-abuse-reports)
```

###  Alternatives

[facebook/php-business-sdk

PHP SDK for Facebook Business

90923.5M35](/packages/facebook-php-business-sdk)[exsyst/swagger

A php library to manipulate Swagger specifications

35916.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[botman/driver-telegram

Telegram driver for BotMan

93452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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