Skip to content


Repository files navigation

Build status

Visit the official Shodan API documentation at:

This is still in active development, error handling might not well handle well. Best bet when working with any libraries you didn't write..harden your calls!

APi Docs

You can find doxygen docs here


install-package Shodan.Net

Getting started

You need to have an Api key. Get your api key here.

Create a shodan client. Note that ShodanClient inerhits from IDisposable, so you should wrap it in a using, or make sure it will be disposed. Shodan client is thread safe, so you should be able to keep 1 object around for many requests.

var client = new Shodan.Net.ShodanClient("myapiKey");

Now just query away. You should be able to find all the actions in the docs or just through the docs in intellisense.

await client.GetPortsAsync();
await client.GetHostAsync("");
await client.GetMyIpAsync();


Searching shodan requires you to build up queries, and facets to make it easier we have used a generator pattern to produce queries.

           await client.SearchHosts(
                query: a => a.Withcity("boston")
                facet: b => b.WithAsn()