noscrape / noscrape-laravel
Official Laravel package for protecting sensitive text from automated scraping using the Noscrape API.
Fund package maintenance!
Requires
- php: ^8.3
- illuminate/contracts: ^11.0||^12.0||^13.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.8
- orchestra/testbench: ^11.0.0||^10.0.0||^9.0.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- spatie/laravel-ray: ^1.35
This package is auto-updated.
Last update: 2026-06-23 19:34:22 UTC
README
Official Laravel integration for Noscrape.
Protect publicly visible text from automated scraping with a simple Blade component. The package automatically collects all protected content, sends it to the Noscrape API, injects a generated font, and renders the obfuscated text back in the browser.
Features
- Simple Blade component
- One API request per page
- Automatic font generation
- No JavaScript framework required
- Laravel 11 & 12 compatible
- Supports public cloud and on-premise installations
Installation
Install the package via Composer:
composer require noscrape/noscrape-laravel
Publish the configuration file:
php artisan vendor:publish --tag="noscrape-config"
Configuration
For most installations only an API key is required.
Simply visit https://noscrape.eu, choose your plan and create your api key.
NOSCRAPE_API_KEY=your-api-key
If you are using an on-premise or private Noscrape installation, configure the host as well.
NOSCRAPE_API_KEY=your-api-key NOSCRAPE_HOST=https://noscrape.example.com
NOSCRAPE_HOST is optional and defaults to the public Noscrape API.
Usage
Wrap any text you want to protect.
<x-noscrape::obfuscated> customer@example.com </x-noscrape::obfuscated>
Finally, include the renderer once before the closing </body> tag.
@noscrapeScripts
Complete example
<!DOCTYPE html> <html lang="en"> <head> <title>Noscrape Example</title> </head> <body> <h1> <x-noscrape::obfuscated> Contact us </x-noscrape::obfuscated> </h1> <p> <x-noscrape::obfuscated> info@example.com </x-noscrape::obfuscated> </p> <p> <x-noscrape::obfuscated> +49 123 456789 </x-noscrape::obfuscated> </p> @noscrapeScripts </body> </html>
How it works
- Every
<x-noscrape::obfuscated>component registers its content during rendering. @noscrapeScriptssends all collected values to the Noscrape API in a single request.- The API returns:
- obfuscated text
- a generated font
- The package injects the font and replaces the placeholder elements with the protected text.
The original text is therefore no longer present in the HTML source.
Why Noscrape?
Noscrape uses dynamically generated fonts instead of simply encoding or hiding text.
Benefits
- Protects publicly visible text from automated scraping
- One request for all protected elements
- Fast integration
- Minimal performance overhead
- No build step required
- Works with server-rendered Blade templates
- Supports self-hosted deployments
Requirements
- PHP 8.2+
- Laravel 11 or newer
- A Noscrape API key
Testing
Run the test suite:
composer test
Run static analysis:
composer analyse
Format the code:
composer format
License
The MIT License (MIT).