PHPackages                             rattfieldnz/shodan - 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. rattfieldnz/shodan

ActivePackage[API Development](/categories/api)

rattfieldnz/shodan
==================

A laravel package to check URLs with Shodan API.

1.0.2(5y ago)38[5 PRs](https://github.com/rattfieldnz/shodan/pulls)MITHTMLPHP &gt;=7.2

Since Aug 17Pushed 3y ago2 watchersCompare

[ Source](https://github.com/rattfieldnz/shodan)[ Packagist](https://packagist.org/packages/rattfieldnz/shodan)[ Docs](https://github.com/rattfieldnz/shodan)[ Fund](https://www.blockchain.com/btc/payment_request?address=13vYNWKj3npQTYr7EJVBhcoVkwncEbDUvJ)[ RSS](/packages/rattfieldnz-shodan/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (12)Versions (16)Used By (0)

Shodan
======

[](#shodan)

[![PHP Version](https://camo.githubusercontent.com/5799d481d820b8b0e4e34b949ca694e358198e1c525964065043ed7c6ac5f5e1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372e332532422d677265656e2e737667)](https://packagist.org/packages/rattfieldnz/shodan) [![PHP Version](https://camo.githubusercontent.com/16d8fbbc862a8e88207acda602834d0e47fa7a6ad81e77902c405053cfcb96bb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372e322532422d677265656e2e737667)](https://packagist.org/packages/rattfieldnz/shodan)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![Latest Version on Packagist](https://camo.githubusercontent.com/836d2cc6c376699d9f184e6e540a4b2628aca0e7c5465155fcd60738561159b3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726174746669656c646e7a2f73686f64616e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rattfieldnz/shodan)[![Total Downloads](https://camo.githubusercontent.com/5b432e573978dc4c679dfd46162f755e745d43d45f81a2e4028fc2c524063b9f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726174746669656c646e7a2f73686f64616e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rattfieldnz/shodan)[![Build Status](https://camo.githubusercontent.com/29caae481285b9efcad3b2181eb355e896080e55e81ca7e2c8a260feac569ea8/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f726174746669656c646e7a2f73686f64616e2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/rattfieldnz/shodan)[![StyleCI](https://camo.githubusercontent.com/a57fe21d8b11a4d10f95384bcee60711fcbccfb8d2c1a25ea227b3a71984eecc/68747470733a2f2f7374796c6563692e696f2f7265706f732f3230323834323337302f736869656c64)](https://styleci.io/repos/202842370)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/6bce2a6ee3f5221135865fd836220f2ab10dcae00f11724c6931357d7eae21ea/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f726174746669656c646e7a2f73686f64616e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/rattfieldnz/shodan/?branch=master)[![codecov](https://camo.githubusercontent.com/60baa1071f4bd942b31ddd8841e61b3ef0a4506a68640868147da6a53ea6f670/68747470733a2f2f636f6465636f762e696f2f67682f726174746669656c646e7a2f73686f64616e2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/rattfieldnz/shodan)

A laravel package to check URLs with Shodan API.

- [Installation](#installation)
    - [Register Service Provider](#register_service_provider)
    - [Register Facade](#register_facade)
    - [Register Facade](#register_facade)
    - [Publish Configuration File](#publish_config_file)
    - [Set your Shodan API key](#set_shodan_api_key)
- [Usage](#usage)
    - [Using Blade Syntax](#using_blade_syntax)
    - [Using Facades](#using_facades)
- [Example with input and output (associative array)](#example_input_output_associative_array)
- [Example with input and output (JSON)](#example_input_output_json)
- [Testing](#testing)
- [Security](#security)
- [Credits](#credits)

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

[](#installation)

Install via composer

```
composer require rattfieldnz/shodan
```

### Register Service Provider

[](#register-service-provider)

**Note! This and next step are optional if you use laravel&gt;=5.5 with package auto discovery feature.**

Add service provider to `config/app.php` in `providers` section.

```
RattfieldNz\Shodan\ShodanServiceProvider::class,
```

### Register Facade

[](#register-facade)

Register package facade in `config/app.php` in `aliases` section

```
RattfieldNz\Shodan\Facades\ShodanFacade::class,
```

### Publish Configuration File

[](#publish-configuration-file)

```
php artisan vendor:publish --provider="RattfieldNz\Shodan\ShodanServiceProvider" --tag="shodan"
```

### Set your Shodan API key

[](#set-your-shodan-api-key)

In your `.env`, add:

```
SHODAN_API_KEY=YOUR-ACTUAL-API-KEY
SHODAN_REQUEST_TIMEOUT=10
```

Usage
------------------------------------

[](#usage)

### Using Blade Syntax

[](#using-blade-syntax)

```
@if(isset(Shodan::setUrl('https://github.com')->check()->getResults()))
    // Iterate over associative array results.
    // getResults(true) returns results as JSON-encoded string.
@else
    No results were found
@endif
```

`getResults(true)` returns results as JSON-encoded string.

### Using Facades

[](#using-facades)

```
Shodan::setUrl('https://github.com');
Shodan::check();
Shodan::getResults();
```

Or:

```
Shodan::setUrl('https://github.com')->check()->getResults();
```

Example with input and output (associative array)
-----------------------------------------------------------------------------------------------------------------

[](#example-with-input-and-output-associative-array)

View [EXAMPLE\_INPUT\_OUTPUT\_ASSOCIATIVEARRAY.md](https://github.com/rattfieldnz/shodan/blob/master/EXAMPLE_INPUT_OUTPUT_ASSOCIATIVEARRAY.md).

Example with input and output (JSON)
---------------------------------------------------------------------------------------

[](#example-with-input-and-output-json)

View [EXAMPLE\_INPUT\_OUTPUT\_JSON.md](https://github.com/rattfieldnz/shodan/blob/master/EXAMPLE_INPUT_OUTPUT_JSON.md).

Testing
----------------------------------------

[](#testing)

From inside the root folder of this package:

```
$ chmod u+x run_phpunit && ./run_phpunit YOUR_SHODAN_API_KEY
```

Replace YOUR\_SHODAN\_API\_KEY with your actual key. Get one by visiting .

Security
------------------------------------------

[](#security)

If you discover any security related issues, please email instead of using the issue tracker.

Credits
----------------------------------------

[](#credits)

- [Robert Attfield](https://github.com/rattfieldnz/shodan)
- [All contributors](https://github.com/rattfieldnz/shodan/graphs/contributors)

This package is bootstrapped with the help of [melihovv/laravel-package-generator](https://github.com/melihovv/laravel-package-generator).

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 95.1% 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 ~281 days

Total

3

Last Release

1943d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c0ece250cf895d774e0b482665113970f099e7b0efbdcbb3fbfaaea1d4166fa?d=identicon)[rattfieldnz](/maintainers/rattfieldnz)

---

Top Contributors

[![rattfieldnz](https://avatars.githubusercontent.com/u/2468863?v=4)](https://github.com/rattfieldnz "rattfieldnz (58 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (3 commits)")

---

Tags

apilaravelphpshodanshodan-apiapishodanwebsitescheck urlssafe urls

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/rattfieldnz-shodan/health.svg)

```
[![Health](https://phpackages.com/badges/rattfieldnz-shodan/health.svg)](https://phpackages.com/packages/rattfieldnz-shodan)
```

###  Alternatives

[saloonphp/laravel-plugin

The official Laravel plugin for Saloon

806.6M187](/packages/saloonphp-laravel-plugin)[resend/resend-laravel

Resend for Laravel

1212.2M8](/packages/resend-resend-laravel)[essa/api-tool-kit

set of tools to build an api with laravel

53386.5k](/packages/essa-api-tool-kit)

PHPackages © 2026

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