<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[howto - Shodan Blog]]></title><description><![CDATA[The latest news and developments for Shodan.]]></description><link>https://blog.shodan.io/</link><generator>Ghost 0.7</generator><lastBuildDate>Sat, 11 Apr 2026 20:20:28 GMT</lastBuildDate><atom:link href="https://blog.shodan.io/tag/howto/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[How To:  Download Data using the API]]></title><description><![CDATA[<h6 id="howmuchdatacanidownload">How much data can I download?</h6>

<p>If you have an API plan then you get a certain number of <strong>query credits</strong> that you can spend each month. For people with the <a href="https://www.shodan.io/store/member">Shodan Membership</a> that means you get <strong>100 query credits</strong> per month while for the <a href="https://developer.shodan.io/pricing">API plans</a> it can range</p>]]></description><link>https://blog.shodan.io/how-to-download-data/</link><guid isPermaLink="false">8f18544c-91be-4ce3-93ea-a6fd4abc982c</guid><category><![CDATA[API]]></category><category><![CDATA[howto]]></category><dc:creator><![CDATA[John Matherly]]></dc:creator><pubDate>Thu, 14 Jul 2016 01:22:00 GMT</pubDate><media:content url="http://blog.shodan.io/content/images/2016/09/pingmap-4k.png" medium="image"/><content:encoded><![CDATA[<h6 id="howmuchdatacanidownload">How much data can I download?</h6>

<img src="http://blog.shodan.io/content/images/2016/09/pingmap-4k.png" alt="How To:  Download Data using the API"><p>If you have an API plan then you get a certain number of <strong>query credits</strong> that you can spend each month. For people with the <a href="https://www.shodan.io/store/member">Shodan Membership</a> that means you get <strong>100 query credits</strong> per month while for the <a href="https://developer.shodan.io/pricing">API plans</a> it can range from <strong>10,000</strong> up to <strong>unlimited</strong>.</p>

<blockquote>
  <p>1 query credit = 100 results</p>
</blockquote>

<p>Every query credit gets you up to 100 results, which means that you can download at least <strong>10,000</strong> results every month - regardless of the type of search you're performing.</p>

<h6 id="usingthecommandlinetool">Using the Command-Line Tool</h6>

<p>The <a href="https://cli.shodan.io">Shodan CLI</a> provides a command to easily download data using the query credits from your API. Here's a quick video that shows how it works in action:</p>

<script type="text/javascript" src="https://asciinema.org/a/85007.js" id="asciicast-85007" async></script>

<p>The basics of it are:</p>

<pre><code>shodan download --limit &lt;number of results&gt; &lt;filename&gt; &lt;search query&gt;
</code></pre>

<p>For example, this is the command to download 500 results for the search query "product:mongodb" which returns Internet-facing MongoDB services:</p>

<pre><code>shodan download --limit 500 mongodb-results product:mongodb
</code></pre>

<p>The results of the above command will be saved in a file called <strong>mongodb-results.json.gz</strong>. At this point, you can easily convert the file into CSV, KML or simply output a list of IP:port pairs by using the <strong>shodan parse</strong> command:</p>

<pre><code>shodan parse --fields ip_str,port --separator , mongodb.json.gz
</code></pre>

<h6 id="programmingwiththeshodanapi">Programming with the Shodan API</h6>

<p>The <a href="https://cli.shodan.io">CLI</a> should work for most people but sometimes you want to perform custom transformations on the banners as you're downloading them. Or you don't want to store the information in a local file. In those cases, you can use a convenient helper method provided by the Python library for Shodan called <strong>search_cursor()</strong> to iterate over the results:</p>

<pre><code>import shodan

api = shodan.Shodan('Your API key')

limit = 500
counter = 0
for banner in api.search_cursor('product:mongodb'):
    # Perform some custom manipulations or stream the results to a database
    # For this example, I'll just print out the "data" property
    print(banner['data'])

    # Keep track of how many results have been downloaded so we don't use up all our query credits
    counter += 1
    if counter &gt;= limit:
        break
</code></pre>]]></content:encoded></item></channel></rss>