jeff-99 / OpenKVK

python wrapper for the OpenKVK API
MIT License
4 stars 3 forks source link

Name or service not known #3

Open WouterEekhout opened 6 years ago

WouterEekhout commented 6 years ago

When executing your code I get an error.

I execute the following code:


        from OpenKVK import ApiClient

        client = ApiClient()
        client.get_by_city('Rotterdam')

Which Results in the following error:

Traceback (most recent call last):
  File "/kvk/contacts/tests.py", line 11, in test_get_by_dossier
    client.get_by_city('Rotterdam')
  File "/kvk/venv/lib/python3.6/site-packages/OpenKVK/Client.py", line 291, in get_by_city
    return self.do_query(basequery,limit,**kwargs)
  File "/kvk/venv/lib/python3.6/site-packages/OpenKVK/Client.py", line 219, in do_query
    response = self.request(query_buffer[q])
  File "/kvk/venv/lib/python3.6/site-packages/OpenKVK/Client.py", line 73, in request
    request = urlopen(url)
  File "/usr/lib64/python3.6/urllib/request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib64/python3.6/urllib/request.py", line 526, in open
    response = self._open(req, data)
  File "/usr/lib64/python3.6/urllib/request.py", line 544, in _open
    '_open', req)
  File "/usr/lib64/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib64/python3.6/urllib/request.py", line 1346, in http_open
    return self.do_open(http.client.HTTPConnection, req)
  File "/usr/lib64/python3.6/urllib/request.py", line 1320, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno -2] Name or service not known>

Can anyone help me to resolve this error?

richardbrinkman commented 2 years ago

I get the same error. It seems that this module is using some outdated API. In Client.py I find a BASE_URL which points to http://api.openkvk.nl. This URL does not exist at all. I did find another API with a similar name: https://api.overheid.io/openkvk (found at https://overheid.io/documentatie/openkvk). There is also an https://openkvk.nl address which does not work at the moment because their SSL certificate expired 2 days ago.