PHPackages                             harrisonratcliffe/laravel-google-web-risk - 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. harrisonratcliffe/laravel-google-web-risk

ActiveLibrary[API Development](/categories/api)

harrisonratcliffe/laravel-google-web-risk
=========================================

Laravel package to allow you to easily integrate the Google Web Risk API into your application

1.0.4(1y ago)081[2 PRs](https://github.com/harrisonratcliffe/laravel-google-web-risk/pulls)GPL-3.0PHPPHP &gt;=5.6.3CI passing

Since Mar 25Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/harrisonratcliffe/laravel-google-web-risk)[ Packagist](https://packagist.org/packages/harrisonratcliffe/laravel-google-web-risk)[ Docs](https://github.com/harrisonratcliffe/laravel-google-web-risk)[ RSS](/packages/harrisonratcliffe-laravel-google-web-risk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)DependenciesVersions (8)Used By (0)

Laravel Google Web Risk
=======================

[](#laravel-google-web-risk)

[![Latest Stable Version](https://camo.githubusercontent.com/003da3ee5a08e4edbfee42b865029cc6ab623b246f1cdded0c40a1e4edaaea09/68747470733a2f2f706f7365722e707567782e6f72672f6861727269736f6e726174636c696666652f6c61726176656c2d676f6f676c652d7765622d7269736b2f762f737461626c652e737667)](https://packagist.org/packages/harrisonratcliffe/laravel-google-web-risk) [![Total Downloads](https://camo.githubusercontent.com/2054182829a11b42b1f888bb578ad426d77092bc445f449fbce5f38136360a41/68747470733a2f2f706f7365722e707567782e6f72672f6861727269736f6e726174636c696666652f6c61726176656c2d676f6f676c652d7765622d7269736b2f646f776e6c6f6164732e737667)](https://packagist.org/packages/harrisonratcliffe/laravel-google-web-risk) [![License](https://camo.githubusercontent.com/52397050320be978109417d52867d941179127a466592df9591eb3340797a1d1/68747470733a2f2f706f7365722e707567782e6f72672f6861727269736f6e726174636c696666652f6c61726176656c2d676f6f676c652d7765622d7269736b2f6c6963656e73652e737667)](https://packagist.org/packages/harrisonratcliffe/laravel-google-web-risk)

**This package requires that you have a Google API key. It absolutely will not work without one.**

Overview
--------

[](#overview)

The `harrisonratcliffe/laravel-google-web-risk` package provides a simple interface for integrating with the Google Web Risk API to check if URLs are harmful or not, leveraging Google's threat intelligence. This package allows developers to assess the safety of URLs based on predefined threat types, making it an essential tool for web applications that require enhanced security measures.

Right now it's only using the Search API, but I'll be updating it to include the remaining APIs later. It's free up to 100k requests per month.

**This package requires that you have a Google API key. It absolutely will not work without one.**

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

[](#installation)

You can install the package via Composer. Run the following command in your Laravel project:

```
composer require harrisonratcliffe/laravel-google-web-risk
```

Once installed, you will need to add the service provider to your `config/app.php` if using Laravel versions below 5.5:

```
'providers' => [
    // ...
    Harrisonratcliffe\LaravelGoogleWebRisk\GoogleWebRiskServiceProvider::class,
],
```

Configuration
-------------

[](#configuration)

Publish the configuration file using the following Artisan command:

```
php artisan vendor:publish --provider="Harrisonratcliffe\LaravelGoogleWebRisk\GoogleWebRiskServiceProvider"
```

This will create a configuration file located at `config/google-web-risk.php`. You must set your **Google API key** in your `.env` file:

```
GOOGLE_API_KEY=your_google_api_key
```

You can also modify other settings, such as `timeout` and `threat_types` as needed:

```
'google' => [
    'api_key' => env('GOOGLE_API_KEY'),
    'timeout' => 10, // Timeout in seconds
    'threat_types' => [
        'MALWARE',
        'SOCIAL_ENGINEERING',
        'UNWANTED_SOFTWARE',
        'SOCIAL_ENGINEERING_EXTENDED_COVERAGE',
    ],
],
```

### Important:

[](#important)

The Google Web Risk free tier is limited to **100,000 requests per month**. Ensure to monitor your usage to avoid exceeding this limit.

Usage
-----

[](#usage)

### Checking URL Safety

[](#checking-url-safety)

You can check the safety of a URL using the `isSafe` method provided by the `GoogleWebRisk` class:

```
use Harrisonratcliffe\LaravelGoogleWebRisk\GoogleWebRisk;

$url = "http://example.com";
$googleWebRisk = new GoogleWebRisk();

if ($googleWebRisk->isSafe($url)) {
    echo "The URL is safe.";
} else {
    echo "The URL may be harmful.";
}
```

### Direct API Access

[](#direct-api-access)

If you need to access the raw response from the Google Web Risk API to see what specific threats are flagged, you can invoke the `checkUrl` method directly:

```
$response = GoogleWebRisk::checkUrl($url);

if (isset($response['error'])) {
    // Handle error
    echo $response['details'];
} else {
    // Process response data
    var_dump($response);
}
```

### Test URLs

[](#test-urls)

Here are some handy test urls you can use while you're experimenting with the system.

-  (OK)
- -  (OK)
-  (Malware)
-  (malware)

License
-------

[](#license)

This package is open-sourced software licensed under the [GNU General Public License](LICENSE).

Contributing
------------

[](#contributing)

If you would like to contribute to this project, please submit a pull request or open an issue on the GitHub repository.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance64

Regular maintenance activity

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 72.7% 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

5

Last Release

406d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c4b0218f62234c66a7c65601d79a21643bfe0d61529dc3d867a55441b9da2681?d=identicon)[harrisonratcliffe](/maintainers/harrisonratcliffe)

---

Top Contributors

[![harrisonratcliffe](https://avatars.githubusercontent.com/u/53269265?v=4)](https://github.com/harrisonratcliffe "harrisonratcliffe (16 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")

---

Tags

urllaravelcheckgooglesafemalwareweb risk

### Embed Badge

![Health badge](/badges/harrisonratcliffe-laravel-google-web-risk/health.svg)

```
[![Health](https://phpackages.com/badges/harrisonratcliffe-laravel-google-web-risk/health.svg)](https://phpackages.com/packages/harrisonratcliffe-laravel-google-web-risk)
```

###  Alternatives

[mbarwick83/shorty

Google Url Shortener API Package for Laravel 5.1

31204.9k](/packages/mbarwick83-shorty)[thujohn/analytics

Google Analytics for Laravel 4

113108.7k1](/packages/thujohn-analytics)[snipe/safebrowsing

Laravel package to allow you to easily integrate the Google Safebrowing API into your application.

1223.9k](/packages/snipe-safebrowsing)[hosseinhezami/laravel-gemini

A production-ready Laravel package to integrate with the Google Gemini API. Supports text, image, video, audio, long-context, structured output, files, caching, function-calling and understanding capabilities.

14010.8k1](/packages/hosseinhezami-laravel-gemini)[gemini-api-php/laravel

Gemini API client for Laravel

8915.7k](/packages/gemini-api-php-laravel)[ozankurt/google-analytics

Laravel Google Analytics

7616.7k](/packages/ozankurt-google-analytics)

PHPackages © 2026

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