Before putting a Shodan API key into application code, call the official api-info endpoint to confirm validity, plan, and quotas.

Shortest check

Validate with one curl request

curl -X GET "https://api.shodan.io/api-info?key={YOUR_API_KEY}"

Replace {YOUR_API_KEY} locally. Do not share the command, terminal screenshot, or browser URL when it contains the real secret.

How to read common fields

FieldMeaningWhat to check
planCurrent API plan identifierConfirm it matches the delivery description
query_creditsRemaining query creditsRelevant to filters, paging, and downloads
scan_creditsRemaining scan creditsGenerally one credit per scanned IP under current rules
monitored_ipsMonitored IP capacity or stateRelevant to network monitoring capabilities
unlockedWhether some results or endpoints are unlockedOutput varies by plan; use the live response

Recommended validation order

  1. 1
    Check HTTP status

    A valid request returns JSON. Investigate the key and request format after 401 or 403 errors.

  2. 2
    Confirm the plan

    Do not judge the key from one credit value alone.

  3. 3
    Record initial quotas

    Keep a private delivery-time record for later troubleshooting.

  4. 4
    Run one minimal query

    Validate code and network behavior before adding filters, paging, or bulk work.

Do not store the API key here

  • Do not commit it to Git or embed it in frontend JavaScript.
  • Keep it out of screenshots, logs, telemetry, and public chats.
  • Use environment variables or a secret manager in production.
  • If exposed, stop using it and contact the responsible provider.
References

References

This article supports product understanding, development learning, and lawful authorized use. Third-party documentation, software versions, and platform rules may change.

FAQ

Frequently asked questions

What should I do after a 401 or 403 response?

Check that the key is complete, contains no whitespace, and that the URL is correct. If it still fails, confirm the key state and plan. Never post the real key in a public chat or screenshot.

Does query_credits equal to zero block all searches?

Not necessarily. Credit consumption depends on filters, pagination, and endpoints.

Can I validate the key in a browser address bar?

Technically yes, but browser history, screen recordings, and shared devices can expose it. Prefer a controlled terminal or secret-aware client.