netlas-io/netlas-python

[Bug] Sample code fails with JSON parse error

nicoandmee opened this issue · 2 comments

Hi, I'm attempting to get the basic sample code provided working but have run into trouble. I get the following error when running it- I have tried multiple python versions as well. 🤔

import netlas

apikey = "API_KEY"

netlas_connection = netlas.Netlas(api_key=apikey)
query_res = netlas_connection.query(query="port:7001")
print(netlas.helpers.dump_object(data=query_res))
python netlas_query.py
Traceback (most recent call last):
  File "/home/op/shodan/netlas_query.py", line 6, in <module>
    query_res = netlas_connection.query(query="port:7001")
  File "/home/op/.pyenv/versions/3.10.4/lib/python3.10/site-packages/netlas/client.py", line 127, in query
    ret = self._request(
  File "/home/op/.pyenv/versions/3.10.4/lib/python3.10/site-packages/netlas/client.py", line 69, in _request
    raise APIError(ret["error"])

Fixed in v0.3.0