Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Unable to parse JSON response #51

Closed
ghost opened this issue Aug 1, 2017 · 7 comments
Closed

Error: Unable to parse JSON response #51

ghost opened this issue Aug 1, 2017 · 7 comments

Comments

@ghost
Copy link

ghost commented Aug 1, 2017

Hi, there.
I run the sample code in your python docs pages.
However, it returned an error.

Error: Unable to parse JSON response

Most of time the api will return errors although sometimes it can successfully execute. And I really don't know why.
My os is Win10 and I also tried it at Win7. Doesn't work too.

@ghost
Copy link

ghost commented Aug 2, 2017

Could you please show the exact call (without key obviously) and the full traceback please?

@seraphyong
Copy link

seraphyong commented Aug 3, 2017

I have the same error. @wagner-certat .
those are my code:
import shodan
import json
api = shodan.Shodan(SHODAN_API_KEY)
query = "port:80"
try:
results = api.search(query)
print("Results found: %s"%results['total'])
for result in results['matches']:
print('IP: %s' % result['ip_str'])
except shodan.APIError as e:
print('Error: %s' % e)

@ghost
Copy link

ghost commented Aug 3, 2017

Works for me. Which python-version are you using on which OS? Which shodan version?

@ghost
Copy link

ghost commented Aug 3, 2017

And please show a traceback, that really helps ;)

@mdiviesti
Copy link

FYI: I was running into a similar issue on Mac with Python 3 and shodan installed via pip3.
In my case, particularly, I was looping through a set of products that exist on my network and hitting the exploit endpoint to search for vulnerabilities.
Once I added a slight delay between requests, I no longer received the error.
I'm not sure if this helps any of the reported cases above but, hope it will.

@ldbfpiaoran
Copy link

@mdiviesti yes I use python3 also have the status. so I want write a script use python3 of shodan api.
But I can't find the shodan api about shodan search equipment. Can you help me?

@achillean
Copy link
Owner

Closing this issue as it's more support related and less a problem with the library. Please contact support@shodan.io for development questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants