|
| 1 | + |
| 2 | + |
| 3 | +# Content Profanity Detector API for PHP |
| 4 | + |
| 5 | +## 📝 Detect profanities in text using AI - identifies inappropriate language |
| 6 | + |
| 7 | +[](https://packagist.org/packages/sharpapi/php-content-profanity-detector) |
| 8 | +[](https://packagist.org/packages/sharpapi/php-content-profanity-detector) |
| 9 | + |
| 10 | +Check the full documentation on the [Content Profanity Detector API for PHP API](https://sharpapi.com/en/catalog/ai/content-marketing-automation/profanity-detector) page. |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +## Quick Links |
| 15 | + |
| 16 | +| Resource | Link | |
| 17 | +|----------|------| |
| 18 | +| **Main API Documentation** | [Authorization, Webhooks, Polling & More](https://sharpapi.com/documentation) | |
| 19 | +| **Product Details** | [SharpAPI.com](https://sharpapi.com/en/catalog/ai/content-marketing-automation/profanity-detector) | |
| 20 | +| **SDK Libraries** | [GitHub - SharpAPI SDKs](https://github.com/sharpapi) | |
| 21 | + |
| 22 | +--- |
| 23 | + |
| 24 | +## Requirements |
| 25 | + |
| 26 | +- PHP >= 8.0 |
| 27 | + |
| 28 | +--- |
| 29 | + |
| 30 | +## Installation |
| 31 | + |
| 32 | +### Step 1. Install the package via Composer: |
| 33 | + |
| 34 | +```bash |
| 35 | +composer require sharpapi/php-content-profanity-detector |
| 36 | +``` |
| 37 | + |
| 38 | +### Step 2. Visit [SharpAPI](https://sharpapi.com/) to get your API key. |
| 39 | + |
| 40 | +--- |
| 41 | +## Laravel Integration |
| 42 | + |
| 43 | +Building a Laravel application? Check the Laravel package version for better integration. |
| 44 | + |
| 45 | +--- |
| 46 | + |
| 47 | +## What it does |
| 48 | + |
| 49 | +Detect profanities in text using AI - identifies inappropriate language |
| 50 | + |
| 51 | +--- |
| 52 | + |
| 53 | +## Usage |
| 54 | +```php |
| 55 | +<?php |
| 56 | + |
| 57 | +require __DIR__ . '/vendor/autoload.php'; |
| 58 | + |
| 59 | +use SharpAPI\ContentProfanity\ProfanityDetectorClient; |
| 60 | +use GuzzleHttp\Exception\GuzzleException; |
| 61 | + |
| 62 | +$apiKey = 'your_api_key_here'; |
| 63 | +$client = new ProfanityDetectorClient(apiKey: $apiKey); |
| 64 | + |
| 65 | +try { |
| 66 | + $statusUrl = $client->detectProfanities( |
| 67 | + content: 'Your text content here' |
| 68 | + ); |
| 69 | + |
| 70 | + // Optional: Configure polling |
| 71 | + $client->setApiJobStatusPollingInterval(10); |
| 72 | + $client->setApiJobStatusPollingWait(180); |
| 73 | + |
| 74 | + // Fetch results (polls automatically) |
| 75 | + $result = $client->fetchResults($statusUrl); |
| 76 | + $resultData = $result->getResultJson(); |
| 77 | + |
| 78 | + echo $resultData; |
| 79 | +} catch (GuzzleException $e) { |
| 80 | + echo "API error: " . $e->getMessage(); |
| 81 | +} |
| 82 | +``` |
| 83 | + |
| 84 | +--- |
| 85 | + |
| 86 | +## Example Response |
| 87 | +```json |
| 88 | + |
| 89 | +{ |
| 90 | + "data": { |
| 91 | + "type": "api_job_result", |
| 92 | + "id": "06f4a1ba-b6b1-48b3-b071-807e3d41db4d", |
| 93 | + "attributes": { |
| 94 | + "status": "success", |
| 95 | + "type": "content_detect_profanities", |
| 96 | + "result": [] |
| 97 | + } |
| 98 | + } |
| 99 | +} |
| 100 | + |
| 101 | +``` |
| 102 | +--- |
| 103 | + |
| 104 | +## Changelog |
| 105 | + |
| 106 | +Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. |
| 107 | + |
| 108 | +--- |
| 109 | + |
| 110 | +## Credits |
| 111 | + |
| 112 | +- [A2Z WEB LTD](https://github.com/a2zwebltd) |
| 113 | +- [Dawid Makowski](https://github.com/makowskid) |
| 114 | +- Boost your [PHP AI](https://sharpapi.com/) capabilities! |
| 115 | + |
| 116 | +--- |
| 117 | + |
| 118 | +## License |
| 119 | + |
| 120 | +[](LICENSE.md) |
| 121 | + |
| 122 | +The MIT License (MIT). Please see [License File](LICENSE.md) for more information. |
| 123 | + |
| 124 | +--- |
| 125 | + |
| 126 | +## Social Media |
| 127 | + |
| 128 | +🚀 For the latest news, tutorials, and case studies, don't forget to follow us on: |
| 129 | +- [SharpAPI X (formerly Twitter)](https://x.com/SharpAPI) |
| 130 | +- [SharpAPI YouTube](https://www.youtube.com/@SharpAPI) |
| 131 | +- [SharpAPI Vimeo](https://vimeo.com/SharpAPI) |
| 132 | +- [SharpAPI LinkedIn](https://www.linkedin.com/products/a2z-web-ltd-sharpapicom-automate-with-aipowered-api/) |
| 133 | +- [SharpAPI Facebook](https://www.facebook.com/profile.php?id=61554115896974) |
0 commit comments