# Leaked Shodan API Key? Regenerate It and Check Usage

> Shodan API key exposed in a repo or script? Regenerate it in your account, check query credits and usage, then update every tool. Step-by-step.

Source: https://leakwatch.net/secrets/shodan-api-key

---

[LeakWatch](/)

[Product](/product)[Live feed](/leaks)[Guides](/secrets)[Blog](/blog)[Free scan](/)

1.  [Home](/)
2.  [Secrets](/secrets)
3.  Shodan API Key

Databases & keys · Secret guide

# Leaked Shodan API Key: what to do in the first hour

High severityDetected onlyLast verified November 5, 2026 · 5 min read

A Shodan API key identifies your account when a script or tool queries Shodan, the search engine for internet-connected devices. The key is tied to a query and scan allowance, so a leaked key mainly lets someone use your credits and see the results that your account is entitled to. Because Shodan results can include details about your own internet-facing systems, the search history and any saved scans are also worth a look. Regenerate the key first, then review what the account was used for.

[Check your GitHub account for leaked secrets — free](/)

Provider

Shodan

Severity

High

Impact

SaaS account access and billing

Checked live by LeakWatch

No

## What a Shodan API Key looks like

Shodan keys are a string of 32 letters and digits with no visible prefix. The rule in LeakWatch looks for that shape, and only reports it when the word `shodan` appears within a short distance before it. A masked example of the layout:

```text
shodan … XXXX…XXXX   key shape near the vendor name (masked)
```

Because the value is just letters and digits, the vendor’s name is what identifies it. The key is often used as a query parameter in a web address, which means it can appear in a browser history, a proxy log or a shared link, not only in source code. Treat any Shodan key you find in a file or a link as exposed, and remember that a key in a URL is visible to every server that logs the request.

## How Shodan API Keys get leaked

-   **Scripts and tools in repositories.** A reconnaissance or monitoring script that carries the key so it can run on other machines, pushed to a repository.
-   **URLs in code and logs.** A request that puts the key in the query string, which is then recorded in web server logs, proxy logs or analytics tools.
-   **Browser extensions and integrations.** A plug-in configuration that stores the key in plain text, copied into a shared settings file.
-   **Shared notebooks.** A key pasted into a notebook used for security research, then published with the outputs.
-   **Support requests.** A key pasted into a ticket or a forum post when a query returned an error.

## What to do in the first hour

1.  **Regenerate the key.** Sign in to your Shodan account and open the account settings where the API key is shown. Generate a new key, then update your tools. Stop the old key from being used by deleting or replacing it once the new one is in place.
2.  **Update every tool.** Find each script, plug-in and integration that uses the key, and give it the new value through the environment or a secret store.
3.  **Check query credits.** Review how many credits and scans were used for the period since the exposure. A spike in use is the clearest sign of misuse.
4.  **Review saved searches and alerts.** Look at saved queries, alerts and monitored networks on the account. Remove any you do not recognize, since they reveal what someone was watching.
5.  **Check the network side.** If Shodan data reveals your own exposed services, review the firewall rules and close anything that should not be reachable from the internet.
6.  **Check the rest of the file.** Revoke any other credentials kept next to the key, such as cloud or database credentials used by the same tool.
7.  **Clean the repository.** Remove the value from current files and from any URLs in the code, add the configuration to `.gitignore`, and rewrite history if the repository was public. See [I accidentally pushed an API key to GitHub](/blog/i-accidentally-pushed-an-api-key-to-github) for the full order.

Not sure what else leaked from the same repository? [Run a free scan](/).

[Not sure what else leaked? Run a free scan.](/)

## Revoke it at Shodan

Shodan shows the API key on the account page after you sign in, usually through a control labeled to show the key in the account area. We could not find an official Shodan page that describes regenerating the key, so the sources we reviewed were third-party guides. In general, the approach is to generate a new key on the account page and then delete or replace the old one. Once the old key is replaced, any tool that still uses it will stop working, so update the tools before you finish. Check the account page yourself, since the layout may have changed since the guides were written, and treat the steps above as a plan to confirm rather than a fixed procedure.

## How LeakWatch detects it

The rule is called “Shodan API Key”. It looks for the word `shodan`, followed within about 40 characters by a value of exactly 32 letters or digits, with word boundaries around the value. The word requirement is what stops the rule from flagging any 32-character word. The severity is **high**, with the SaaS impact class, because the key spends credits and gives access to search results. **This type is not checked live**: LeakWatch does not send the value to Shodan, so a finding means a matching value sat near the name, not that the key still works.

LeakWatch detects this format but does **not** check it live: it can tell you the key is exposed, not whether it still works. Assume it does until you have revoked it.

## FAQ

Is a Shodan key a risk to my own systems?

Indirectly. The key does not open your systems, but it lets someone query the same internet data you use, including data about your own exposed services. Use the saved searches and alerts to see what was being watched.

The key was only in a URL. Does that still count?

Yes. Keys in query strings are recorded by web servers, proxies and analytics tools, so they can leak in places you do not control. Treat the key as exposed and replace it.

Can I keep the same key and just restrict it?

Shodan keys are not generally restricted by IP or scope in the way that some other APIs are, so the practical fix for a leak is replacement. Keep the new key in a secret store and avoid putting it in URLs.

## Related

-   [Cloudflare Global API Key](/secrets/cloudflare-global-api-key)
-   [Fastly API Token](/secrets/fastly-api-token)
-   [Cisco Meraki API Key](/secrets/cisco-meraki-api-key)
-   [I accidentally pushed an API key to GitHub](/blog/i-accidentally-pushed-an-api-key-to-github)
-   [Which vendors leak most this week](/leaks/trends)
-   [All secret guides](/secrets)

[Get alerted next time a secret leaks — create a free account](/)

LeakWatch is not affiliated with Shodan.

![Gabriel Diyan, founder of LeakWatch](/brand/Photo-Gabriel-Diyan.webp)

Gabriel Diyan (0xCr0c0)

Cybersecurity student, founder of LeakWatch. I built and run the scanner described here — the detection patterns, the false-positive classifier and the provider validators are mine. [More about who I am](/about).

[GitHub](https://github.com/Leakwatch-Scan) · [X](https://x.com/LeakwatchScan) · [LinkedIn](https://www.linkedin.com/in/gabriel-diyan-80a378375) · [GitHub (personal)](https://github.com/crocogab)

LeakWatch

Secrets leak into public commits every minute. This watches the forges for yours. Built and run by [Gabriel Diyan](/about), a cybersecurity student — [why LeakWatch exists](/about).

Scan

-   [Product](/product)
-   [Live feed](/leaks)
-   [Trends](/leaks/trends)
-   [API docs](/docs)
-   [CI/CD](/docs?tab=ci)

Read

-   [Blog](/blog)
-   [Secret guides](/secrets)
-   [Changelog](/changelog)
-   [About](/about)

Verify

-   [Security](/security)
-   [Privacy](/privacy)
-   [Terms](/terms)
-   [Legal](/legal)
-   [Contact](/contact)
-   [Status](https://status.leakwatch.net)

© 2026 LeakWatch

[GitHub](https://github.com/Leakwatch-Scan)[X](https://x.com/LeakwatchScan)
